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

@@ -206,6 +206,7 @@ func (h *ChatHandler) sendOpenAiMessage(
Content: template.HTMLEscapeString(prompt),
Tokens: promptToken,
UseContext: useContext,
Model: req.Model,
}
historyUserMsg.CreatedAt = promptCreatedAt
historyUserMsg.UpdatedAt = promptCreatedAt
@@ -235,6 +236,7 @@ func (h *ChatHandler) sendOpenAiMessage(
Content: message.Content,
Tokens: totalTokens,
UseContext: useContext,
Model: req.Model,
}
historyReplyMsg.CreatedAt = replyCreatedAt
historyReplyMsg.UpdatedAt = replyCreatedAt
@@ -260,6 +262,7 @@ func (h *ChatHandler) sendOpenAiMessage(
} else {
chatItem.Title = prompt
}
chatItem.Model = req.Model
h.db.Create(&chatItem)
}
}