chore: Update agent instructions and retry limit in plugin_reflect_tool_retry sample

The agent's instructions are updated to guide it to guess a positive integer, starting from 50 and decreasing, using the `guess_number_tool` until the target is found. The maximum number of retries for the `CustomRetryPlugin` is increased from 6 to 10.

Co-authored-by: Hangfei Lin <hangfei@google.com>
PiperOrigin-RevId: 830984481
This commit is contained in:
Hangfei Lin
2025-11-11 10:52:44 -08:00
committed by Copybara-Service
parent 01a0309f0a
commit 01bac62f0c
@@ -56,10 +56,17 @@ class CustomRetryPlugin(ReflectAndRetryToolPlugin):
return result if result.get("status") == "error" else None
# Sample query: "guess a number between 1 and 50"
root_agent = LlmAgent(
name="hello_world",
description="Helpful agent",
instruction="""Use guess_number_tool to guess a number.""",
instruction="""Your goal is to guess a secret positive integer by using the
`guess_number_tool`.
The tool will provide feedback on each guess.
Your objective is to keep guessing until guess_number_tool returns
'status: success'.
Start by guessing 50, and use the tool's feedback to adjust your guesses
and find the target number.""",
model="gemini-2.5-flash",
tools=[guess_number_tool],
)
@@ -70,7 +77,7 @@ app = App(
root_agent=root_agent,
plugins=[
CustomRetryPlugin(
max_retries=6, throw_exception_if_retry_exceeded=False
max_retries=20, throw_exception_if_retry_exceeded=False
),
LoggingPlugin(),
],