Skip to content

AgentPrismA2ABuilderExtensions

Namespace AgentPrism · Assembly AgentPrism.AspNetCore.dll

Extensions that register the services needed to publish AgentPrism agents over A2A.

public static class AgentPrismA2ABuilderExtensions

objectAgentPrismA2ABuilderExtensions

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

UseA2A(IAgentPrismBuilder, Action<AgentPrismA2AOptions>?)

Section titled “ UseA2A(IAgentPrismBuilder, Action<AgentPrismA2AOptions>?)”

Registers an A2A server for each agent in AgentPrismA2AOptions.ExposedAgents. The HTTP endpoint must still be connected separately with app.MapAgentPrismA2A(...).

public static IAgentPrismBuilder UseA2A(this IAgentPrismBuilder builder, Action<AgentPrismA2AOptions>? configure = null)

builder IAgentPrismBuilder

The AgentPrism configuration chain.

configure Action<AgentPrismA2AOptions>?

Options mutator.

IAgentPrismBuilder

The chain, for further configuration.

ExposedAgents is read and FROZEN HERE, at registration time. AddA2AServer requires an agent INSTANCE; because AgentPrism’s catalog can change at runtime (MAF’s own registry is not used), a lazily-resolved AgentPrism.ExternalAgentProxy is registered for each name — the real agent is resolved from the catalog on every call, but which names exist in A2A is frozen at registration time.

By default no agent is exposed.

builder.AddAgentPrism()
.UseA2A(o => o.ExposedAgents.Add("support"));

ArgumentNullException

builder is null.