From 7289057cdeefbb2faa2f8c5ae06aa884dc30cd6b Mon Sep 17 00:00:00 2001 From: Andy Day Date: Wed, 15 May 2024 11:26:05 -0700 Subject: [PATCH 1/4] Add new GPT-4o model --- models/chat_completions.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/models/chat_completions.go b/models/chat_completions.go index 656ee0c..bfd6aa5 100644 --- a/models/chat_completions.go +++ b/models/chat_completions.go @@ -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. @@ -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: "ggpt-4o-2024-05-13", } var stringToChatCompletion = map[string]ChatCompletion{ @@ -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, + "ggpt-4o-2024-05-13": GPT4o20240503, } From 0a6cbc8bf2d7aefd808b2922a2746e8f1f14bb0c Mon Sep 17 00:00:00 2001 From: Andy Day Date: Wed, 15 May 2024 11:29:15 -0700 Subject: [PATCH 2/4] fix typo --- models/chat_completions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/chat_completions.go b/models/chat_completions.go index bfd6aa5..7fa9f0d 100644 --- a/models/chat_completions.go +++ b/models/chat_completions.go @@ -120,7 +120,7 @@ var chatCompletionToString = map[ChatCompletion]string{ GPT4Turbo0125Preview: "gpt-4-0125-preview", GPT4TurboPreview: "gpt-4-turbo-preview", GPT4o: "gpt-4o", - GPT4o20240503: "ggpt-4o-2024-05-13", + GPT4o20240503: "gpt-4o-2024-05-13", } var stringToChatCompletion = map[string]ChatCompletion{ @@ -140,5 +140,5 @@ var stringToChatCompletion = map[string]ChatCompletion{ "gpt-4-0125-preview": GPT4Turbo0125Preview, "gpt-4-turbo-preview": GPT4TurboPreview, "gpt-4o": GPT4o, - "ggpt-4o-2024-05-13": GPT4o20240503, + "gpt-4o-2024-05-13": GPT4o20240503, } From 4a22380a41eb21f0817dea9a78a3ad3f81f77e05 Mon Sep 17 00:00:00 2001 From: Andy Day Date: Wed, 15 May 2024 11:41:15 -0700 Subject: [PATCH 3/4] bump dupl threshold --- .golangci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 6929e3b..9ed24f8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -139,10 +139,9 @@ 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: From a3bb1c3ac666513a47dd8b004514780cfcc07920 Mon Sep 17 00:00:00 2001 From: Andy Day Date: Wed, 15 May 2024 11:44:04 -0700 Subject: [PATCH 4/4] remove inactive linters --- .golangci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 9ed24f8..d6c9ea9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -148,16 +148,16 @@ 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