// This file was auto-generated by Fern from our API Definition.

import type * as Vapi from "../index.js";

export interface ClientMessageAssistantSpeech {
    /** This is the phone number that the message is associated with. */
    phoneNumber?: Vapi.ClientMessageAssistantSpeechPhoneNumber | undefined;
    /** This is the type of the message. "assistant-speech" is sent as assistant audio is being played. */
    type: Vapi.ClientMessageAssistantSpeechType;
    /**
     * The full assistant text for the current turn. This is the complete text,
     * not an incremental delta — consumers should use `timing` metadata (e.g.
     * `wordsSpoken`) to determine which portion has been spoken so far.
     */
    text: string;
    /** This is the turn number of the assistant speech event (0-indexed). */
    turn?: number | undefined;
    /** Indicates how the text was sourced. */
    source?: Vapi.ClientMessageAssistantSpeechSource | undefined;
    /**
     * Optional timing metadata. Shape depends on `timing.type`:
     *
     * - `word-alignment` (ElevenLabs): per-character timing at playback
     *   cadence. words[] includes space entries. Best consumed by tracking
     *   a running character count: join timing.words, add to a char cursor,
     *   and highlight text up to that position. No interpolation needed.
     *
     * - `word-progress` (Minimax with voice.subtitleType: 'word'): cursor-
     *   based word count per TTS segment. Use wordsSpoken as the anchor,
     *   interpolate forward using segmentDurationMs or timing.words until
     *   the next event arrives.
     *
     * When absent, the event is a text-only fallback for providers without
     * word-level timing (e.g. Cartesia, Deepgram, Azure). Text emits once
     * per TTS chunk when audio is playing. Optionally interpolate a word
     * cursor at ~3.5 words/sec between events for approximate tracking.
     */
    timing?: Vapi.ClientMessageAssistantSpeechTiming | undefined;
    /** This is the timestamp of the message. */
    timestamp?: number | undefined;
    /** This is the call that the message is associated with. */
    call?: Vapi.Call | undefined;
    /** This is the customer that the message is associated with. */
    customer?: Vapi.CreateCustomerDto | undefined;
    /** This is the assistant that the message is associated with. */
    assistant?: Vapi.CreateAssistantDto | undefined;
}
