adk-go icon indicating copy to clipboard operation
adk-go copied to clipboard

Ensure LLM can parse tool error.

Open dpasiukevich opened this issue 1 month ago • 1 comments

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.

dpasiukevich avatar Nov 13 '25 16:11 dpasiukevich

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.

dpasiukevich avatar Nov 13 '25 18:11 dpasiukevich