Skip to content

Switch models from Gemini 3.1 Pro to gemini-2.5-flash-native-audio with same session context #2197

@kalikichandu

Description

@kalikichandu

Thanks for stopping by to ask us a question! Please make sure to include:

  • What you're trying to do
    • I'm building a chat bot which handles both text & audio input (separate endpoints) using Google ADK.
    • First user start a session with text and agents use Gemini 3.1 Pro model to generate answer.
    • Next user switches to Voice and then I'm trying to process it using gemini-2.5-flash-native-audio-preview-12-2025 with SessionResumptionConfig handle of text session_id.
    • Facing issue as - google.genai.errors.APIError: 1007 None. Invalid session handle.
    • I want to know how to handle switching between models but still leveraging the same session context. Please let me whether ADK supports this or any workaround on how to handle this.
  • What code you've already tried
    • If I pass Conversation history from old session manually it may work but how to map these new session_id and old session_id
  • Any error messages you're getting
    • if I pass handle of text session_id in SessionResumptionConfig then facing issue as - google.genai.errors.APIError: 1007 None. Invalid session handle.
    • If I just re-use the existing session without SessionResumptionConfig then facing - google.genai.errors.APIError: 1011 None. Internal error

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Metadata

Metadata

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions