コンテンツにスキップ

Session

このコンテンツはまだ日本語訳がありません。

Interface representing a persistent session store for conversation history.

addItems(items): Promise<void>;

Append new items to the conversation history.

Parameter Type Description

items

AgentInputItem[]

Items to add to the session history.

Promise<void>


clearSession(): Promise<void>;

Remove all items that belong to the session and reset its state.

Promise<void>


getItems(limit?): Promise<AgentInputItem[]>;

Retrieve items from the conversation history.

Parameter Type Description

limit?

number

The maximum number of items to return. When provided the most recent limit items should be returned in chronological order.

Promise<AgentInputItem[]>


getSessionId(): Promise<string>;

Ensure and return the identifier for this session.

Promise<string>


popItem(): Promise<
| AgentInputItem
| undefined>;

Remove and return the most recent item from the conversation history if it exists.

Promise< | AgentInputItem | undefined>