From 1d768799df633b5ae309d4da757df95fd537832f Mon Sep 17 00:00:00 2001 From: Yiyang Kang Date: Sat, 11 Jan 2025 00:47:15 +0900 Subject: [PATCH] feat: update models and prompts --- assistant.go | 2 +- botcmd_kanji.go | 2 +- botcmd_translate.go | 2 +- openai/models.go | 10 +++------- openai/prompts/prompts.go | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/assistant.go b/assistant.go index 6cf227c..33e7bd0 100644 --- a/assistant.go +++ b/assistant.go @@ -234,7 +234,7 @@ func handleAssistantConversation(c tele.Context, thread []*tele.Message) error { } req := openai.ChatRequest{ - Model: openai.ModelGpt04Turbo, + Model: openai.ModelGpt4O, Messages: chatReqMsgs, Temperature: lo.ToPtr(0.42), MaxTokens: 2048, diff --git a/botcmd_kanji.go b/botcmd_kanji.go index 10e15cf..db10714 100644 --- a/botcmd_kanji.go +++ b/botcmd_kanji.go @@ -28,7 +28,7 @@ func handleKanjiCmd(c tele.Context) error { } req := openai.ChatRequest{ - Model: openai.ModelGpt0305Turbo, + Model: openai.ModelGpt4O, Messages: []openai.ChatMessage{ { Role: openai.ChatRoleSystem, diff --git a/botcmd_translate.go b/botcmd_translate.go index 715b867..4ddcd64 100644 --- a/botcmd_translate.go +++ b/botcmd_translate.go @@ -72,7 +72,7 @@ func handleTranslateBtn(c tele.Context) error { } req := openai.ChatRequest{ - Model: openai.ModelGpt0305Turbo, + Model: openai.ModelGpt4O, Messages: []openai.ChatMessage{ { Role: openai.ChatRoleSystem, diff --git a/openai/models.go b/openai/models.go index 83a35d0..7398247 100644 --- a/openai/models.go +++ b/openai/models.go @@ -1,11 +1,7 @@ package openai const ( - ModelTextDavinciEdit001 = "text-davinci-edit-001" // legacy model - ModelGpt0305Turbo = "gpt-3.5-turbo" // legacy model - ModelGpt0305Turbo_0125 = "gpt-3.5-turbo-0125" // legacy model - ModelGpt04 = "gpt-4" // legacy model - ModelGpt04_0613 = "gpt-4-0613" // legacy model - ModelGpt04Turbo = "gpt-4-turbo" - ModelGpt04Turbo_240409 = "gpt-4-turbo-2024-04-09" + ModelGpt4O = "gpt-4o" // Safe default + ModelO1Preview = "o1-preview" // Expensive + ModelO1Mini = "o1-mini" ) diff --git a/openai/prompts/prompts.go b/openai/prompts/prompts.go index e55d8e4..07cb801 100644 --- a/openai/prompts/prompts.go +++ b/openai/prompts/prompts.go @@ -13,7 +13,7 @@ func Assistant() string { "", "Due to technical limitations, older messages may not be available to Misaka.", "", - "We are currently in the year 2024.", + "We are currently in the year 2025.", }, "\n") }