Skip to content
Tracon

TextToSpeechClientBinding

Namespace Tracon · Assembly Tracon.Core.dll

Binds a Microsoft.Extensions.AI text-to-speech client in the container to a named Tracon speech synthesizer.

public sealed record TextToSpeechClientBinding : IEquatable<TextToSpeechClientBinding>
Inheritance
object ← TextToSpeechClientBinding
Implements
IEquatable<TextToSpeechClientBinding>
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Pass it to TraconBuilderExtensions.AddSpeechSynthesizer. The client itself stays in the container: register it with the extension of its own package, or with AddTextToSpeechClient / AddKeyedTextToSpeechClient.

The record declares what the client cannot say about itself. Microsoft.Extensions.AI reports no character limit, no voice list and, for many clients, no provider name, and Tracon needs all three: the limit guards speak and POST /api/voice/speak, the list feeds GET /api/voice/voices, and the name is what a tenant’s egress policy and provider bindings name.

public TextToSpeechClientBinding()

Gets the most characters one synthesis call accepts. Must be greater than zero.

public required int MaxCharactersPerRequest { get; init; }

int

Read by the speak tool and by POST /api/voice/speak, which refuse longer text before the provider is called.

Gets the provider name, or null to read it from the client’s metadata.

public string? ProviderName { get; init; }

string?

A tenant’s egress policy and provider bindings name this value, so it must be the process’s own word for the service, not the client’s. A client with neither this name nor metadata stops the host at startup: a provider with no name could not be checked against any policy.

Gets the service key the client is registered under, or null for the unkeyed registration.

public object? ServiceKey { get; init; }

object?

Gets the voices GET /api/voice/voices lists for this synthesizer. Empty by default.

public IReadOnlyList<VoiceDescriptor> Voices { get; init; }

IReadOnlyList<VoiceDescriptor>

A static declaration: the client has no way to list its voices. A call that names no voice leaves the choice to the client.

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(TextToSpeechClientBinding? other)

other TextToSpeechClientBinding?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(TextToSpeechClientBinding?, TextToSpeechClientBinding?)

Section titled “ operator ==(TextToSpeechClientBinding?, TextToSpeechClientBinding?)”
public static bool operator ==(TextToSpeechClientBinding? left, TextToSpeechClientBinding? right)

left TextToSpeechClientBinding?

right TextToSpeechClientBinding?

bool

operator !=(TextToSpeechClientBinding?, TextToSpeechClientBinding?)

Section titled “ operator !=(TextToSpeechClientBinding?, TextToSpeechClientBinding?)”
public static bool operator !=(TextToSpeechClientBinding? left, TextToSpeechClientBinding? right)

left TextToSpeechClientBinding?

right TextToSpeechClientBinding?

bool