Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 4.38 KB

File metadata and controls

59 lines (40 loc) · 4.38 KB

Audio.Speech

Overview

Available Operations

complete

Speech

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.audio.speech.complete(input="<value>", stream=False, additional_properties={

    })

    with res as event_stream:
        for event in event_stream:
            # handle event
            print(event, flush=True)

Parameters

Parameter Type Required Description
input str ✔️ Text to generate a speech from
model OptionalNullable[str] N/A
metadata OptionalNullable[models.MetadataDict] N/A
stream Optional[bool] N/A
voice_id OptionalNullable[str] The preset or custom voice to use for generating the speech.
ref_audio OptionalNullable[str] The audio reference for generating the speech.
response_format Optional[models.SpeechOutputFormat] N/A
additional_properties Dict[str, Any] N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.SpeechV1AudioSpeechPostResponse

Errors

Error Type Status Code Content Type
errors.HTTPValidationError 422 application/json
errors.SDKError 4XX, 5XX */*