Skip to content

SpeechRequest

Namespace AgentPrism · Assembly AgentPrism.Abstractions.dll

A text-to-speech generation request.

public sealed record SpeechRequest : IEquatable<SpeechRequest>

objectSpeechRequest

IEquatable<SpeechRequest>

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

public SpeechRequest()

Requests character-level timing alongside the audio. Default false.

public bool IncludeTimestamps { get; init; }

bool

Not supported together with ISpeechSynthesizer.SynthesizeStreamingAsync: that method returns raw audio chunks only and has no channel for alignment data. A synthesizer implementation MUST reject the combination explicitly rather than silently drop the alignment.

The language’s ISO 639-1 code. The provider detects it itself if empty.

public string? LanguageCode { get; init; }

string?

The synthesis model to use. VoiceOptions.SynthesisModelId if empty.

public string? ModelId { get; init; }

string?

The provider’s output format name (for example, mp3_44100_128).

public string? OutputFormat { get; init; }

string?

This is not a MIME type. Also, not every format can be stored as an attachment: pcm_* and ulaw_* outputs are headerless, match no magic byte, and are rejected by AttachmentTypeGuard.

The text to speak.

public required string Text { get; init; }

string

The identifier of the voice to use. VoiceOptions.DefaultVoiceId if empty.

public string? VoiceId { get; init; }

string?

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(SpeechRequest? other)

other SpeechRequest?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(SpeechRequest?, SpeechRequest?)

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

left SpeechRequest?

right SpeechRequest?

bool

operator !=(SpeechRequest?, SpeechRequest?)

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

left SpeechRequest?

right SpeechRequest?

bool