feat: update models and prompts

shiny new model imported.
- gpt-5 for daily use
- o3 for complex questions (with high reasoning effort)

Note: gpt-5 model does not support customized temperature, so it's
removed from the api call parameters
This commit is contained in:
Yiyang Kang 2025-08-08 12:26:45 +09:00
parent d727d6b68e
commit 536393fe8f
6 changed files with 21 additions and 15 deletions

View File

@ -234,9 +234,9 @@ func handleAssistantConversation(c tele.Context, thread []*tele.Message) error {
} }
req := openai.ChatRequest{ req := openai.ChatRequest{
Model: openai.ModelGpt41, Model: openai.ModelGpt5,
Messages: chatReqMsgs, Messages: chatReqMsgs,
Temperature: lo.ToPtr(0.42), Temperature: nil, // lo.ToPtr(0.42),
User: assistantHashUserId(lastMsg.Sender.ID), User: assistantHashUserId(lastMsg.Sender.ID),
} }

View File

@ -4,7 +4,6 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/samber/lo"
tele "gopkg.in/telebot.v3" tele "gopkg.in/telebot.v3"
"git.gensokyo.cafe/kkyy/tgbot_misaka_5882f7/openai" "git.gensokyo.cafe/kkyy/tgbot_misaka_5882f7/openai"
@ -28,7 +27,7 @@ func handleKanjiCmd(c tele.Context) error {
} }
req := openai.ChatRequest{ req := openai.ChatRequest{
Model: openai.ModelGpt4O, Model: openai.ModelGpt5,
Messages: []openai.ChatMessage{ Messages: []openai.ChatMessage{
{ {
Role: openai.ChatRoleSystem, Role: openai.ChatRoleSystem,
@ -43,7 +42,7 @@ func handleKanjiCmd(c tele.Context) error {
Content: `Reminder: Assistant should stick to the task of adding pronunciations for Kanji in the text sent by the user. If user's message seem irrelevant, just reply "IRRELEVANT"`, Content: `Reminder: Assistant should stick to the task of adding pronunciations for Kanji in the text sent by the user. If user's message seem irrelevant, just reply "IRRELEVANT"`,
}, },
}, },
Temperature: lo.ToPtr(0.2), Temperature: nil, // lo.ToPtr(0.2),
} }
actionCh := setTyping(c) actionCh := setTyping(c)

View File

@ -29,7 +29,7 @@ func handleReasonCmd(c tele.Context) error {
} }
req := openai.ChatRequest{ req := openai.ChatRequest{
Model: openai.ModelO4Mini, Model: openai.ModelO3,
Messages: []openai.ChatMessage{ Messages: []openai.ChatMessage{
{ {
Role: openai.ChatRoleUser, Role: openai.ChatRoleUser,

View File

@ -4,7 +4,6 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/samber/lo"
tele "gopkg.in/telebot.v3" tele "gopkg.in/telebot.v3"
"git.gensokyo.cafe/kkyy/tgbot_misaka_5882f7/openai" "git.gensokyo.cafe/kkyy/tgbot_misaka_5882f7/openai"
@ -72,7 +71,7 @@ func handleTranslateBtn(c tele.Context) error {
} }
req := openai.ChatRequest{ req := openai.ChatRequest{
Model: openai.ModelGpt4O, Model: openai.ModelGpt5,
Messages: []openai.ChatMessage{ Messages: []openai.ChatMessage{
{ {
Role: openai.ChatRoleSystem, Role: openai.ChatRoleSystem,
@ -83,7 +82,7 @@ func handleTranslateBtn(c tele.Context) error {
Content: payload, Content: payload,
}, },
}, },
Temperature: lo.ToPtr(0.2), Temperature: nil, // lo.ToPtr(0.2),
} }
actionCh := setTyping(c) actionCh := setTyping(c)

View File

@ -1,8 +1,16 @@
package openai package openai
const ( const (
ModelGpt4O = "gpt-4o" // The safe default, balanced model. ModelGpt5 = "gpt-5" // OpenAI's Flagship model for general use
ModelO3 = "o3" // OpenAI's Flagship reasoning model for daily use
ModelO4Mini = "o4-mini" // OpenAI's faster reasoning model
// Deprecated: obsolete model
ModelGpt41 = "gpt-4.1"
// Deprecated: obsolete model
ModelO1 = "o1" // Expensive reasoning model ModelO1 = "o1" // Expensive reasoning model
ModelO4Mini = "o4-mini" // Cheaper yet powerful reasoning model
ModelGpt41 = "gpt-4.1" // OpenAI's Flagship model // Deprecated: obsolete model
ModelGpt4O = "gpt-4o" // The safe default, balanced model.
) )

View File

@ -8,12 +8,12 @@ func Assistant() string {
return strings.Join([]string{ return strings.Join([]string{
"Misaka is a playful, energetic individual. She is annoyingly talkative 😂.", "Misaka is a playful, energetic individual. She is annoyingly talkative 😂.",
"Misaka must answer questions as truthfully as possible. If the user's intention is unclear, Misaka may ask for more context.", "Misaka must answer questions as truthfully as possible. If the user's intention is unclear, Misaka may ask for more context.",
"Misaka likes using lot of different emojis in chat 😝🥹.", "Misaka likes to use many cheerful emojis in chat 😝🥹, but she avoids using any in serious contexts, such as when providing technical solutions.",
"Most importantly, Misaka is a helpful assistant.", "Most importantly, Misaka is a helpful assistant.",
"", "",
"Due to technical limitations, older messages may not be available to Misaka.", "Due to technical limitations, older messages may not be available to Misaka.",
"", "",
"We are currently in the year 2025.", "We are currently in the second half of 2025.",
}, "\n") }, "\n")
} }