diff --git a/contributing/samples/gepa/experiment.py b/contributing/samples/gepa/experiment.py index 2f5d03a772..f68b349d9c 100644 --- a/contributing/samples/gepa/experiment.py +++ b/contributing/samples/gepa/experiment.py @@ -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 diff --git a/contributing/samples/gepa/run_experiment.py b/contributing/samples/gepa/run_experiment.py index cfd850b3a3..1bc4ee58c8 100644 --- a/contributing/samples/gepa/run_experiment.py +++ b/contributing/samples/gepa/run_experiment.py @@ -25,7 +25,6 @@ from absl import flags import experiment from google.genai import types - import utils _OUTPUT_DIR = flags.DEFINE_string( diff --git a/src/google/adk/models/google_llm.py b/src/google/adk/models/google_llm.py index 6b21cf62c7..7dc413242f 100644 --- a/src/google/adk/models/google_llm.py +++ b/src/google/adk/models/google_llm.py @@ -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 @@ -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 + speech_config: Optional[types.SpeechConfig] = None retry_options: Optional[types.HttpRetryOptions] = None @@ -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 @@ -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