HostedAgentBuilderExtensions.WithSessionStore Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| WithSessionStore(IHostedAgentBuilder, AgentSessionStore) |
Registers the specified agent session store with the host agent builder, enabling session-specific storage for agent operations. |
| WithSessionStore(IHostedAgentBuilder, Func<IServiceProvider,String,AgentSessionStore>) |
Configures the host agent builder to use a custom session store implementation for agent sessions. |
WithSessionStore(IHostedAgentBuilder, AgentSessionStore)
Registers the specified agent session store with the host agent builder, enabling session-specific storage for agent operations.
public static Microsoft.Agents.AI.Hosting.IHostedAgentBuilder WithSessionStore(this Microsoft.Agents.AI.Hosting.IHostedAgentBuilder builder, Microsoft.Agents.AI.Hosting.AgentSessionStore store);
static member WithSessionStore : Microsoft.Agents.AI.Hosting.IHostedAgentBuilder * Microsoft.Agents.AI.Hosting.AgentSessionStore -> Microsoft.Agents.AI.Hosting.IHostedAgentBuilder
<Extension()>
Public Function WithSessionStore (builder As IHostedAgentBuilder, store As AgentSessionStore) As IHostedAgentBuilder
Parameters
- builder
- IHostedAgentBuilder
The host agent builder to configure with the session store. Cannot be null.
- store
- AgentSessionStore
The agent session store instance to register. Cannot be null.
Returns
The same host agent builder instance, allowing for method chaining.
Applies to
WithSessionStore(IHostedAgentBuilder, Func<IServiceProvider,String,AgentSessionStore>)
Configures the host agent builder to use a custom session store implementation for agent sessions.
public static Microsoft.Agents.AI.Hosting.IHostedAgentBuilder WithSessionStore(this Microsoft.Agents.AI.Hosting.IHostedAgentBuilder builder, Func<IServiceProvider,string,Microsoft.Agents.AI.Hosting.AgentSessionStore> createAgentSessionStore);
static member WithSessionStore : Microsoft.Agents.AI.Hosting.IHostedAgentBuilder * Func<IServiceProvider, string, Microsoft.Agents.AI.Hosting.AgentSessionStore> -> Microsoft.Agents.AI.Hosting.IHostedAgentBuilder
<Extension()>
Public Function WithSessionStore (builder As IHostedAgentBuilder, createAgentSessionStore As Func(Of IServiceProvider, String, AgentSessionStore)) As IHostedAgentBuilder
Parameters
- builder
- IHostedAgentBuilder
The host agent builder to configure.
- createAgentSessionStore
- Func<IServiceProvider,String,AgentSessionStore>
A factory function that creates an agent session store instance using the provided service provider and agent name.
Returns
The same host agent builder instance, enabling further configuration.