Member Junction
    Preparing search index...

    Interface AIImageGenerationRunParams

    Parameters for AIImageGenerationRunner.RunImageGeneration: the driver's own ImageGenerationParams (prompt, n, size, quality, style and the rest), plus the runner's options. The driver's model is set by the runner, per candidate, to the candidate's API name.

    interface AIImageGenerationRunParams {
        AgentID?: string;
        AgentRunID?: string;
        APIKeys?: AIAPIKey[];
        aspectRatio?: string;
        CancellationToken?: AbortSignal;
        ContextUser: UserInfo;
        CredentialScope?: AICredentialScope;
        model?: string;
        ModelID?: string;
        n?: number;
        negativePrompt?: string;
        OnPromptRunCreated?: (promptRunId: string) => void | Promise<void>;
        outputFormat?: ImageResponseFormat;
        ParentRunID?: string;
        prompt: string;
        PromptID?: string;
        providerOptions?: Record<string, unknown>;
        quality?: ImageQuality;
        seed?: number;
        size?: string;
        style?: string;
        TimeoutMS?: number;
        user?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    AgentID?: string

    The agent the call is made for, recorded as the run row's AgentID.

    AgentRunID?: string

    The agent run this call belongs to. MJ: AI Prompt Runs has no agent-run column, so it is recorded in the row's Messages, for reading only. To join the row to the run, use OnPromptRunCreated.

    APIKeys?: AIAPIKey[]

    Keys by driver class, passed through as the base runner's apiKeys. A key reaches only the candidates of its own driver class, so a caller whose key should survive failover supplies one for each driver class a candidate may use.

    They rank as they do for chat prompts, just above the environment keys: a credential bound to the prompt-model, the model-vendor or the vendor, or a default credential of the vendor's credential type, wins over them.

    aspectRatio?: string

    Aspect ratio as an alternative to explicit size. Format: "width:height" e.g., "16:9", "1:1", "9:16"

    CancellationToken?: AbortSignal

    Optional signal for cancelling the request. The driver is responsible for honoring it: it should refuse the call when the signal is already aborted and hand it to the provider's HTTP client, so an abort tears the request down. A call the signal ends resolves with success: false and an errorInfo that classifies a caller cancellation as Cancelled, which is never failed over (see BaseImageGenerator.CancelledResult).

    ContextUser: UserInfo

    The user the run is made and recorded for. Required.

    CredentialScope?: AICredentialScope

    Passed through as the base runner's CredentialScope. 'RuntimeOnly' restricts the run to APIKeys: a candidate whose driver class has no key there is skipped, never run on the platform's credentials.

    model?: string

    Model name/ID to use for generation

    ModelID?: string

    Pins the image model by ID, as AIDecisionRunner does with override.modelId. Failover then stays within that model's vendors. Leave it unset to let the carrier prompt's bindings choose, which is what makes failover reach another model.

    n?: number

    Number of images to generate. Default is 1. Some providers have limits on the maximum number.

    negativePrompt?: string

    Negative prompt - things to avoid in the generated image. Not all providers support this.

    OnPromptRunCreated?: (promptRunId: string) => void | Promise<void>

    Called with the run row's ID as soon as the row exists, before the model call: the hook an agent step uses to point its TargetLogID at the row. An error it throws is logged, never raised.

    outputFormat?: ImageResponseFormat

    How the generated image should be returned

    ParentRunID?: string

    A parent MJ: AI Prompt Runs row, recorded as this run's ParentID.

    prompt: string

    Text prompt describing the image to generate. Required.

    PromptID?: string

    The MJ: AI Prompts row whose bindings choose the model and whose failover settings apply. Defaults to the Default Image Generation prompt.

    providerOptions?: Record<string, unknown>

    Provider-specific additional parameters

    quality?: ImageQuality

    Quality level for the generated image

    seed?: number

    Optional seed for reproducible generation. Not all providers support seeding.

    size?: string

    Size of the generated image(s)

    style?: string

    Style preset for the generated image

    TimeoutMS?: number

    A bound, in milliseconds, on each driver call, as AIPromptParams.timeoutMS bounds each chat call: every failover candidate gets its own. A call that runs longer is aborted through the signal the driver is handed and fails with an AIPromptTimeoutError, which reads as a network error and so fails over. Unset or not positive means no bound.

    user?: string

    User identifier for tracking/abuse prevention