LiveGenerativeModel class

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Class for Live generative model APIs. The Live API enables low-latency, two-way multimodal interactions with Gemini.

This class should only be instantiated withgetLiveGenerativeModel().

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend theLiveGenerativeModel class.

Signature:

exportdeclareclassLiveGenerativeModelextendsAIModel

Extends:AIModel

Properties

PropertyModifiersTypeDescription
generationConfigLiveGenerationConfig(Public Preview)
systemInstructionContent(Public Preview)
toolConfigToolConfig(Public Preview)
toolsTool[](Public Preview)

Methods

MethodModifiersDescription
connect()(Public Preview) Starts aLiveSession.

LiveGenerativeModel.generationConfig

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

generationConfig:LiveGenerationConfig;

LiveGenerativeModel.systemInstruction

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

systemInstruction?:Content;

LiveGenerativeModel.toolConfig

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

toolConfig?:ToolConfig;

LiveGenerativeModel.tools

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

tools?:Tool[];

LiveGenerativeModel.connect()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Starts aLiveSession.

Signature:

connect():Promise<LiveSession>;

Returns:

Promise<LiveSession>

ALiveSession.

Exceptions

If the connection failed to be established with the server.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-28 UTC.