refactor(model): 拆分 types.go 为 chat.go、types.go、store.go 三个文件

This commit is contained in:
hhs
2026-06-10 13:41:18 +08:00
parent 53488f792d
commit 62813cbe2e
3 changed files with 113 additions and 120 deletions

50
internal/model/chat.go Normal file
View File

@@ -0,0 +1,50 @@
package model
// ChatRole 消息角色
type ChatRole string
const (
ChatRoleSystem ChatRole = "system"
ChatRoleUser ChatRole = "user"
ChatRoleAssistant ChatRole = "assistant"
ChatRoleTool ChatRole = "tool"
)
// ChatMessage 聊天消息
type ChatMessage struct {
Role ChatRole
Content string
ToolCallID string
Name string
ToolCalls []ChatToolCall
}
// ChatToolCall 工具调用请求
type ChatToolCall struct {
ID string
Name string
Arguments string
}
// ChatReply 聊天回复
type ChatReply struct {
Content string
ToolCalls []ChatToolCall
}
// ChatStreamEvent 流式事件
type ChatStreamEvent struct {
Delta string
ToolCalls []ChatToolCall
Done bool
}
// ChatContent 聊天输入内容
type ChatContent struct {
Texts []TextPart
}
// TextPart 文本片段
type TextPart struct {
Message string
}