Skip to content

IAgentSource

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

A source the catalog collects agents from. AgentPrism joins several sources into one catalog: the ones declared in code, the ones stored in the database and (from onwards) Microsoft Agent Framework hosting registrations.

public interface IAgentSource

This abstraction keeps AgentPrism.Core from depending on the prerelease Microsoft.Agents.AI.Hosting package. The bridge that shows MAF hosting registrations in the catalog implements this interface inside AgentPrism.AspNetCore.

Gets the name of the source, used for diagnostics and user interface badges.

string Name { get; }

string

Gets the resolution priority. A lower value is tried first. When two agents share a name, the source with priority wins.

int Priority { get; }

int

The values in use: 0 for the code source, 10 for the MAF hosting source, 100 for the database source.

Lists every agent in this source.

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

cancellationToken CancellationToken

The cancellation token.

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.

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

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 this source does not hold it.