@archastro/sdk
    Preparing search index...

    Class EvaluationResource

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Create an evaluation Sends a shared state and a list of typed questions to an evaluation model and returns typed answers. This is not chat completion and not JSON-schema structured output: there is no generated text. Each question is a boolean, choice, or score object with its own id. Answers carry that id, including a refusal answer containing only id and type when the model declines to judge a question. Image input, labelled score levels, and refusal answers are model-dependent. Images are separate from state and use the chat completion image-part format. Models without image support reject image input with 400 unsupported_capability. The authenticated app must have the llm_calls entitlement enabled on its plan. Requests that exceed the plan quota are rejected with 402. Token usage is recorded against the authenticated app and organization.

      Parameters

      • input: {
            images?: {
                image_data?: string;
                image_type?: string;
                image_url?: string;
                type: "image";
            }[];
            model?: string;
            questions: (
                | {
                    criteria?: { false_description?: string; true_description?: string };
                    id: string;
                    instructions: string;
                    type: "boolean";
                }
                | {
                    criteria: Record<string, unknown>;
                    id: string;
                    instructions: string;
                    type: "choice";
                }
                | { criteria: unknown[]; id: string; instructions: string; type: "score" }
            )[];
            session_id?: string;
            state: unknown;
        }

        Request body.

        • Optionalimages?: { image_data?: string; image_type?: string; image_url?: string; type: "image" }[]

          Optional image content parts. Omitted or empty means no images. Requires model image support.

        • Optionalmodel?: string

          Evaluation model identifier. Omit to use the platform default.

        • questions: (
              | {
                  criteria?: { false_description?: string; true_description?: string };
                  id: string;
                  instructions: string;
                  type: "boolean";
              }
              | {
                  criteria: Record<string, unknown>;
                  id: string;
                  instructions: string;
                  type: "choice";
              }
              | { criteria: unknown[]; id: string; instructions: string; type: "score" }
          )[]

          Nonempty list of boolean, choice, or score questions. Each question must include id, type, and instructions.

        • Optionalsession_id?: string

          Optional UUID grouping this evaluation under one session in the Developers dashboard. Generated when omitted.

        • state: unknown

          Shared content the model judges. A string, JSON object, or JSON array. Every question in the request sees this same state.

      Returns Promise<AIEvaluationResult>

      Typed boolean, choice, score, or refusal answers, plus model and usage.

    • List available evaluation models Returns the set of evaluation models that can be used with the evaluations endpoint. The list reflects models currently enabled for the platform and includes each model's identifier and whether it is the default. Use the id field from any entry in data as the model value when calling the evaluations endpoint.

      Returns Promise<
          {
              data: {
                  capabilities: ("search" | "image" | "temperature" | "thinking")[];
                  context_window?: number | null;
                  default: boolean;
                  id: string;
                  input_media_formats: string[];
                  name: string;
                  output_media_formats: string[];
              }[];
          },
      >

      Successful response