3.1 KiB
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 %}
ChatSessionBase class
Base class for various ChatSession classes that enables sending chat messages and stores history of sent and received messages so far.
Signature:
export declare abstract class ChatSessionBase<ParamsType extends StartChatParams | StartTemplateChatParams, RequestType, FunctionDeclarationsToolType extends FunctionDeclarationsTool | TemplateFunctionDeclarationsTool>
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(apiSettings, params, requestOptions) | Constructs a new instance of the ChatSessionBase class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| _apiSettings | ApiSettings | ||
| _history | Content[] | ||
| params | ParamsType | undefined | ||
| requestOptions | RequestOptions | undefined |
Methods
| 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. |
ChatSessionBase.(constructor)
Constructs a new instance of the ChatSessionBase class
Signature:
constructor(apiSettings: ApiSettings, params?: ParamsType | undefined, requestOptions?: RequestOptions | undefined);
Parameters
| Parameter | Type | Description |
|---|---|---|
| apiSettings | ApiSettings | |
| params | ParamsType | undefined | |
| requestOptions | RequestOptions | undefined |
ChatSessionBase._apiSettings
Signature:
protected _apiSettings: ApiSettings;
ChatSessionBase._history
Signature:
protected _history: Content[];
ChatSessionBase.params
Signature:
params?: ParamsType | undefined;
ChatSessionBase.requestOptions
Signature:
requestOptions?: RequestOptions | undefined;
ChatSessionBase.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.
Signature:
getHistory(): Promise<Content[]>;
Returns:
Promise<Content[]>