Mistral AI TTS wrapper for LiveKit agents, providing text-to-speech synthesis with configurable model, voice, and format.
# Source: https://github.com/livekit/agents | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations
import asyncio
import base64
import os
import struct
import uuid
from dataclasses import dataclass, replace
from typing import Literal
import httpx # mistralai raises httpx.TimeoutException from its httpx v1 client
from livekit.agents import (
APIConnectionError,
APIConnectOptions,
APIStatusError,
APITimeoutError,
tts,
)
from livekit.agents.types import DEFAULT_API_CONNECT_OPTIONS, NOT_GIVEN, NotGivenOr
from livekit.agents.utils import is_given
from mistralai.client import Mistral
from mistralai.client.errors import HTTPValidationErr
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key