From cea4ce4244f901fdcd7635cfa98eaba93098227a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20D=C3=B6tsch?= Date: Mon, 10 Jun 2024 10:21:38 +0200 Subject: [PATCH] openai: use gpt-4o by default faster, better and cheaper than gpt-4-turbo --- command/export/export.go | 1 + command/openai/config.go | 2 +- command/openai/tokens.go | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/command/export/export.go b/command/export/export.go index 50e51c1f..ddfc93bb 100644 --- a/command/export/export.go +++ b/command/export/export.go @@ -15,6 +15,7 @@ import ( "github.com/slack-go/slack" ) +// limit the number of exported messages (incl thread messages) const limit = 3000 // NewExportCommand is a constructor to create a new export command diff --git a/command/openai/config.go b/command/openai/config.go index b32c0504..3210e911 100644 --- a/command/openai/config.go +++ b/command/openai/config.go @@ -41,7 +41,7 @@ func (c *Config) IsEnabled() bool { var defaultConfig = Config{ APIHost: apiHost, - Model: "gpt-3.5-turbo", // aka model behind ChatGPT + Model: "gpt-4o", // aka model behind ChatGPT UpdateInterval: time.Second * 1, HistorySize: 25, InitialSystemMessage: "You are a helpful Slack bot. By default, keep your answer short and truthful", diff --git a/command/openai/tokens.go b/command/openai/tokens.go index e25f6a35..359ba9c3 100644 --- a/command/openai/tokens.go +++ b/command/openai/tokens.go @@ -7,13 +7,13 @@ import ( // https://platform.openai.com/docs/models/gpt-3-5 // https://platform.openai.com/docs/models/gpt-4 var maxTokens = map[string]int{ - "gpt-4": 8192, - "gpt-4-32k": 32768, - "gpt-4-1106-preview": 128000, - "gpt-4-vision-preview": 128000, - "gpt-3.5-turbo-16k": 16385, - "gpt-3.5-turbo": 4096, - "dummy-test": 100, // just for testing + "gpt-4": 8192, + "gpt-4-32k": 32768, + "gpt-4-1106-preview": 128000, + "gpt-4-turbo": 128000, + "gpt-4o": 128000, + "gpt-3.5-turbo": 16385, + "dummy-test": 100, // just for testing } var modelDateRe = regexp.MustCompile(`-\d{4}`)