| 4 | from urllib.parse import urlparse |
| 5 | |
| 6 | class TestGoogleADK(unittest.TestCase): |
| 7 | |
| 8 | def define_agent(self): |
| 9 | from google.adk.agents import Agent |
| 10 | from google.adk.models.google_llm import Gemini |
| 11 | from google.adk.runners import InMemoryRunner |
| 12 | from google.adk.tools import google_search |
| 13 | from google.genai import types |
| 14 | |
| 15 | retry_config = types.HttpRetryOptions( |
| 16 | attempts=5, # Maximum retry attempts |
| 17 | exp_base=7, # Delay multiplier |
| 18 | initial_delay=1, # Initial delay before first retry (in seconds) |
| 19 | http_status_codes=[429, 500, 503, 504] # Retry on these HTTP errors |
| 20 | ) |
| 21 | |
| 22 | root_agent = Agent( |
| 23 | name="helpful_assistant", |
| 24 | model=Gemini( |
| 25 | model="gemini-2.0-flash-lite", |
| 26 | retry_options=retry_config |
| 27 | ), |
| 28 | description="A simple agent that can answer general questions.", |
| 29 | instruction="You are a helpful assistant. Use Google Search for current info or if unsure.", |
| 30 | tools=[google_search], |
| 31 | ) |
nothing calls this directly
no outgoing calls
no test coverage detected