Skip to content

before_model_callback does not appear to run with Gemini Live / BIDI streaming in google-adk 2.3.0 #6259

Description

@rafiatha09

Iam using google-adk==2.3.0 with a FastAPI WebSocket BIDI streaming app and a Gemini Live native-audio model. I configured before_model_callback on an Agent, but the callback does not appear to run when using runner.run_live(...).

The app starts successfully and prints the installed ADK version:
Google ADK version: 2.3.0

def check_before_model_callback(context, llm_request):
    print("before_model_callback called", flush=True)
    return None

agent = Agent(
    name="inventory_specialist_agent",
    model="gemini-live-2.5-flash-native-audio",
    before_model_callback=check_before_model_callback,
    tools=[...],
    instruction="...",
)

async for event in runner.run_live(
    user_id=user_id,
    session_id=session_id,
    live_request_queue=live_request_queue,
    run_config=run_config,
):

before_model_callback should be invoked before the model request is sent, and the log should "before_model_callback called". However, The callback does not appear to run during runner.run_live(...) / Gemini Live BIDI streaming. No callback log is printed.

Does before_model_callback support runner.run_live(...) / Gemini Live BIDI streaming in ADK 2.3.0? If not, what is the recommended callback or interception point for Live API requests?

Metadata

Metadata

Assignees

Labels

live[Component] This issue is related to live, voice and video chat

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions