Compare commits

..

No commits in common. "7d9d08fbff0c9922a904bb333f8b06d39e992ecb" and "e6351725e3c9da692cd9a0b11a4acc35e4cd801a" have entirely different histories.

4 changed files with 10 additions and 11 deletions

View file

@ -144,7 +144,7 @@ func (b *Bot) processMention(message *telego.Message) {
requestContext := b.createLlmRequestContextFromMessage(message)
userMessageData := tgUserMessageToMessageData(message, true)
userMessageData := tgUserMessageToMessageData(message)
llmReply, err := b.llm.HandleChatMessage(
messageDataToLlmMessage(userMessageData),

View file

@ -56,7 +56,7 @@ func (b *Bot) saveChatMessageToHistory(message *telego.Message) {
b.history[chatId] = NewMessageHistory(HistoryLength)
}
msgData := tgUserMessageToMessageData(message, false)
msgData := tgUserMessageToMessageData(message)
b.history[chatId].Push(msgData)
}
@ -99,17 +99,16 @@ func (b *Bot) saveBotReplyToHistory(replyTo *telego.Message, text string) {
b.history[chatId].Push(msgData)
}
func tgUserMessageToMessageData(message *telego.Message, isUserRequest bool) MessageData {
func tgUserMessageToMessageData(message *telego.Message) MessageData {
msgData := MessageData{
Name: message.From.FirstName,
Username: message.From.Username,
Text: message.Text,
IsMe: false,
IsUserRequest: isUserRequest,
}
if message.ReplyToMessage != nil {
replyData := tgUserMessageToMessageData(message.ReplyToMessage, false)
replyData := tgUserMessageToMessageData(message.ReplyToMessage)
msgData.ReplyTo = &replyData
}

View file

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