Member Junction
    Preparing search index...

    Parameters for executing an embedding call via AIEmbeddingRunner.

    interface EmbeddingRunParams {
        CancellationToken?: AbortSignal;
        ContextUser: UserInfo;
        Description?: string;
        Dimensions?: number;
        ModelID?: string;
        ParentRunID?: string;
        PromptID?: string;
        Provider?: IMetadataProvider;
        SkipRunRecord?: boolean;
        Texts: string[];
        TimeoutMS?: number;
    }
    Index

    Properties

    CancellationToken?: AbortSignal

    Optional: cancels the call, as AIPromptParams.cancellationToken cancels a chat call. A token already aborted refuses the call before a run row exists. Aborted during the call, it aborts the driver's request, ends the call before any further failover candidate, and the run row is recorded as Cancelled.

    ContextUser: UserInfo

    The user context for permissions and audit

    Description?: string

    Optional: human-readable description for the AIPromptRun record

    Dimensions?: number

    Optional: reduced embedding dimensions. Forwarded to the embedding provider's EmbedTexts call for models that support dimension reduction (e.g. OpenAI text-embedding-3-*); ignored by models that don't. The authoritative source is MJ: Vector Indexes.Dimensions — callers should read it from there and pass it here.

    ModelID?: string

    Optional: the model to embed with. When given, only this model's vendors are tried, so every vector comes from this model. Pass it whenever the vectors will be compared with stored vectors (a vector index, persisted embeddings, a cache): without it the call may answer from any Embeddings model the prompt falls back to.

    ParentRunID?: string

    Optional: parent run ID (e.g., agent run, classification run) for hierarchical tracking

    PromptID?: string

    Optional: the AIPrompt (type Embedding) this call runs under. Its model configuration picks the model when ModelID is not given, its failover and retry settings apply, and the run row is recorded against it. When omitted, the first active Embedding prompt is used, so name your prompt here to keep its costs separate. When no Embedding prompt exists at all, the call still runs (with the entity's default settings) but writes no run row.

    Optional metadata provider override

    SkipRunRecord?: boolean

    Optional: skip the MJ: AI Prompt Runs row for this call. Defaults to false: the row is written. Each call otherwise costs two fire-and-forget saves (the INSERT, then the finalize UPDATE). They add no latency, but they do add load, so a high-volume caller such as interactive vector search can opt out. When skipped, PromptRunID in the result is null.

    Texts: string[]

    The texts to embed

    TimeoutMS?: number

    Optional: 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 (the driver is handed the bound's signal) and fails with an AIPromptTimeoutError, which reads as a network error and so fails over. Unset or not positive means no bound.