adk-go
adk-go copied to clipboard
Ensure LLM can parse tool error.
FunctionResponse has map[string]any type.
Currently if the tool returns an error, we pass map[string]any{"error": err}. Errors created with fmt.Errorf or errors.New are json marshalled to {}.
As a result LLM knows the tool returned an error, but it doesn't know anything about it.
We should pass err.Error() for that.
Also we need to make sure we have a clear documentation for a functiontool about what happens to error and when and what types of error should be in the result struct rather than error.