定期清理用户聊天会话上下文 ChatContext

This commit is contained in:
RockYang
2023-03-28 18:13:17 +08:00
parent 4e575d01db
commit cb2b01127b
6 changed files with 60 additions and 21 deletions

View File

@@ -48,6 +48,12 @@ type ChatSession struct {
Username string `json:"user"` // 当前登录的 user
}
// ChatContext 聊天上下文
type ChatContext struct {
Messages []Message
LastAccessTime int64 // 最后一次访问上下文时间
}
func GetDefaultChatRole() map[string]ChatRole {
return map[string]ChatRole{
"gpt": {