Skip to content

Feature Request: Support historyConfig in LiveConnectConfig for Gemini 3.1 Flash Live history seeding #1520

@fswebteam

Description

@fswebteam

Is your feature request related to a problem? Please describe.
Yes. I am trying to seed initial context history using the new Gemini 3.1 Flash Live preview, but the JS SDK currently drops the required configuration.

According to the Gemini 3.1 Flash Live Migration Guide, seeding initial history requires setting initial_history_in_client_content inside history_config. This maps to the BidiGenerateContentSetup message (API Docs) which takes a historyConfig object.

However, when passing this configuration to the SDK, it is ignored because the liveConnectConfigToMldev function defined in src/converters/_live_converters.ts does not parse or map the historyConfig field to the underlying ML Dev payload.

Describe the solution you'd like

  1. Add historyConfig to the relevant Typescript interfaces (e.g., LiveConnectConfig) if it isn't fully defined yet.
  2. Update the liveConnectConfigToMldev function in src/converters/_live_converters.ts to properly extract historyConfig from the user's config and map it into the setup message sent to the server.

Describe alternatives you've considered
The only alternative is bypassing the SDK entirely to make raw WebSocket/REST calls to the API so I can construct the BidiGenerateContentSetup payload manually, which defeats the purpose of using js-genai.

Additional context

Metadata

Metadata

Assignees

Labels

api:gemini-apipriority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions