Skip to content

Commit 86f0155

Browse files
Jacksunweicopybara-github
authored andcommitted
docs: Fixes null check for reflect_retry plugin sample
PiperOrigin-RevId: 824836190
1 parent 6c3882f commit 86f0155

File tree

1 file changed

+2
-0
lines changed
  • contributing/samples/plugin_reflect_tool_retry/hallucinating_func_name

1 file changed

+2
-0
lines changed

contributing/samples/plugin_reflect_tool_retry/hallucinating_func_name/agent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def after_model_callback(
5555

5656
if (
5757
llm_response.content
58+
and llm_response.content.parts
59+
and llm_response.content.parts[0].function_call
5860
and llm_response.content.parts[0].function_call.name == "roll_die"
5961
):
6062
llm_response.content.parts[0].function_call.name = "roll_die_wrong_name"

0 commit comments

Comments
 (0)