D-ID Client SDK - v3.0.0-0
    Preparing search index...

    Interface TextStreamScript

    A script that makes the agent say text you supply, synthesized by a text-to-speech provider.

    The usual payload for speak(). The agent's LLM is not involved, so the agent says exactly what input contains — which is what makes it the right script for greetings and other canned lines. Passing a plain string to speak() is shorthand for this script with ssml set to false.

    const speak = await agentManager.speak({
    type: 'text',
    input: "Hi! I'm Alice!",
    });

    sentiment is for Expressive (V4) agents only. If the requested sentiment is not supported by the agent, the default sentiment is used.

    const speak = await agentManager.speak({
    type: 'text',
    input: "Hi! I'm Alice!",
    sentiment: 'friendly',
    });
    interface TextStreamScript {
        input: string;
        provider?: TtsProvider;
        sentiment?: string;
        should_queue_speaks?: boolean;
        ssml?: boolean;
        type: "text";
    }
    Index
    input: string

    The text to be synthesized into speech.

    Each provider has its own limit on the text length.

    "This is an example text"
    

    40000

    3

    provider?: TtsProvider

    The text-to-speech provider and voice that synthesize input, from the list of supported providers.

    One of the objects in TtsProvider: a type naming the provider, the voice_id to speak with, and optional provider-specific voice_config. Leave it out and the SDK sends the script without a provider, so the voice is chosen server-side; the Agents API documents Microsoft TTS as its default when no provider is given.

    sentiment?: string

    Sentiment name to speak with. Expressive (V4) agents only; if the agent does not support the requested sentiment, its default sentiment is used.

    "friendly"
    
    should_queue_speaks?: boolean

    Queue this speak behind the current speech instead of interrupting it. Expressive (V4) agents only.

    false
    
    ssml?: boolean

    Is the text provided in ssml form.

    Set it to true when input is SSML markup rather than plain text, so the provider reads the tags instead of speaking them.

    false
    
    type: "text"

    Which kind of script this is. Always text for this variant; an AudioStreamScript carries audio instead.