ConversationStorage
ref / conversations / ConversationStorage
A storage for versioned state.
Specify this to define how to persist data.
This type is a union of three types, each representing a different way to store data.
- A Versioned
State directly provides definitions for reading, writing, and deleting data based onStorage ctx
. No versions can be specified and the storage key function cannot be changed..chat Id - A Conversation
Key , disambiguated viaStorage { type:
, is more general. It supports versioning the data and changing the storage key function."key" } - A Conversation
Context , disambiguated viaStorage { type:
, is even more general. It no longer needs a storage key function. Instead, it provides read, write, and delete operations for data based on the context object directly. It also supports versioning data."context" }
Type Parameters
C
ts
C extends Context
S
ts
S
Type
ts
{ type?: never; version?: never } & VersionedStateStorage<string, S> | ConversationContextStorage<C, S> | ConversationKeyStorage<C, S>