mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-14 18:17:29 +08:00
fix loop
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user