feat: update according to openai doc

This commit is contained in:
Yiyang Kang 2025-02-02 15:28:16 +09:00
parent 2ff8372439
commit 4ab359053a
4 changed files with 30 additions and 18 deletions

View file

@ -193,8 +193,8 @@ func handleAssistantConversation(c tele.Context, thread []*tele.Message) error {
logger.Warnw("failed to cache message", "error", err)
}
nBytes := 0 // Used to estimated number of tokens. For now we treat 3 bytes as 1 token.
nBytesMax := (4096 - 512) * 3 // Leave some space for the response
nBytes := 0 // Used to estimated number of tokens. For now we treat 3 bytes as 1 token.
nBytesMax := 16384 * 3 // Leave some space for the response
sysMsg := prompts.Assistant()
chatReqMsgs := []openai.ChatMessage{
@ -237,7 +237,6 @@ func handleAssistantConversation(c tele.Context, thread []*tele.Message) error {
Model: openai.ModelGpt4O,
Messages: chatReqMsgs,
Temperature: lo.ToPtr(0.42),
MaxTokens: 2048,
User: assistantHashUserId(lastMsg.Sender.ID),
}