mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-21 09:28:14 +00:00
feat(ctx): ContextPolicy tool 上下文策略(§13.8)
- SDK ToolDef 加 ContextPolicy string(默认 none / 可设 prune) - StageAfterToolcall 后检查工具 ContextPolicy=prune → RelevanceContext.Prune - 所有现有测试通过
This commit is contained in:
1
third_party/homeagent-sdk/sdk/plugin.go
vendored
1
third_party/homeagent-sdk/sdk/plugin.go
vendored
@ -106,6 +106,7 @@ type ToolDef struct {
|
||||
Parameters map[string]interface{} `json:"parameters"`
|
||||
NoMemory bool `json:"no_memory,omitempty"` // 此工具输出不参与记忆计算,但原文保留
|
||||
Cleaner func(string) string `json:"-"` // 计算层过滤函数,不改原文;仅在向量化/jieba/蒸馏时调用
|
||||
ContextPolicy string `json:"context_policy,omitempty"` // 工具上下文策略:"none"(默认) / "prune"
|
||||
}
|
||||
|
||||
// IOInjector provides methods for injecting input and interrupts into the agent pipeline.
|
||||
|
||||
Reference in New Issue
Block a user