Back to Firebase Js Sdk

LiveGenerativeModel class

docs-devsite/ai.livegenerativemodel.md

12.12.13.6 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

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 with getLiveGenerativeModel()<!-- -->.

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

<b>Signature:</b>

typescript
export declare class LiveGenerativeModel extends AIModel 

<b>Extends:</b> AIModel

Properties

PropertyModifiersTypeDescription
generationConfigLiveGenerationConfig<b><i>(Public Preview)</i></b>
systemInstructionContent<b><i>(Public Preview)</i></b>
toolConfigToolConfig<b><i>(Public Preview)</i></b>
toolsTool<!-- -->[]<b><i>(Public Preview)</i></b>

Methods

MethodModifiersDescription
connect()<b><i>(Public Preview)</i></b> Starts a LiveSession<!-- -->.

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.

<b>Signature:</b>

typescript
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.

<b>Signature:</b>

typescript
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.

<b>Signature:</b>

typescript
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.

<b>Signature:</b>

typescript
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 a LiveSession<!-- -->.

<b>Signature:</b>

typescript
connect(): Promise<LiveSession>;

<b>Returns:</b>

Promise<LiveSession<!-- -->>

A LiveSession<!-- -->.

Exceptions

If the connection failed to be established with the server.