Creating Plot Twists
    Preparing search index...

    Type Alias ChatSpec

    How a realtime conversation should be run. Returned by the twist's spec callback when the user taps a chat action.

    type ChatSpec = {
        instructions: string;
        greeting: string | null;
        historyLimit: number | null;
        voice: string | null;
        maxSeconds: number | null;
        onEnded: Callback;
    }
    Index

    Properties

    instructions: string

    The complete system prompt. Twist-owned — the runtime appends recent thread notes as conversation history and nothing else.

    greeting: string | null

    Spoken verbatim to open the conversation. Null to let the agent open.

    historyLimit: number | null

    How many recent notes to supply as history. Null for the default of 20.

    voice: string | null

    TTS voice identifier. Null for Plot's default voice.

    maxSeconds: number | null

    Requested cap in seconds. Clamped down to the platform maximum, never up. Null for the platform maximum.

    onEnded: Callback

    Invoked with the finished ChatSession once the session ends.

    Delivered at-least-once: a retry after a transient failure can invoke this callback again for the same session. Write it to be safe to run more than once for the same ChatSession.id.