Skip to content
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
1 change: 0 additions & 1 deletion contributing/samples/gepa/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
from tau_bench.types import EnvRunResult
from tau_bench.types import RunConfig
import tau_bench_agent as tau_bench_agent_lib

import utils


Expand Down
1 change: 0 additions & 1 deletion contributing/samples/gepa/run_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from absl import flags
import experiment
from google.genai import types

import utils

_OUTPUT_DIR = flags.DEFINE_string(
Expand Down
21 changes: 19 additions & 2 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,10 +248,15 @@ 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,
)
),
)

@cached_property
Expand Down Expand Up @@ -278,9 +290,14 @@ 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
)
),
)

@contextlib.asynccontextmanager
Expand Down