docs-devsite/ai.chatsessionbase.md
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 %}
Base class for various ChatSession classes that enables sending chat messages and stores history of sent and received messages so far.
<b>Signature:</b>
export declare abstract class ChatSessionBase<ParamsType extends StartChatParams | StartTemplateChatParams, RequestType, FunctionDeclarationsToolType extends FunctionDeclarationsTool | TemplateFunctionDeclarationsTool>
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(apiSettings, params, requestOptions) | Constructs a new instance of the <code>ChatSessionBase</code> class |
| Property | Modifiers | Type | Description |
|---|---|---|---|
| _apiSettings | ApiSettings | ||
| _history | Content<!-- -->[] | ||
| params | ParamsType | undefined | ||
| requestOptions | RequestOptions | undefined |
| Method | Modifiers | Description |
|---|---|---|
| getHistory() | Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history. |
Constructs a new instance of the ChatSessionBase class
<b>Signature:</b>
constructor(apiSettings: ApiSettings, params?: ParamsType | undefined, requestOptions?: RequestOptions | undefined);
| Parameter | Type | Description |
|---|---|---|
| apiSettings | ApiSettings | |
| params | ParamsType | undefined | |
| requestOptions | RequestOptions | undefined |
<b>Signature:</b>
protected _apiSettings: ApiSettings;
<b>Signature:</b>
protected _history: Content[];
<b>Signature:</b>
params?: ParamsType | undefined;
<b>Signature:</b>
requestOptions?: RequestOptions | undefined;
Gets the chat history so far. Blocked prompts are not added to history. Neither blocked candidates nor the prompts that generated them are added to history.
<b>Signature:</b>
getHistory(): Promise<Content[]>;
<b>Returns:</b>
Promise<Content<!-- -->[]>