Class OpenAISpeechGenerationRequest
Generates audio from the input text.
Inherited Members
Namespace: Glitch9.AIDevKit.OpenAI
Assembly: Glitch9.AIDevKit.Provider.OpenAI.dll
Syntax
public class OpenAISpeechGenerationRequest : OpenAIRequest, IJsonRequest, IValidatable
Properties
| Edit this page View SourcePrompt
Required. The input text to generate audio for. The maximum length is 4096 characters.
Declaration
[JsonProperty("input")]
public string Prompt { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ResponseFormat
The format of the response.
Declaration
[JsonProperty("response_format")]
public AudioEncoding? ResponseFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| AudioEncoding? |
Speed
The speed of the generated audio. Select a value from 0.25 to 4.0.
Declaration
[JsonProperty("speed")]
public float? Speed { get; set; }
Property Value
| Type | Description |
|---|---|
| float? |
Remarks
1.0 is the default.
StreamFormat
Optional. Defaults to audio. Set this value to stream the audio response instead of returning it as a single response. The format to stream the audio in. Supported formats are sse and audio. sse is not supported for tts-1 or tts-1-hd.
Declaration
[JsonProperty("stream_format")]
public OpenAITypes.AudioStreamFormat? StreamFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| OpenAITypes.AudioStreamFormat? |
Voice
Required. The voice to use when generating the audio. Supported voices are alloy, echo, fable, onyx, nova, and shimmer. Previews of the voices are available in the Text to speech guide.
Declaration
[JsonProperty("voice")]
public string Voice { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceIsValid()
Declaration
public bool IsValid()
Returns
| Type | Description |
|---|---|
| bool |
Validate()
Validates the object's parameters and throws if invalid.
Declaration
public void Validate()