Search Results for

    Show / Hide Table of Contents

    Class OpenAISpeechGenerationRequest

    Generates audio from the input text.

    Inheritance
    object
    OpenAIRequest
    OpenAISpeechGenerationRequest
    Implements
    IJsonRequest
    IValidatable
    Inherited Members
    OpenAIRequest.Model
    OpenAIRequest.N
    OpenAIRequest.Metadata
    OpenAIRequest.User
    OpenAIRequest.SafetyIdentifier
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.OpenAI
    Assembly: Glitch9.AIDevKit.Provider.OpenAI.dll
    Syntax
    public class OpenAISpeechGenerationRequest : OpenAIRequest, IJsonRequest, IValidatable

    Properties

    | Edit this page View Source

    Prompt

    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
    | Edit this page View Source

    ResponseFormat

    The format of the response.

    Declaration
    [JsonProperty("response_format")]
    public AudioEncoding? ResponseFormat { get; set; }
    Property Value
    Type Description
    AudioEncoding?
    | Edit this page View Source

    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.

    | Edit this page View Source

    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?
    | Edit this page View Source

    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 Source

    IsValid()

    Declaration
    public bool IsValid()
    Returns
    Type Description
    bool
    | Edit this page View Source

    Validate()

    Validates the object's parameters and throws if invalid.

    Declaration
    public void Validate()

    Implements

    IJsonRequest
    IValidatable

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation