feat: v2.3.0 流式输出 + 日志系统 + 会议室架构全面升级
- 流式输出: SSE 逐 token 接收, \\n\n\ 段落缓冲后 mdprint 彩色渲染 - 日志系统: charmbracelet/log v2 双写(stderr + log.yml), yunshu log 命令 - 会议室架构: dialog(main) + weather/profile/note(sub) 多 Agent 编排 - 泛型工具注册: NewTool[T] 反射推导 JSON Schema, 类型安全 - 安全加固: safeMemoryPath 三段校验(EvalSymlinks+Rel), maxToolCalls=2 - 性能优化: sync.Once 延迟加载, note 一步完成, obs/summary 合并 - Prompt 适配: 流式输出原则(先调工具不说话), 单 Agent 查询跳过 obs+summary - 文档: AGENTS.md + architecture.md + changelog.md 全部同步至 v2.3.0
This commit is contained in:
26
types.go
26
types.go
@@ -27,28 +27,26 @@ type ToolCallFunction struct {
|
||||
Arguments string `json:"arguments"`
|
||||
}
|
||||
|
||||
type CacheDef struct {
|
||||
TTL int `yaml:"ttl"`
|
||||
Keys []string `yaml:"keys"`
|
||||
}
|
||||
|
||||
type AgentDef struct {
|
||||
Name string `yaml:"name"`
|
||||
Description string `yaml:"description"`
|
||||
Tools []string `yaml:"tools"`
|
||||
Name string `yaml:"name"`
|
||||
Description string `yaml:"description"`
|
||||
Type string `yaml:"type"`
|
||||
Cache *CacheDef `yaml:"cache,omitempty"`
|
||||
Tools []string `yaml:"tools"`
|
||||
SystemPrompt string
|
||||
}
|
||||
|
||||
type ToolParameter struct {
|
||||
Type string `json:"type"`
|
||||
Properties map[string]ToolProperty `json:"properties"`
|
||||
Required []string `json:"required"`
|
||||
}
|
||||
|
||||
type ToolProperty struct {
|
||||
Type string `json:"type"`
|
||||
Description string `json:"description"`
|
||||
}
|
||||
type Schema map[string]any
|
||||
|
||||
type ToolDef struct {
|
||||
Name string
|
||||
Description string
|
||||
Parameters ToolParameter
|
||||
Parameters Schema
|
||||
Execute func(args map[string]interface{}) (string, error)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user