OpenAIConversationsSession
Implements
Section titled “Implements”Session
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new OpenAIConversationsSession(options): OpenAIConversationsSession;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”OpenAIConversationsSession
Accessors
Section titled “Accessors”sessionId
Section titled “sessionId”Get Signature
Section titled “Get Signature”get sessionId(): string | undefined;Returns
Section titled “Returns”string | undefined
Methods
Section titled “Methods”addItems()
Section titled “addItems()”addItems(items): Promise<void>;Append new items to the conversation history.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
| Items to add to the session history. |
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”Session.addItemsclearSession()
Section titled “clearSession()”clearSession(): Promise<void>;Remove all items that belong to the session and reset its state.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”Session.clearSessiongetItems()
Section titled “getItems()”getItems(limit?): Promise<AgentInputItem[]>;Retrieve items from the conversation history.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
| The maximum number of items to return. When provided the most recent limit items should be returned in chronological order. |
Returns
Section titled “Returns”Promise<AgentInputItem[]>
Implementation of
Section titled “Implementation of”Session.getItemsgetSessionId()
Section titled “getSessionId()”getSessionId(): Promise<string>;Ensure and return the identifier for this session.
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”Session.getSessionIdpopItem()
Section titled “popItem()”popItem(): Promise<AgentInputItem | undefined>;Remove and return the most recent item from the conversation history if it exists.
Returns
Section titled “Returns”Promise<AgentInputItem | undefined>
Implementation of
Section titled “Implementation of”Session.popItem