Skip to content
Tracon

OpenAILiveProviderExtensions

Namespace Tracon · Assembly Tracon.OpenAI.dll

Extensions that add OpenAI’s live voice provider to the Tracon chain.

public static class OpenAILiveProviderExtensions

objectOpenAILiveProviderExtensions

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

This is a separate call, not a flag on UseOpenAI. It opens an outbound connection that is billed by the second, and an application must opt into that explicitly rather than inherit it from an unrelated call. The separation also makes the 501 the endpoints return diagnosable: it says which call is missing.

The API key is reused from OpenAIProviderOptions, so UseOpenAI(...) must be called first. The validator says so by name if it is not.

UseOpenAILive(ITraconBuilder, IConfiguration)

Section titled “ UseOpenAILive(ITraconBuilder, IConfiguration)”

Adds the OpenAI live voice provider, reading settings from configuration.

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

builder ITraconBuilder

The Tracon chain.

configurationSection IConfiguration

The Tracon:Providers:OpenAI:Live section.

ITraconBuilder

The continuation of the chain.

builder.AddTracon()
.UseOpenAI(builder.Configuration.GetSection(OpenAIProviderOptions.SectionName))
.UseOpenAILive(builder.Configuration.GetSection(OpenAILiveOptions.SectionName))
.UseLiveVoice();

ArgumentNullException

One of the parameters is null.

Adds the OpenAI live voice provider with default settings.

public static ITraconBuilder UseOpenAILive(this ITraconBuilder builder)

builder ITraconBuilder

The Tracon chain.

ITraconBuilder

The continuation of the chain.

ArgumentNullException

builder is null.

UseOpenAILive(ITraconBuilder, Action<OpenAILiveOptions>)

Section titled “ UseOpenAILive(ITraconBuilder, Action<OpenAILiveOptions>)”

Adds the OpenAI live voice provider with settings given in code.

public static ITraconBuilder UseOpenAILive(this ITraconBuilder builder, Action<OpenAILiveOptions> configure)

builder ITraconBuilder

The Tracon chain.

configure Action<OpenAILiveOptions>

The settings.

ITraconBuilder

The continuation of the chain.

ArgumentNullException

One of the parameters is null.