AnthropicProviderExtensions
AgentPrism.Anthropic.dllExtensions that add the Anthropic (Claude) provider to the AgentPrism chain.
public static class AnthropicProviderExtensionsInheritance
Section titled “Inheritance”object ← AnthropicProviderExtensions
Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Methods
Section titled “Methods”UseAnthropic(IAgentPrismBuilder, string, Action<AnthropicProviderOptions>?)
Section titled “ UseAnthropic(IAgentPrismBuilder, string, Action<AnthropicProviderOptions>?)”Adds the Anthropic provider using an API key.
public static IAgentPrismBuilder UseAnthropic(this IAgentPrismBuilder builder, string apiKey, Action<AnthropicProviderOptions>? configure = null)Parameters
Section titled “Parameters”builder IAgentPrismBuilder
The AgentPrism chain.
apiKey string
Anthropic API key.
configure Action<AnthropicProviderOptions>?
Additional settings modifier.
Returns
Section titled “Returns”The continuation of the chain.
Remarks
Section titled “Remarks”builder.AddAgentPrism() .UseAnthropic(builder.Configuration["Anthropic:ApiKey"]!);Exceptions
Section titled “Exceptions”builder is null.
apiKey is empty.
UseAnthropic(IAgentPrismBuilder, IConfiguration)
Section titled “ UseAnthropic(IAgentPrismBuilder, IConfiguration)”Adds the Anthropic provider, reading settings from the
AgentPrism:Providers:Anthropic section.
public static IAgentPrismBuilder UseAnthropic(this IAgentPrismBuilder builder, IConfiguration configurationSection)Parameters
Section titled “Parameters”builder IAgentPrismBuilder
The AgentPrism chain.
configurationSection IConfiguration
The section settings are read from. Typically
configuration.GetSection(AnthropicProviderOptions.SectionName).
Returns
Section titled “Returns”The continuation of the chain.
Exceptions
Section titled “Exceptions”One of the parameters is null.
UseAnthropic(IAgentPrismBuilder, Action<AnthropicProviderOptions>)
Section titled “ UseAnthropic(IAgentPrismBuilder, Action<AnthropicProviderOptions>)”Adds the Anthropic provider using settings given in code.
public static IAgentPrismBuilder UseAnthropic(this IAgentPrismBuilder builder, Action<AnthropicProviderOptions> configure)Parameters
Section titled “Parameters”builder IAgentPrismBuilder
The AgentPrism chain.
configure Action<AnthropicProviderOptions>
Settings modifier.
Returns
Section titled “Returns”The continuation of the chain.
Remarks
Section titled “Remarks”This call registers a single provider: AnthropicProviderNames.Anthropic.
Registration uses AddModelProvider(...); no existing service is
replaced. Calling this more than once merges the
settings; the provider is registered only once.
Exceptions
Section titled “Exceptions”One of the parameters is null.