feat: add model field for chat_item and and chat_history data table

This commit is contained in:
RockYang
2024-01-26 16:54:00 +08:00
parent 1bcd0f4c1a
commit 023a2c2f09
11 changed files with 33 additions and 2 deletions

View File

@@ -160,6 +160,7 @@ func (h *ChatHandler) sendBaiduMessage(
Content: template.HTMLEscapeString(prompt),
Tokens: promptToken,
UseContext: true,
Model: req.Model,
}
historyUserMsg.CreatedAt = promptCreatedAt
historyUserMsg.UpdatedAt = promptCreatedAt
@@ -181,6 +182,7 @@ func (h *ChatHandler) sendBaiduMessage(
Content: message.Content,
Tokens: totalTokens,
UseContext: true,
Model: req.Model,
}
historyReplyMsg.CreatedAt = replyCreatedAt
historyReplyMsg.UpdatedAt = replyCreatedAt
@@ -205,6 +207,7 @@ func (h *ChatHandler) sendBaiduMessage(
} else {
chatItem.Title = prompt
}
chatItem.Model = req.Model
h.db.Create(&chatItem)
}
}