Context prompt format fix.

This commit is contained in:
Alexey Skobkin 2024-11-04 02:10:01 +03:00
parent c3ee85bf35
commit b4b0f7baba
Signed by: skobkin
GPG key ID: 4389E670595BF8A8
2 changed files with 2 additions and 2 deletions

View file

@ -36,7 +36,7 @@ func (l *LlmConnector) HandleChatMessage(userMessage ChatMessage, model string,
historyLength := len(requestContext.Chat.History) historyLength := len(requestContext.Chat.History)
if historyLength > 0 { if historyLength > 0 {
systemPrompt += "\nYou have access to last " + strconv.Itoa(historyLength) + "messages in this chat." systemPrompt += "\nYou have access to last " + strconv.Itoa(historyLength) + " messages in this chat."
} }
req := openai.ChatCompletionRequest{ req := openai.ChatCompletionRequest{

View file

@ -56,7 +56,7 @@ func (c RequestContext) Prompt() string {
prompt += "Chat description is \"" + c.Chat.Description + "\". " prompt += "Chat description is \"" + c.Chat.Description + "\". "
} }
prompt += "\nProfile of the user who mentioned you in the chat:" + prompt += "\nProfile of the user who mentioned you in the chat:\n" +
"First name: \"" + c.User.FirstName + "\"\n" "First name: \"" + c.User.FirstName + "\"\n"
if c.User.Username != "" { if c.User.Username != "" {
prompt += "Username: @" + c.User.Username + ".\n" prompt += "Username: @" + c.User.Username + ".\n"