Skip to content
Open
Changes from 1 commit
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
17 changes: 17 additions & 0 deletions src/google/adk/models/google_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from typing import TYPE_CHECKING
from typing import Union

import google.auth.credentials
from google.genai import types
from google.genai.errors import ClientError
from typing_extensions import override
Expand Down Expand Up @@ -87,6 +88,12 @@ class Gemini(BaseLlm):

model: str = 'gemini-2.5-flash'

vertexai: Optional[bool] = None
api_key: Optional[str] = None
credentials: Optional[google.auth.credentials.Credentials] = None
project: Optional[str] = None
location: Optional[str] = None
Comment on lines +91 to +95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The pull request description mentions adding a debug_config field, but it appears to be missing here. To align with the PR's goal, you should add it. This will also require passing self.debug_config to the Client constructor in api_client and _live_api_client.

Suggested change
vertexai: Optional[bool] = None
api_key: Optional[str] = None
credentials: Optional[google.auth.credentials.Credentials] = None
project: Optional[str] = None
location: Optional[str] = None
vertexai: Optional[bool] = None
api_key: Optional[str] = None
credentials: Optional[google.auth.credentials.Credentials] = None
project: Optional[str] = None
location: Optional[str] = None
debug_config: Optional[types.DebugConfig] = None

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perferred at the end not to add DebugConfig as it is for internal use and probably not worth it will edit commit message


speech_config: Optional[types.SpeechConfig] = None

retry_options: Optional[types.HttpRetryOptions] = None
Expand Down Expand Up @@ -241,6 +248,11 @@ def api_client(self) -> Client:
from google.genai import Client

return Client(
vertexai=self.vertexai,
api_key=self.api_key,
credentials=self.credentials,
project=self.project,
location=self.location,
http_options=types.HttpOptions(
headers=self._tracking_headers(),
retry_options=self.retry_options,
Expand Down Expand Up @@ -278,6 +290,11 @@ def _live_api_client(self) -> Client:
from google.genai import Client

return Client(
vertexai=self.vertexai,
api_key=self.api_key,
credentials=self.credentials,
project=self.project,
location=self.location,
http_options=types.HttpOptions(
headers=self._tracking_headers(), api_version=self._live_api_version
)
Expand Down