Instructions that adapt based on the user's input modality (audio vs. text).

The value property is the rendered string providers see. By default it equals the audio variant; after asModality it equals the chosen variant. Both the audio variant and the raw text variant are preserved so asModality can be called again for a different modality (e.g., when the same ChatContext is reused across tool-call turns).

Constructors

Properties

Accessors

Methods

Constructors

Properties

type: "instructions" = ...
value: string

The currently rendered string (what providers should treat as content).

Accessors

Methods

  • Return a copy whose value is the variant matching modality. Both audio and text variants are preserved on the result, so this can be called again for a different modality (e.g. across tool-call turns).

    Parameters

    • modality: "audio" | "text"

    Returns Instructions

  • Returns {
        audio: string;
        text?: string;
        type: "instructions";
    }

    • audio: string
    • Optional text?: string
    • type: "instructions"