refactor: 重构目录结构,后端代码统一到 backend/ 目录
This commit is contained in:
50
backend/internal/model/chat.go
Normal file
50
backend/internal/model/chat.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user