Files
GoLoom/backend/internal/model/chat.go
hhs 8c515a8b3e
All checks were successful
GoLoom CI / Lint (push) Successful in 3m7s
GoLoom CI / Test (push) Successful in 5s
GoLoom CI / Build (push) Successful in 24s
refactor: 重构目录结构,后端代码统一到 backend/ 目录
2026-06-10 15:35:32 +08:00

51 lines
878 B
Go

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
}