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:
		
							parent
							
								
									d727d6b68e
								
							
						
					
					
						commit
						536393fe8f
					
				| 
						 | 
				
			
			@ -234,9 +234,9 @@ func handleAssistantConversation(c tele.Context, thread []*tele.Message) error {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	req := openai.ChatRequest{
 | 
			
		||||
		Model:       openai.ModelGpt41,
 | 
			
		||||
		Model:       openai.ModelGpt5,
 | 
			
		||||
		Messages:    chatReqMsgs,
 | 
			
		||||
		Temperature: lo.ToPtr(0.42),
 | 
			
		||||
		Temperature: nil, // lo.ToPtr(0.42),
 | 
			
		||||
		User:        assistantHashUserId(lastMsg.Sender.ID),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,6 @@ import (
 | 
			
		|||
	"regexp"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/samber/lo"
 | 
			
		||||
	tele "gopkg.in/telebot.v3"
 | 
			
		||||
 | 
			
		||||
	"git.gensokyo.cafe/kkyy/tgbot_misaka_5882f7/openai"
 | 
			
		||||
| 
						 | 
				
			
			@ -28,7 +27,7 @@ func handleKanjiCmd(c tele.Context) error {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	req := openai.ChatRequest{
 | 
			
		||||
		Model: openai.ModelGpt4O,
 | 
			
		||||
		Model: openai.ModelGpt5,
 | 
			
		||||
		Messages: []openai.ChatMessage{
 | 
			
		||||
			{
 | 
			
		||||
				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"`,
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		Temperature: lo.ToPtr(0.2),
 | 
			
		||||
		Temperature: nil, // lo.ToPtr(0.2),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	actionCh := setTyping(c)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@ func handleReasonCmd(c tele.Context) error {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	req := openai.ChatRequest{
 | 
			
		||||
		Model: openai.ModelO4Mini,
 | 
			
		||||
		Model: openai.ModelO3,
 | 
			
		||||
		Messages: []openai.ChatMessage{
 | 
			
		||||
			{
 | 
			
		||||
				Role:    openai.ChatRoleUser,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,6 @@ import (
 | 
			
		|||
	"regexp"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/samber/lo"
 | 
			
		||||
	tele "gopkg.in/telebot.v3"
 | 
			
		||||
 | 
			
		||||
	"git.gensokyo.cafe/kkyy/tgbot_misaka_5882f7/openai"
 | 
			
		||||
| 
						 | 
				
			
			@ -72,7 +71,7 @@ func handleTranslateBtn(c tele.Context) error {
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	req := openai.ChatRequest{
 | 
			
		||||
		Model: openai.ModelGpt4O,
 | 
			
		||||
		Model: openai.ModelGpt5,
 | 
			
		||||
		Messages: []openai.ChatMessage{
 | 
			
		||||
			{
 | 
			
		||||
				Role:    openai.ChatRoleSystem,
 | 
			
		||||
| 
						 | 
				
			
			@ -83,7 +82,7 @@ func handleTranslateBtn(c tele.Context) error {
 | 
			
		|||
				Content: payload,
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
		Temperature: lo.ToPtr(0.2),
 | 
			
		||||
		Temperature: nil, // lo.ToPtr(0.2),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	actionCh := setTyping(c)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +1,16 @@
 | 
			
		|||
package openai
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	ModelGpt4O  = "gpt-4o"  // The safe default, balanced model.
 | 
			
		||||
	ModelO1     = "o1"      // Expensive reasoning model
 | 
			
		||||
	ModelO4Mini = "o4-mini" // Cheaper yet powerful reasoning model
 | 
			
		||||
	ModelGpt41  = "gpt-4.1" // OpenAI's Flagship 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
 | 
			
		||||
 | 
			
		||||
	// Deprecated: obsolete model
 | 
			
		||||
	ModelGpt4O = "gpt-4o" // The safe default, balanced model.
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,12 +8,12 @@ func Assistant() string {
 | 
			
		|||
	return strings.Join([]string{
 | 
			
		||||
		"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 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.",
 | 
			
		||||
		"",
 | 
			
		||||
		"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")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue