MistralProvider/MistralSpeechModel.swift

swift-ai-sdk · Sources/MistralProvider/MistralSpeechModel.swift · swift · Apache-2.0
voice

Mistral TTS speech model implementation conforming to SpeechModelV4 with proper error handling and unsupported feature warnings.

// Source: https://github.com/teunlao/swift-ai-sdk | 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.
import Foundation
import AISDKProvider
import AISDKProviderUtils

public final class MistralSpeechModel: SpeechModelV4 {
    struct Config: Sendable {
        let provider: String
        let baseURL: String
        let headers: @Sendable () throws -> [String: String?]
        let fetch: FetchFunction?
        let currentDate: (@Sendable () -> Date)?

        init(
            provider: String,
            baseURL: String,
            headers: @escaping @Sendable () throws -> [String: String?] = { [:] },
            fetch: FetchFunction? = nil,
            currentDate: (@Sendable () 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key