This commit is contained in:
lpf
2026-02-19 15:23:25 +08:00
parent a7b5da5251
commit 75e678061a
11 changed files with 3613 additions and 221 deletions

View File

@@ -9,6 +9,20 @@ type Tool interface {
Execute(ctx context.Context, args map[string]interface{}) (string, error)
}
// ParallelSafeTool is an optional capability interface.
// If implemented by a tool, AgentLoop should trust this declaration
// over name-based whitelist when deciding parallel execution safety.
type ParallelSafeTool interface {
ParallelSafe() bool
}
// ResourceScopedTool is an optional capability interface.
// If implemented by a tool, AgentLoop can avoid running calls that touch
// the same resource keys in parallel.
type ResourceScopedTool interface {
ResourceKeys(args map[string]interface{}) []string
}
func ToolToSchema(tool Tool) map[string]interface{} {
return map[string]interface{}{
"type": "function",