Streamline toolbox usage and update dependencies
Enhanced the toolbox in `search.go` to require tools explicitly with `WithRequireTool(true)`, improving execution control. Updated multiple library dependencies in `go.mod` and `go.sum` to ensure compatibility, stability, and to leverage the latest features. Added logging for `CallAndExecute` results to aid in debugging.
This commit is contained in:
@@ -161,7 +161,7 @@ func (a Agent) SearchAndUseTools(ctx context.Context, searchQuery string, questi
|
||||
|
||||
Use appropriate tools to analyze the search results and determine if they answer the question.`).
|
||||
WithSystemPromptSuffix(``).
|
||||
WithToolbox(gollm.NewToolBox(converted...))
|
||||
WithToolbox(gollm.NewToolBox(converted...).WithRequireTool(true))
|
||||
|
||||
var searches = make([]string, len(searchResults))
|
||||
for i, r := range searchResults {
|
||||
@@ -179,6 +179,7 @@ Use appropriate tools to analyze the search results and determine if they answer
|
||||
results, err = a.CallAndExecute(ctx, messages...)
|
||||
}
|
||||
|
||||
slog.Info("search results called and executed", "error", err, "results text", results.Text, "results", results.CallResults)
|
||||
if err != nil {
|
||||
return knowledge, fmt.Errorf("error executing search function: %w", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user