Skip to content

IAgentCatalog

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

The catalog that joins every agent source into a single view. The user interface and the HTTP layer reach agents only through this interface.

public interface IAgentCatalog

Lists the agents from every source. On a name clash the source with the higher priority wins, and the lower-priority one is not added to the list.

ValueTask<IReadOnlyList<AgentDescriptor>> ListAsync(CancellationToken cancellationToken = default)

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyList<AgentDescriptor>>

Agent summaries ordered by name.

ResolveAsync(string, string?, CancellationToken)

Section titled “ ResolveAsync(string, string?, CancellationToken)”

Resolves the agent with the given name. The returned agent is wrapped by the run recording decorator; every run is written into IRunStore.

ValueTask<AIAgent?> ResolveAsync(string agentName, string? culture, CancellationToken cancellationToken)

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.

ValueTask<AIAgent?>

The agent, or null when no source holds it.

ResolveAsync(string, int?, string?, CancellationToken)

Section titled “ ResolveAsync(string, int?, string?, CancellationToken)”

Resolves an agent by name and by a specific definition version. Code agents (AgentDefinitionOrigin.Code) have no version history; AgentPrismException is thrown when version is given for a code agent.

ValueTask<AIAgent?> ResolveAsync(string agentName, int? version, string? culture = null, CancellationToken cancellationToken = default)

agentName string

The agent name.

version int?

The requested definition version. When null it behaves like IAgentCatalog.ResolveAsync (the current version).

culture string?

See IAgentCatalog.ResolveAsync.

cancellationToken CancellationToken

The cancellation token.

ValueTask<AIAgent?>

The agent, or null when it is not found.

AgentPrismException

version is given and the agent comes from code, or that version does not exist.