TagoIO SDK for JavaScript and TypeScript
    Preparing search index...

    Interface AIGenerateParams

    interface AIGenerateParams {
        callback?: { analysis: string };
        custom?: boolean;
        effort?: AIGenerateEffort;
        image_detail?: "original" | "auto" | "low" | "high";
        max_output_tokens?: number;
        messages: string | AIGenerateMessage[];
        model?: string;
        response_format?: {
            name: string;
            schema: Record<string, unknown>;
            type: "json_schema";
        };
        system?: string;
        wait?: number;
    }
    Index

    Properties

    callback?: { analysis: string }

    Analysis to run when the job reaches a final status, with the job as scope[0]. The Analysis token must hold run_analysis on it, or the request is rejected before the job starts.

    If the API process running the job stops (for example, during a deploy), the job reads as failed with interrupted and the callback does not run. Keep a fallback, such as reading the job with getGeneration, when the result matters.

    custom?: boolean

    Marks model as a custom wire id for the profile's own provider key, not a catalog slug.

    Thinking effort. When omitted, the API resolves it for the model.

    image_detail?: "original" | "auto" | "low" | "high"

    Detail level for every image attached to the request. Defaults to high. Only OpenAI-family models read it; other providers ignore it.

    max_output_tokens?: number

    Maximum output tokens, a positive integer up to 18,000. When omitted, the AI chat default applies.

    messages: string | AIGenerateMessage[]

    Conversation so far. The last message must be a user message. A string is sent as a single user message. Messages and system together are limited to about 16,000 tokens.

    model?: string

    Catalog model to run. When omitted, the profile's chat model is used, then the free default model.

    response_format?: {
        name: string;
        schema: Record<string, unknown>;
        type: "json_schema";
    }

    Ask for JSON output that follows a JSON schema (max 32 KB). The parsed object is returned in output.json. The API does not check it against the schema, so validate it before use.

    Type declaration

    • name: string

      Letters, digits, _ and -, up to 64 characters.

    • schema: Record<string, unknown>
    • type: "json_schema"
    system?: string

    System instructions for the model.

    wait?: number

    Seconds to wait for the result before the API answers with a pending job. Defaults to 10; values above 25 wait 25. Must not be negative. Use 0 to return right away.