Language

ProviderSessionState<TState>.SaveState(AgentSession, TState) Method

Definition

Saves the specified state to the session's StateBag using the configured state key and JSON serializer options. If the session is null, this method does nothing.

public void SaveState(Microsoft.Agents.AI.AgentSession? session, TState state);
member this.SaveState : Microsoft.Agents.AI.AgentSession * 'State -> unit
Public Sub SaveState (session As AgentSession, state As TState)

Parameters

session
AgentSession

The agent session containing the StateBag.

state
TState

The state to be saved.

Applies to