Replies: 1 comment
-
Closing this discussion as it's being discussed at #279 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Title: ADK
LlmAgent
Usesgemini-1.5-flash
Despite Explicitgemini-2.5-pro
ConfigurationDescription:
I am encountering an issue where the ADK framework appears to be overriding the explicitly configured Gemini model ID for an
LlmAgent
. I am trying to usegemini-2.5-pro-exp-03-25
(orgemini-2.5-pro-preview-03-25
) for an audio transcription and diarization task, but logs consistently show thatgemini-1.5-flash
is being used instead. This prevents the agent from performing tasks like speaker diarization effectively, which require the capabilities of the Pro model.Configuration:
Agent Initialization (
src/transcription_agent/agent.py
):The agent is configured using
google.adk.models.google_llm.Gemini
with the desired Pro model ID:The agent creation log confirms this:
INFO - agent.py:68 - Transcription Agent created successfully using model: gemini-2.5-pro-exp-03-25
Tool Implementation (
src/transcription_agent/tools.py
):The custom tool (
transcribe_diarize_audio
) also internally initializes a client usingvertexai.generative_models.GenerativeModel
targeting the Pro model:Expected Behavior:
All API calls made by the ADK framework in the context of this agent (including internal reasoning steps, function calling decisions, and the execution of the tool's own API call) should use the configured
gemini-2.5-pro-exp-03-25
model.Actual Behavior:
Logs consistently show that
gemini-1.5-flash
is being used:INFO - google_llm.py:83 - Sending out request, model: gemini-1.5-flash, backend: vertex, stream: False
generateContent
call targeting Flash:INFO - _client.py:1740 - HTTP Request: POST .../models/gemini-1.5-flash:generateContent "HTTP/1.1 200 OK"
Impact:
Using
gemini-1.5-flash
leads to failed or incomplete speaker diarization for the audio processing task, defeating the purpose of configuring the agent to use the more capable Pro model.Steps to Reproduce (Conceptual):
LlmAgent
and explicitly pass aGemini
model instance configured withmodel_id="gemini-2.5-pro-exp-03-25"
(or another Pro model).GenerateContent
using the same (or another) Pro model via the standard Vertex AI SDK (vertexai.generative_models.GenerativeModel
).google_llm.py
andgoogle.cloud.aiplatform_v1.services.prediction_service.client
(or similar) to see which model is actually being targeted by the API requests.Environment:
Question:
Is this behavior expected? Is there a known issue or a specific way the ADK framework overrides model configurations provided via
google.adk.models.google_llm.Gemini
? How can we ensure that the explicitly configured Pro model is consistently used for all agent-related API calls, including the tool's execution when invoked by the agent?Thank you for any insights or guidance.
Beta Was this translation helpful? Give feedback.
All reactions