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
- Add
historyConfig to the relevant Typescript interfaces (e.g., LiveConnectConfig) if it isn't fully defined yet.
- 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
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_contentinsidehistory_config. This maps to theBidiGenerateContentSetupmessage (API Docs) which takes ahistoryConfigobject.However, when passing this configuration to the SDK, it is ignored because the
liveConnectConfigToMldevfunction defined insrc/converters/_live_converters.tsdoes not parse or map thehistoryConfigfield to the underlying ML Dev payload.Describe the solution you'd like
historyConfigto the relevant Typescript interfaces (e.g.,LiveConnectConfig) if it isn't fully defined yet.liveConnectConfigToMldevfunction insrc/converters/_live_converters.tsto properly extracthistoryConfigfrom 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
BidiGenerateContentSetuppayload manually, which defeats the purpose of usingjs-genai.Additional context
src/converters/_live_converters.tssend_client_contenthistory seeding pattern required for the 3.1 Flash Live model.