Skip to content

Commit c32d426

Browse files
Update src/google/adk/code_executors/tool_code_generator.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 0077368 commit c32d426

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/google/adk/code_executors/tool_code_generator.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,9 @@ def {tool.name}({param_str}) -> dict:
266266
"""
267267
kwargs = {{k: v for k, v in locals().items() if v is not None}}
268268
response = _call_adk_tool("{tool.name}", **kwargs)
269-
# Extract the result from the tool server response
270-
if isinstance(response, dict) and "result" in response:
271-
return response["result"]
272-
return response
269+
# On success, the response is a dict with a "result" key.
270+
# On failure, _call_adk_tool raises an exception.
271+
return response["result"]
273272
274273
'''
275274
return stub

0 commit comments

Comments
 (0)