Skip to content
Tracon

GoogleProviderExtensions

Namespace Tracon · Assembly Tracon.Google.dll

Extensions that add the Google Gemini provider to the Tracon 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(ITraconBuilder, string, Action<GoogleProviderOptions>?)

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

Adds the Google provider by giving an API key.

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

builder ITraconBuilder

Tracon chain.

apiKey string

Gemini Developer API key.

configure Action<GoogleProviderOptions>?

Additional settings changer.

ITraconBuilder

The chain, for further configuration.

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

ArgumentNullException

builder is null.

ArgumentException

apiKey is empty.

UseGoogle(ITraconBuilder, IConfiguration)

Section titled “ UseGoogle(ITraconBuilder, IConfiguration)”

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

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

builder ITraconBuilder

Tracon chain.

configurationSection IConfiguration

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

ITraconBuilder

The chain, for further configuration.

ArgumentNullException

One of the parameters is null.

UseGoogle(ITraconBuilder, Action<GoogleProviderOptions>)

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

Adds the Google provider by giving settings in code.

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

builder ITraconBuilder

Tracon chain.

configure Action<GoogleProviderOptions>

Settings changer.

ITraconBuilder

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.