Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new GPT-4o model #22

Merged
merged 4 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,25 @@ linters-settings:
# Default: false
all: true

varcheck:
# Check usage of exported fields and variables.
# Default: false
exported-fields: false # default false # TODO: enable after fixing false positives
dupl:
# Minimum token sequence as a clone.
threshold: 250


linters:
disable-all: true
enable:
## enabled by default
- deadcode # Finds unused code
# - deadcode # Finds unused code
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- gosimple # Linter for Go source code that specializes in simplifying a code
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- ineffassign # Detects when assignments to existing variables are not used
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- structcheck # Finds unused struct fields
# - structcheck # Finds unused struct fields
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
- unused # Checks Go code for unused constants, variables, functions and types
- varcheck # Finds unused global variables and constants
# - varcheck # Finds unused global variables and constants
## disabled by default
# - asasalint # Check for pass []any as any in variadic func(...any)
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
Expand Down
12 changes: 12 additions & 0 deletions models/chat_completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ const (
// GPT4TurboPreview (GPT-4 Turbo) is the latest GPT-4. It currently points to gpt-4-0125-preview, however, may
// receive updates in the future.
GPT4TurboPreview

// GPT4o (GPT-4o) is the most advanced model. It is multimodal (accepting text or image inputs and outputting text),
// and it has the same high intelligence as GPT-4 Turbo but is much more efficient—it generates text 2x faster and
// is 50% cheaper. Additionally, GPT-4o has the best vision and performance across non-English languages of any model.
GPT4o

// GPT4o20240503 is a snapshot of gpt-4o from May 13th, 2024.
GPT4o20240503
)

// String implements the fmt.Stringer interface.
Expand Down Expand Up @@ -111,6 +119,8 @@ var chatCompletionToString = map[ChatCompletion]string{
GPT4Turbo1106Preview: "gpt-4-1106-preview",
GPT4Turbo0125Preview: "gpt-4-0125-preview",
GPT4TurboPreview: "gpt-4-turbo-preview",
GPT4o: "gpt-4o",
GPT4o20240503: "gpt-4o-2024-05-13",
}

var stringToChatCompletion = map[string]ChatCompletion{
Expand All @@ -129,4 +139,6 @@ var stringToChatCompletion = map[string]ChatCompletion{
"gpt-4-1106-preview": GPT4Turbo1106Preview,
"gpt-4-0125-preview": GPT4Turbo0125Preview,
"gpt-4-turbo-preview": GPT4TurboPreview,
"gpt-4o": GPT4o,
"gpt-4o-2024-05-13": GPT4o20240503,
}
Loading