Member Junction
    Preparing search index...

    A BaseDecision driver for Inception Labs' Decisions API, POST https://api.inceptionlabs.ai/v1/decisions, which serves Mercury Decide (mercury-decide), a diffusion-based decision model. The key is the same Inception API key Mercury 2 uses. Errors arrive OpenAI-style ({ error: { message } }), or as FastAPI's { detail: [{ msg }] } for a 422. The endpoint, key and error handling come from BaseHostedSystemOneDecision.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    DEFAULT_ENDPOINT: "https://api.inceptionlabs.ai/v1/decisions" = 'https://api.inceptionlabs.ai/v1/decisions'

    The Inception Decisions API endpoint.

    DEFAULT_MODEL: "mercury-decide" = 'mercury-decide'

    The model used when DecisionParams.Model is empty.

    Accessors

    • get apiKey(): string

      Only sub-classes can access the API key

      Returns string

    • get EndpointURL(): string

      The Decisions API endpoint URL: the constructor's, else the credential's, else DefaultEndpoint, without trailing slashes.

      Returns string

    • get SecretsToRedact(): string[]

      The secrets an error message must never show, each removed with RedactSecret. Defaults to the credential's API key; a driver that sends only part of it (Cloudflare's token) adds that part.

      Returns string[]

    Methods

    • Executes a typed decision request across one or more questions about a given state. This method wraps driver execution with input validation, output verification, execution timing, and structured error handling. It never throws.

      Parameters

      • params: DecisionParams

        Decision request parameters including state, questions, and model.

      Returns Promise<DecisionResult>

      A Promise resolving to a DecisionResult.

    • The vendor's message when the body has one; otherwise the base default, the status and the start of the body.

      Parameters

      • status: number
      • bodyText: string

      Returns string

    • The one endpoint, whatever the model: the model travels in the body.

      Parameters

      • _model: string

      Returns string

    • Fixes two statuses whose ErrorAnalyzer reading is wrong for this API:

      • 402 (billing inactive or quota exceeded, "Account access is unavailable.") reads as Unknown; it is NoCredit;
      • 422 (a request Inception rejects, which passed MJ's own validation) reads as a fatal InvalidRequest that stops Default Decision's failover loop, unless the message happens to name a validation word; it is ModelError: another model may answer.

      Not VendorValidationError: on that the runner drops the vendor's other candidates, and the index it continues from then skips the next candidate (BaseModelRunner), which here would be Mercury Decide's OpenRouter row.

      ErrorAnalyzer keeps the rest: 401 stays a fatal Authentication error, as for every other driver; 404 (model_not_found) is ModelError and 413 (request_too_large) Unknown, both allowing failover; 429 and 5xx allow failover.

      Parameters

      • status: number

      Returns AIErrorType

    • The request headers. Defaults to the credential's API key as a bearer token and a JSON content type.

      Parameters

      • _model: string

        The model being asked.

      Returns Record<string, string>

    • The request body's model field. Defaults to the model unchanged.

      Parameters

      • model: string

        The model being asked.

      Returns string

    • Sends the request. This is the driver's only network call; a test double overrides it to stand in for the network.

      Parameters

      • url: string

        The endpoint from GetEndpointURL.

      • init: RequestInit

        The POST: method, headers, JSON body and the caller's cancellation signal.

      Returns Promise<Response>

    • Returns the System One response ({ model, answers, usage }) from a parsed 2xx body. Defaults to the body itself. A vendor that wraps the response in an envelope unwraps it here, and throws (with CreateSystemOneHTTPError) when the envelope reports a failure.

      Parameters

      • body: unknown

        The parsed JSON body.

      • _status: number

        The HTTP status, for an error thrown from here.

      Returns unknown