Skip to content

GoogleProviderExtensions

Namespace AgentPrism · Assembly AgentPrism.Google.dll

Extensions that add the Google Gemini provider to the AgentPrism chain.

public static class GoogleProviderExtensions

objectGoogleProviderExtensions

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

UseGoogle(IAgentPrismBuilder, string, Action<GoogleProviderOptions>?)

Section titled “ UseGoogle(IAgentPrismBuilder, string, Action<GoogleProviderOptions>?)”

Adds the Google provider by giving an API key.

public static IAgentPrismBuilder UseGoogle(this IAgentPrismBuilder builder, string apiKey, Action<GoogleProviderOptions>? configure = null)

builder IAgentPrismBuilder

AgentPrism chain.

apiKey string

Gemini Developer API key.

configure Action<GoogleProviderOptions>?

Additional settings changer.

IAgentPrismBuilder

The chain, for further configuration.

builder.AddAgentPrism()
.UseGoogle(builder.Configuration["Google:ApiKey"]!);

ArgumentNullException

builder is null.

ArgumentException

apiKey is empty.

UseGoogle(IAgentPrismBuilder, IConfiguration)

Section titled “ UseGoogle(IAgentPrismBuilder, IConfiguration)”

Adds the Google provider, reading settings from the AgentPrism:Providers:Google section.

public static IAgentPrismBuilder UseGoogle(this IAgentPrismBuilder builder, IConfiguration configurationSection)

builder IAgentPrismBuilder

AgentPrism chain.

configurationSection IConfiguration

Section to read settings from. Typically configuration.GetSection(GoogleProviderOptions.SectionName).

IAgentPrismBuilder

The chain, for further configuration.

ArgumentNullException

One of the parameters is null.

UseGoogle(IAgentPrismBuilder, Action<GoogleProviderOptions>)

Section titled “ UseGoogle(IAgentPrismBuilder, Action<GoogleProviderOptions>)”

Adds the Google provider by giving settings in code.

public static IAgentPrismBuilder UseGoogle(this IAgentPrismBuilder builder, Action<GoogleProviderOptions> configure)

builder IAgentPrismBuilder

AgentPrism chain.

configure Action<GoogleProviderOptions>

Settings changer.

IAgentPrismBuilder

The chain, for further configuration.

This call registers a single provider: GoogleProviderNames.Google.

Registration uses AddModelProvider(...); no existing service is replaced. When called more than once, settings are merged; the provider is registered only once.

ArgumentNullException

One of the parameters is null.