DefinitionStoreAgentSource
AgentPrism.Core.dllA source that exposes definitions from IAgentDefinitionStore in the catalog. Agents created through the UI come from this source.
public sealed class DefinitionStoreAgentSource : IVersionedAgentSource, IAgentSourceInheritance
Section titled “Inheritance”object ← DefinitionStoreAgentSource
Implements
Section titled “Implements”IVersionedAgentSource, IAgentSource
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
Section titled “Constructors”DefinitionStoreAgentSource(IAgentDefinitionStore, AgentDefinitionCompiler, CompiledAgentCache, ITenantContext)
Section titled “ DefinitionStoreAgentSource(IAgentDefinitionStore, AgentDefinitionCompiler, CompiledAgentCache, ITenantContext)”Initializes a new database source.
public DefinitionStoreAgentSource(IAgentDefinitionStore store, AgentDefinitionCompiler compiler, CompiledAgentCache cache, ITenantContext tenantContext)Parameters
Section titled “Parameters”store IAgentDefinitionStore
The definition store.
compiler AgentDefinitionCompiler
The compiler that compiles definitions.
cache CompiledAgentCache
The compiled agent cache.
tenantContext ITenantContext
The tenant context. It is required to add the tenant to the cache key. See the tenant note in CompiledAgentCache.
Exceptions
Section titled “Exceptions”A dependency is null.
Properties
Section titled “Properties”Gets the name of the source, used for diagnostics and user interface badges.
public string Name { get; }Property Value
Section titled “Property Value”Priority
Section titled “ Priority”Gets the resolution priority. A lower value is tried first. When two agents share a name, the source with priority wins.
public int Priority { get; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”The values in use: 0 for the code source, 10 for the MAF hosting source, 100 for the database source.
Methods
Section titled “Methods”ListAsync(CancellationToken)
Section titled “ ListAsync(CancellationToken)”Lists every agent in this source.
public ValueTask<IReadOnlyList<AgentDescriptor>> ListAsync(CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<AgentDescriptor>>
The agent summaries.
ResolveAsync(string, string?, CancellationToken)
Section titled “ ResolveAsync(string, string?, CancellationToken)”Resolves the agent with the given name and makes it runnable.
public ValueTask<AIAgent?> ResolveAsync(string agentName, string? culture = null, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”agentName string
The agent name.
culture string?
The requested culture, resolved against the definition’s culture-keyed instructions
(see AgentDefinition.InstructionsByCulture). null uses the
definition’s default instructions.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<AIAgent?>
The agent, or null when this source does not hold it.
ResolveVersionAsync(string, int, string?, CancellationToken)
Section titled “ ResolveVersionAsync(string, int, string?, CancellationToken)”Resolves an agent by name and by a specific version.
public ValueTask<AIAgent?> ResolveVersionAsync(string agentName, int version, string? culture = null, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”agentName string
The agent name.
version int
The requested definition version.
culture string?
The requested culture, resolved against the definition’s culture-keyed instructions
(see AgentDefinition.InstructionsByCulture). null uses the
definition’s default instructions.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<AIAgent?>
The agent, or null when this source does not hold it or that version does not exist.