IConversationStore Interface

Stores the conversations of IAIChatService so that they survive page reloads, circuits and processes. Register an implementation with ServiceLifetime); InMemoryConversationStore is used when none is registered. Use ConversationSessionSerializer to turn a session into JSON and back when the store keeps it as text.

Namespace: Radzen

Assembly: Radzen.Blazor.dll

Syntax

public interface IConversationStore

Methods

DeleteAsyncLink to this section

Deletes a conversation.

Declaration
public abstract Task DeleteAsync(string sessionId, Threading.CancellationToken cancellationToken)
Parameters
Type Name Description
string sessionId The session ID.
Threading.CancellationToken cancellationToken A cancellation token.
Returns
Type Description
Task

ListAsyncLink to this section

Lists the conversations, most recently updated first.

Declaration
public abstract Task<IReadOnlyList<ConversationSession>> ListAsync(string userId, Threading.CancellationToken cancellationToken)
Parameters
Type Name Description
string userId When specified only the conversations of that user are returned.
Threading.CancellationToken cancellationToken A cancellation token.
Returns
Type Description
Task<IReadOnlyList<ConversationSession>>

LoadAsyncLink to this section

Loads a conversation. Returns null when it does not exist.

Declaration
public abstract Task<ConversationSession> LoadAsync(string sessionId, Threading.CancellationToken cancellationToken)
Parameters
Type Name Description
string sessionId The session ID.
Threading.CancellationToken cancellationToken A cancellation token.
Returns
Type Description
Task<ConversationSession>

SaveAsyncLink to this section

Saves a conversation, creating or replacing it.

Declaration
public abstract Task SaveAsync(ConversationSession session, Threading.CancellationToken cancellationToken)
Parameters
Type Name Description
ConversationSession session The session.
Threading.CancellationToken cancellationToken A cancellation token.
Returns
Type Description
Task
In This Article
An error has occurred. This app may no longer respond until reloaded. Reload 🗙