refactor: stabilize runtime and unify config

This commit is contained in:
lpf
2026-03-14 21:40:12 +08:00
parent 60eee65fec
commit 341e578c9f
75 changed files with 3081 additions and 1627 deletions

View File

@@ -77,16 +77,13 @@ type searchResult struct {
}
func (t *MemorySearchTool) Execute(ctx context.Context, args map[string]interface{}) (string, error) {
query, ok := args["query"].(string)
if !ok || query == "" {
query := MapStringArg(args, "query")
if query == "" {
return "", fmt.Errorf("query is required")
}
namespace := parseMemoryNamespaceArg(args)
maxResults := 5
if m, ok := args["maxResults"].(float64); ok {
maxResults = int(m)
}
maxResults := MapIntArg(args, "maxResults", 5)
if maxResults <= 0 {
maxResults = 5
}