rename Token to User, the chat history function is ready

This commit is contained in:
RockYang
2023-03-28 16:03:41 +08:00
parent 95f9dfa9cb
commit ebc2041e8a
10 changed files with 261 additions and 141 deletions

View File

@@ -14,6 +14,14 @@ type Message struct {
Content string `json:"content"`
}
// HistoryMessage 历史聊天消息
type HistoryMessage struct {
Type string `json:"type"`
Id string `json:"id"`
Icon string `json:"icon"`
Content string `json:"content"`
}
type ApiResponse struct {
Choices []ChoiceItem `json:"choices"`
}
@@ -37,7 +45,7 @@ type ChatRole struct {
type ChatSession struct {
SessionId string `json:"session_id"`
ClientIP string `json:"client_ip"` // 客户端 IP
Token string `json:"token"` // 当前登录的 token
Username string `json:"user"` // 当前登录的 user
}
func GetDefaultChatRole() map[string]ChatRole {