Skip to content

Commit a552516

Browse files
committed
fix: add retry_options to Quick Start to handle transient 503 errors
1 parent d611f11 commit a552516

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,15 @@ The release cadence is roughly bi-weekly.
5858

5959
```python
6060
from google.adk import Agent
61+
from google.adk.models import Gemini
62+
from google.genai import types
6163

6264
root_agent = Agent(
6365
name="greeting_agent",
64-
model="gemini-2.5-flash",
66+
model=Gemini(
67+
model="gemini-2.5-flash",
68+
retry_options=types.HttpRetryOptions(initial_delay=1, attempts=3),
69+
),
6570
instruction="You are a helpful assistant. Greet the user warmly.",
6671
)
6772
```

contributing/samples/core/quickstart/agent.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# limitations under the License.
1414

1515
from google.adk.agents.llm_agent import Agent
16+
from google.adk.models import Gemini
17+
from google.genai import types
1618

1719

1820
def get_weather(city: str) -> dict:
@@ -80,6 +82,10 @@ def get_current_time(city: str) -> dict:
8082

8183
root_agent = Agent(
8284
name="weather_time_agent",
85+
model=Gemini(
86+
model="gemini-2.5-flash",
87+
retry_options=types.HttpRetryOptions(initial_delay=1, attempts=3),
88+
),
8389
description=(
8490
"Agent to answer questions about the time and weather in a city."
8591
),

0 commit comments

Comments
 (0)