Class AgentRuntimeExtensions
Provides extension methods for managing and registering agents within an IAgentRuntime.
public static class AgentRuntimeExtensions
- Inheritance
-
AgentRuntimeExtensions
- Inherited Members
Methods
RegisterAgentTypeAsync(IAgentRuntime, AgentType, Type, IServiceProvider, params IEnumerable<object>)
public static ValueTask<AgentType> RegisterAgentTypeAsync(this IAgentRuntime runtime, AgentType type, Type runtimeType, IServiceProvider serviceProvider, params IEnumerable<object> additionalArguments)
Parameters
runtime
IAgentRuntimetype
AgentTyperuntimeType
TypeserviceProvider
IServiceProvideradditionalArguments
IEnumerable<object>
Returns
RegisterAgentTypeAsync<TAgent>(IAgentRuntime, AgentType, IServiceProvider, params IEnumerable<object>)
Registers an agent type with the runtime, providing a factory function to create instances of the agent.
public static ValueTask<AgentType> RegisterAgentTypeAsync<TAgent>(this IAgentRuntime runtime, AgentType type, IServiceProvider serviceProvider, params IEnumerable<object> additionalArguments) where TAgent : IHostableAgent
Parameters
runtime
IAgentRuntimeThe IAgentRuntime where the agent will be registered.
type
AgentTypeThe AgentType representing the type of agent.
serviceProvider
IServiceProviderThe service provider used for dependency injection.
additionalArguments
IEnumerable<object>Additional arguments to pass to the agent's constructor.
Returns
- ValueTask<AgentType>
A ValueTask<TResult> representing the asynchronous operation of registering the agent.
Type Parameters
TAgent
The type of agent being registered. Must implement IHostableAgent.
RegisterImplicitAgentSubscriptionsAsync(IAgentRuntime, AgentType, Type, bool, bool)
public static ValueTask RegisterImplicitAgentSubscriptionsAsync(this IAgentRuntime runtime, AgentType type, Type runtimeType, bool skipClassSubscriptions = false, bool skipDirectMessageSubscription = false)
Parameters
runtime
IAgentRuntimetype
AgentTyperuntimeType
TypeskipClassSubscriptions
boolskipDirectMessageSubscription
bool
Returns
RegisterImplicitAgentSubscriptionsAsync<TAgent>(IAgentRuntime, AgentType, bool, bool)
public static ValueTask RegisterImplicitAgentSubscriptionsAsync<TAgent>(this IAgentRuntime runtime, AgentType type, bool skipClassSubscriptions = false, bool skipDirectMessageSubscription = false) where TAgent : IHostableAgent
Parameters
runtime
IAgentRuntimetype
AgentTypeskipClassSubscriptions
boolskipDirectMessageSubscription
bool
Returns
Type Parameters
TAgent