Skip to content

Commit 70f1fa1

Browse files
committed
review comments incorporated #4086
1 parent e6a2b07 commit 70f1fa1

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

contributing/samples/agent_tool_resilience/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,3 @@ The sample includes:
3333
- `research_agent_primary` - Primary agent with timeout protection (5s)
3434
- `research_agent_fallback` - Fallback agent with longer timeout (60s)
3535
- `error_recovery_agent` - Analyzes failures and provides recommendations
36-
37-
For detailed documentation, see `README_EXTENSIVE.md`.

contributing/samples/agent_tool_resilience/agent.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
from google.adk.tools import AgentTool
3232
from google.adk.tools.google_search_tool import google_search
3333
from google.adk.tools.tool_context import ToolContext
34+
import time
35+
from google.genai import types
36+
from google.adk.events.event import Event
3437

3538

3639
# ============================================================================
@@ -96,9 +99,6 @@ async def run_async_with_events(
9699
Note: Timeout for async generators requires careful handling.
97100
This implementation uses a task-based approach with timeout monitoring.
98101
"""
99-
import time
100-
from google.genai import types
101-
from google.adk.events.event import Event
102102

103103
start_time = time.time()
104104
agen = super().run_async_with_events(
@@ -278,16 +278,16 @@ async def run_async_with_events(
278278
# For production, use a longer timeout (e.g., 30.0 seconds)
279279
TimeoutAgentTool(
280280
agent=research_agent_primary,
281-
timeout=5.0, # Change to 5.0 for timeout testing
282-
timeout_error_message="Primary research agent timed out after 30 seconds",
281+
timeout=10.0, # Change to 5.0 for timeout testing
282+
timeout_error_message="Primary research agent timed out after 10 seconds",
283283
skip_summarization=True,
284284
),
285285
# Fallback agent timeout
286286
# For testing: Set to 5.0 to test full failure chain (primary → fallback → error recovery)
287287
# For production: Set to 60.0 to allow fallback to succeed after primary timeout
288288
TimeoutAgentTool(
289289
agent=research_agent_fallback,
290-
timeout=5.0, # Set to 60.0 to test successful fallback after primary timeout
290+
timeout=60.0, # Set to 60.0 to test successful fallback after primary timeout
291291
timeout_error_message="Fallback research agent timed out",
292292
skip_summarization=True,
293293
),

0 commit comments

Comments
 (0)