Interface ToolExecutionOptions

Options for chat.tools.execute() and chat.tools.executeAll().

interface ToolExecutionOptions {
    attribution?: WorkloadAttributionInput;
    mediaContext?: {
        audio?: string[];
        images?: string[];
        uploadedAudio?: string[];
        uploadedImages?: string[];
        uploadedVideos?: string[];
        videos?: string[];
    };
    network?: "fast"
    | "relaxed";
    numberOfMedia?: number;
    onProgress?: (progress: ToolExecutionProgress) => void;
    timeout?: number;
    tokenType?: "sogni" | "spark";
}

Properties

Optional workload attribution for media projects executed by the tool.

mediaContext?: {
    audio?: string[];
    images?: string[];
    uploadedAudio?: string[];
    uploadedImages?: string[];
    uploadedVideos?: string[];
    videos?: string[];
}

Indexed media available to canonical hosted-tool arguments such as referenceImageIndices. Non-negative indices address generated media; negative indices address uploaded media (-1 is the first upload). Values must be inline data URIs or trusted Sogni/S3/CloudFront HTTPS URLs.

network?: "fast" | "relaxed"

Network to use for media generation.

numberOfMedia?: number

Number of media items to generate per tool call. Default: 1.

onProgress?: (progress: ToolExecutionProgress) => void

Progress callback fired during media generation.

timeout?: number

Maximum continuous time in milliseconds to wait without an actual worker job processing. The countdown pauses while any job is processing and restarts between jobs, so this is not a total project-duration limit. Actual worker jobs have a separate, non-configurable 30-minute runtime safety limit beginning at jobStart.

Default: 5400000 (90 minutes).

tokenType?: "sogni" | "spark"

Token type to use for billing the generated media.