Skip to content

feat: Enable HTTP retries for the Gemini LLM Client #1614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ classifiers = [ # List of https://pypi.org/classifiers/
]
dependencies = [
# go/keep-sorted start
"PyYAML>=6.0.2", # For APIHubToolset.
"anyio>=4.9.0;python_version>='3.10'", # For MCP Session Manager
"authlib>=1.5.1", # For RestAPI Tool
"click>=8.1.8", # For CLI tools
Expand All @@ -34,7 +35,7 @@ dependencies = [
"google-cloud-secret-manager>=2.22.0", # Fetching secrets in RestAPI Tool
"google-cloud-speech>=2.30.0", # For Audio Transcription
"google-cloud-storage>=2.18.0, <3.0.0", # For GCS Artifact service
"google-genai>=1.17.0", # Google GenAI SDK
"google-genai>=1.21.1", # Google GenAI SDK
"graphviz>=0.20.2", # Graphviz for graph rendering
"mcp>=1.8.0;python_version>='3.10'", # For MCP Toolset
"opentelemetry-api>=1.31.0", # OpenTelemetry
Expand All @@ -43,7 +44,6 @@ dependencies = [
"pydantic>=2.0, <3.0.0", # For data validation/models
"python-dateutil>=2.9.0.post0", # For Vertext AI Session Service
"python-dotenv>=1.0.0", # To manage environment variables
"PyYAML>=6.0.2", # For APIHubToolset.
"requests>=2.32.4",
"sqlalchemy>=2.0", # SQL database ORM
"starlette>=0.46.2", # For FastAPI CLI
Expand All @@ -70,9 +70,9 @@ dev = [
# go/keep-sorted start
"flit>=3.10.0",
"isort>=6.0.0",
"mypy>=1.15.0",
"pyink>=24.10.0",
"pylint>=2.6.0",
"mypy>=1.15.0",
# go/keep-sorted end
]

Expand All @@ -98,7 +98,6 @@ test = [
"langgraph>=0.2.60", # For LangGraphAgent
"litellm>=1.71.2", # For LiteLLM tests
"llama-index-readers-file>=0.4.0", # For retrieval tests

"pytest-asyncio>=0.25.0",
"pytest-mock>=3.14.0",
"pytest-xdist>=3.6.1",
Expand Down
5 changes: 4 additions & 1 deletion src/google/adk/models/google_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ def api_client(self) -> Client:
The api client.
"""
return Client(
http_options=types.HttpOptions(headers=self._tracking_headers)
http_options=types.HttpOptions(
headers=self._tracking_headers,
retry_options=types.HttpRetryOptions(),
), # Enable retries.
)

@cached_property
Expand Down