Skip to main content

State Management Function

You can use the following functions to manage conversation state in your application.

Get Conversation State

Gets the conversation state for a given conversation ID.

Set Conversation State

Sets the conversation state for a given conversation ID. If the conversation state already exists, it will be overwritten.

Update Conversation State

Updates the conversation state for a given conversation ID. If the conversation state does not exist, it will throw an error.

Create Conversation State

Creates a new conversation state for a given conversation ID. If the conversation state already exists, it will throw an error.

Usage

Here’s an example of a conversational assistant that remember’s the user’s previous messages: