feat: 昔涟工具扩展 — OpenAI Function Calling 集成 (网络搜索/网页抓取/IoT设备查询)

This commit is contained in:
2026-05-16 23:12:39 +08:00
parent 7f2961e63e
commit 1f5c2508d6
9 changed files with 1081 additions and 26 deletions
+5 -4
View File
@@ -14,10 +14,11 @@ const (
// LLMMessage 发送给LLM的消息
type LLMMessage struct {
Role Role `json:"role"`
Content string `json:"content"`
Name string `json:"name,omitempty"` // 可选发送者名称
ToolCallID string `json:"tool_call_id,omitempty"` // 工具调用关联ID
Role Role `json:"role"`
Content string `json:"content"`
Name string `json:"name,omitempty"` // 可选发送者名称
ToolCallID string `json:"tool_call_id,omitempty"` // 工具调用关联ID (tool role 消息关联调用)
ToolCalls []ToolCall `json:"tool_calls,omitempty"` // 助手消息中的工具调用列表
}
// ChatMessage 数据库存储的对话消息