> ## Documentation Index
> Fetch the complete documentation index at: https://docs.retab.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Workflow Eval

> Update a workflow eval.

Identified by `eval_id`. Send any of `name`, `assertion`, or `source`;
omitted fields are left unchanged. Returns the updated eval.

Patch the name, assertion, and/or source of a workflow eval. Every field is
optional in the request body — fields you omit are left untouched. Setting
`assertion: null` is rejected explicitly (use [Delete Workflow Eval](./delete) if
you want to remove the eval entirely).

Updating `source` rebinds where the inputs come from:

* `{ type: "manual", handle_inputs: ... }` — switch to hand-written inputs.
* `{ type: "run_step", run_id: ..., step_id: ... }` — re-capture inputs from
  a different workflow run / step.

The response is the full updated `WorkflowEval`.

<RequestExample>
  ```python Python theme={null}
  from retab import Retab

  client = Retab()

  # Rename only.
  workflow_eval = client.workflows.evals.update(
      eval_id="wfnodeeval_hsLEQiM61ez9Piv147MWk",
      name="Q1 invoice — vendor name check",
  )

  # Replace the assertion.
  workflow_eval = client.workflows.evals.update(
      eval_id="wfnodeeval_hsLEQiM61ez9Piv147MWk",
      assertion={
          "target": {"output_handle_id": "output-json-0", "path": "vendor.name"},
          "condition": {"kind": "matches_regex", "pattern": r"^Acme.*"},
      },
  )

  # Re-capture inputs from a different run.
  workflow_eval = client.workflows.evals.update(
      eval_id="wfnodeeval_hsLEQiM61ez9Piv147MWk",
      source={
          "type": "run_step",
          "run_id": "wfrun_new789",
          "step_id": "block_extract_invoice",
      },
  )
  ```

  ```typescript TypeScript theme={null}
  import { Retab } from "@retab/node";

  const client = new Retab({ apiKey: process.env.RETAB_API_KEY });

  const renamed = await client.workflows.evals.update("wfnodeeval_hsLEQiM61ez9Piv147MWk", "Q1 invoice — vendor name check");

  const reAsserted = await client.workflows.evals.update("wfnodeeval_hsLEQiM61ez9Piv147MWk", undefined, {
      target: { outputHandleId: "output-json-0", path: "vendor.name" },
      condition: { kind: "matches_regex", pattern: "^Acme.*" },
    });
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"log"

  	retab "github.com/retab-dev/retab/clients/go"
  )

  func ptr[T any](v T) *T { return &v }

  func main() {
  	ctx := context.Background()

  	client, err := retab.NewClient("")
  	if err != nil {
  		log.Fatal(err)
  	}

  	evalID := "wfnodeeval_hsLEQiM61ez9Piv147MWk"

  	// Rename only.
  	if _, err := client.Workflows.Evals.Update(ctx, evalID, &retab.WorkflowEvalsUpdateParams{
  		Name: ptr("Q1 invoice — vendor name check"),
  	}); err != nil {
  		log.Fatal(err)
  	}

  	// Replace the assertion.
  	if _, err := client.Workflows.Evals.Update(ctx, evalID, &retab.WorkflowEvalsUpdateParams{
  		Assertion: &retab.AssertionSpec{
  			Target:    retab.OutputTarget{OutputHandleID: "output-json-0", Path: ptr("vendor.name")},
  			Condition: retab.ConditionFromExistCondition(retab.ExistCondition{Kind: ptr("exists")}),
  		},
  	}); err != nil {
  		log.Fatal(err)
  	}

  	// Re-capture inputs from a different run.
  	if _, err := client.Workflows.Evals.Update(ctx, evalID, &retab.WorkflowEvalsUpdateParams{
  		Source: ptr(retab.WorkflowEvalSourceFromManualWorkflowEvalSource(retab.ManualWorkflowEvalSource{
  			Type: ptr("manual"),
  		})),
  	}); err != nil {
  		log.Fatal(err)
  	}
  }
  ```

  ```ruby Ruby theme={null}
  require 'retab'

  client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])

  # Rename only.
  workflow_eval = client.workflows.evals.update(
    eval_id: 'wfnodeeval_hsLEQiM61ez9Piv147MWk',
    name: 'Q1 invoice — vendor name check',
  )

  # Replace the assertion.
  workflow_eval = client.workflows.evals.update(
    eval_id: 'wfnodeeval_hsLEQiM61ez9Piv147MWk',
    assertion: {
      target: { output_handle_id: 'output-json-0', path: 'vendor.name' },
      condition: { kind: 'matches_regex', pattern: '^Acme.*' },
    },
  )

  # Re-capture inputs from a different run.
  workflow_eval = client.workflows.evals.update(
    eval_id: 'wfnodeeval_hsLEQiM61ez9Piv147MWk',
    source: {
      type: 'run_step',
      run_id: 'wfrun_new789',
      step_id: 'block_extract_invoice',
    },
  )
  ```

  ```rust Rust theme={null}
  use retab::models::{RunStepWorkflowEvalSource, UpdateWorkflowEvalRequest};
  use retab::resources::workflow_evals::UpdateParams;
  use retab::Retab;

  #[tokio::main]
  async fn main() -> Result<(), Box<dyn std::error::Error>> {
      let client = Retab::new(std::env::var("RETAB_API_KEY")?);
      let eval_id = "wfnodeeval_hsLEQiM61ez9Piv147MWk";

      // Rename only.
      let renamed_body = UpdateWorkflowEvalRequest {
          name: Some("Q1 invoice — vendor name check".into()),
          ..Default::default()
      };
      let _renamed = client
          .workflows().evals()
          .update(eval_id, UpdateParams::new(renamed_body))
          .await?;

      // Re-capture inputs from a different run.
      let mut source = RunStepWorkflowEvalSource::new("wfrun_new789");
      source.step_id = Some("block_extract_invoice".into());
      let resource_body = UpdateWorkflowEvalRequest {
          source: Some(source.into()),
          ..Default::default()
      };
      let _rebound = client
          .workflows().evals()
          .update(eval_id, UpdateParams::new(resource_body))
          .await?;
      Ok(())
  }
  ```

  ```php PHP theme={null}
  <?php
  require 'vendor/autoload.php';

  use Retab\Client;

  $client = new Client(apiKey: getenv('RETAB_API_KEY'));

  $result = $client->workflows()->evals()->update(
      evalId: 'eval_abc123',
  );
  print_r($result);
  ```

  ```csharp C# theme={null}
  using Retab;
  using RetabClient = Retab.Retab;

  var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
  var client = new RetabClient(apiKey);

  var result = await client.Workflows.Evals.UpdateAsync("eval_abc123", new WorkflowEvalsUpdateOptions());
  Console.WriteLine(result);
  ```

  ```java Java theme={null}
  import com.retab.RetabClient;
  import com.retab.workflowevals.WorkflowEvalsApi;

  public final class Example {
    public static void main(String[] args) throws Exception {
      RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));

      var result = new WorkflowEvalsApi(client).update("eval_abc123", "Invoice Processing", null, null);
      System.out.println(result);
    }
  }
  ```

  ```curl cURL theme={null}
  # Rename only
  curl -X 'PATCH' \
    'https://api.retab.com/v1/workflows/evals/wfnodeeval_hsLEQiM61ez9Piv147MWk' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer <your-api-key>' \
    -d '{ "name": "Q1 invoice — vendor name check" }'

  # Replace the assertion
  curl -X 'PATCH' \
    'https://api.retab.com/v1/workflows/evals/wfnodeeval_hsLEQiM61ez9Piv147MWk' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer <your-api-key>' \
    -d '{
      "assertion": {
        "target": { "output_handle_id": "output-json-0", "path": "vendor.name" },
        "condition": { "kind": "matches_regex", "pattern": "^Acme.*" }
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "wfnodeeval_hsLEQiM61ez9Piv147MWk",
    "workflow_id": "wf_abc123xyz",
    "target": { "type": "block", "block_id": "block_extract_invoice" },
    "source": { "type": "manual", "handle_inputs": { "...": "..." } },
    "name": "Q1 invoice — vendor name check",
    "assertion": { "...": "the new assertion" },
    "schema_drift": "none",
    "validation_status": "valid",
    "latest_run_summary": null,
    "created_at": "2026-04-08T14:22:26Z",
    "updated_at": "2026-05-01T14:35:00Z"
  }
  ```

  ```json 400 theme={null}
  {
    "detail": "assertion cannot be null"
  }
  ```

  ```json 404 theme={null}
  {
    "detail": "Workflow eval not found: wfnodeeval_hsLEQiM61ez9Piv147MWk"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml PATCH /v1/workflows/evals/{eval_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/workflows/evals/{eval_id}:
    patch:
      tags:
        - Workflows
        - Workflow Evals
      summary: Update Workflow Eval
      description: |-
        Update a workflow eval.

        Identified by `eval_id`. Send any of `name`, `assertion`, or `source`;
        omitted fields are left unchanged. Returns the updated eval.
      operationId: update_workflow_eval
      parameters:
        - in: path
          name: eval_id
          required: true
          schema:
            type: string
            title: Eval Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWorkflowEvalRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowEval'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateWorkflowEvalRequest:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        assertion:
          anyOf:
            - $ref: '#/components/schemas/AssertionSpec'
            - type: 'null'
        source:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/ManualWorkflowEvalSource'
                - $ref: '#/components/schemas/RunStepWorkflowEvalSource'
              discriminator:
                propertyName: type
                mapping:
                  manual:
                    $ref: '#/components/schemas/ManualWorkflowEvalSource'
                  run_step:
                    $ref: '#/components/schemas/RunStepWorkflowEvalSource'
            - type: 'null'
          title: Source
      additionalProperties: false
      type: object
      title: UpdateWorkflowEvalRequest
      description: >-
        Body for updating a workflow eval. Only the supplied fields (`name`,
        `assertion`, `source`) are changed.
    WorkflowEval:
      properties:
        id:
          type: string
          title: Id
        workflow_id:
          type: string
          title: Workflow Id
        target:
          $ref: '#/components/schemas/WorkflowEvalBlockTarget'
        source:
          oneOf:
            - $ref: '#/components/schemas/ManualWorkflowEvalSource'
            - $ref: '#/components/schemas/RunStepWorkflowEvalSource'
          title: Source
          discriminator:
            propertyName: type
            mapping:
              manual:
                $ref: '#/components/schemas/ManualWorkflowEvalSource'
              run_step:
                $ref: '#/components/schemas/RunStepWorkflowEvalSource'
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        assertion:
          anyOf:
            - $ref: '#/components/schemas/AssertionSpec'
            - type: 'null'
        assertion_schema_dep:
          anyOf:
            - $ref: '#/components/schemas/AssertionSchemaDep'
            - type: 'null'
        assertion_drift_status:
          anyOf:
            - type: string
              enum:
                - valid
                - drifted
                - broken
            - type: 'null'
          title: Assertion Drift Status
        schema_drift:
          type: string
          enum:
            - none
            - partial
            - drifted
            - unknown
          title: Schema Drift
          default: unknown
        schema_drift_detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Schema Drift Detail
        freshness:
          $ref: '#/components/schemas/ArtifactFreshness'
        drift:
          $ref: '#/components/schemas/ArtifactDrift'
        validation_status:
          type: string
          title: Validation Status
          default: valid
        validation_issues:
          items: {}
          type: array
          title: Validation Issues
          default: []
        latest_run_summary:
          anyOf:
            - $ref: '#/components/schemas/LatestBlockEvalRunSummary'
            - type: 'null'
        latest_passing_run_summary:
          anyOf:
            - $ref: '#/components/schemas/LatestBlockEvalRunSummary'
            - type: 'null'
        latest_failing_run_summary:
          anyOf:
            - $ref: '#/components/schemas/LatestBlockEvalRunSummary'
            - type: 'null'
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the workflow eval was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When the workflow eval was last updated
      type: object
      required:
        - id
        - source
        - target
        - workflow_id
      title: WorkflowEval
      description: >-
        A saved workflow eval: a target block, an input `source`, and the
        `assertion` evaluated against its output.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    AssertionSpec:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        target:
          $ref: '#/components/schemas/OutputTarget'
        condition:
          oneOf:
            - $ref: '#/components/schemas/ExistsCondition'
            - $ref: '#/components/schemas/NotExistsCondition'
            - $ref: '#/components/schemas/EqualsCondition'
            - $ref: '#/components/schemas/NotEqualsCondition'
            - $ref: '#/components/schemas/NumberCompareCondition'
            - $ref: '#/components/schemas/ContainsCondition'
            - $ref: '#/components/schemas/ObjectContainsCondition'
            - $ref: '#/components/schemas/ArrayContainsCondition'
            - $ref: '#/components/schemas/MatchesRegexCondition'
            - $ref: '#/components/schemas/JsonSchemaValidCondition'
            - $ref: '#/components/schemas/SimilarityGteCondition'
            - $ref: '#/components/schemas/LlmJudgedAsCondition'
            - $ref: '#/components/schemas/LlmNotJudgedAsCondition'
            - $ref: '#/components/schemas/NotContainsCondition'
            - $ref: '#/components/schemas/LengthCompareCondition'
            - $ref: '#/components/schemas/BetweenCondition'
            - $ref: '#/components/schemas/StartsWithCondition'
            - $ref: '#/components/schemas/EndsWithCondition'
            - $ref: '#/components/schemas/AllItemsMatchCondition'
            - $ref: '#/components/schemas/AnyItemMatchesCondition'
            - $ref: '#/components/schemas/SplitIOUCondition'
          title: Condition
          discriminator:
            propertyName: kind
            mapping:
              all_items_match:
                $ref: '#/components/schemas/AllItemsMatchCondition'
              any_item_matches:
                $ref: '#/components/schemas/AnyItemMatchesCondition'
              array_contains:
                $ref: '#/components/schemas/ArrayContainsCondition'
              between:
                $ref: '#/components/schemas/BetweenCondition'
              contains:
                $ref: '#/components/schemas/ContainsCondition'
              ends_with:
                $ref: '#/components/schemas/EndsWithCondition'
              equals:
                $ref: '#/components/schemas/EqualsCondition'
              exists:
                $ref: '#/components/schemas/ExistsCondition'
              json_schema_valid:
                $ref: '#/components/schemas/JsonSchemaValidCondition'
              length_compare:
                $ref: '#/components/schemas/LengthCompareCondition'
              llm_judged_as:
                $ref: '#/components/schemas/LlmJudgedAsCondition'
              llm_not_judged_as:
                $ref: '#/components/schemas/LlmNotJudgedAsCondition'
              matches_regex:
                $ref: '#/components/schemas/MatchesRegexCondition'
              not_contains:
                $ref: '#/components/schemas/NotContainsCondition'
              not_equals:
                $ref: '#/components/schemas/NotEqualsCondition'
              not_exists:
                $ref: '#/components/schemas/NotExistsCondition'
              number_compare:
                $ref: '#/components/schemas/NumberCompareCondition'
              object_contains:
                $ref: '#/components/schemas/ObjectContainsCondition'
              similarity_gte:
                $ref: '#/components/schemas/SimilarityGteCondition'
              split_iou_gte:
                $ref: '#/components/schemas/SplitIOUCondition'
              starts_with:
                $ref: '#/components/schemas/StartsWithCondition'
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
      type: object
      required:
        - condition
        - target
      title: AssertionSpec
      description: |-
        Block-eval assertion against one declared output handle.

        `target` is the only supported shape: an output handle id and an
        optional relative path inside that handle's payload.
    ManualWorkflowEvalSource:
      properties:
        type:
          type: string
          const: manual
          title: Type
          default: manual
        handle_inputs:
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/EvalJsonHandleInput'
              - $ref: '#/components/schemas/EvalFileHandleInput'
            discriminator:
              propertyName: type
              mapping:
                file:
                  $ref: '#/components/schemas/EvalFileHandleInput'
                json:
                  $ref: '#/components/schemas/EvalJsonHandleInput'
          type: object
          title: Handle Inputs
          default: {}
      type: object
      title: ManualWorkflowEvalSource
    RunStepWorkflowEvalSource:
      properties:
        type:
          type: string
          const: run_step
          title: Type
          default: run_step
        run_id:
          type: string
          title: Run Id
        step_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Step Id
      type: object
      required:
        - run_id
      title: RunStepWorkflowEvalSource
    WorkflowEvalBlockTarget:
      properties:
        type:
          type: string
          const: block
          title: Type
          default: block
        block_id:
          type: string
          title: Block Id
      type: object
      required:
        - block_id
      title: WorkflowEvalBlockTarget
      description: >-
        Public workflow-eval target.


        The storage layer remains block-scoped today, but the API shape names
        the

        tested entity explicitly so workflow-level targets can be added later.
    AssertionSchemaDep:
      properties:
        output_handle_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Output Handle Id
        schema_path:
          type: string
          title: Schema Path
        subtree_hash:
          type: string
          title: Subtree Hash
        depends_on_root:
          type: boolean
          title: Depends On Root
          default: false
      type: object
      required:
        - schema_path
        - subtree_hash
      title: AssertionSchemaDep
      description: Single-rule schema dependency for Level 2 drift detection.
    ArtifactFreshness:
      properties:
        status:
          type: string
          enum:
            - fresh
            - stale
            - unknown
          title: Status
          default: unknown
        reasons:
          items:
            type: string
            enum:
              - validity_changed
              - inputs_changed
              - engine_changed
              - metrics_engine_changed
              - no_baseline
          type: array
          title: Reasons
          default: []
        validity_fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: Validity Fingerprint
        input_fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: Input Fingerprint
        baseline_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Baseline Run Id
      type: object
      title: ArtifactFreshness
    ArtifactDrift:
      properties:
        status:
          type: string
          enum:
            - none
            - drifted
            - broken
            - unknown
          title: Status
          default: unknown
        affected_targets:
          items:
            type: string
          type: array
          title: Affected Targets
          default: []
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
      type: object
      title: ArtifactDrift
    LatestBlockEvalRunSummary:
      properties:
        run_record_id:
          type: string
          title: Run Record Id
        status:
          type: string
          enum:
            - pending
            - queued
            - running
            - completed
            - error
            - cancelled
          title: Status
        outcome:
          anyOf:
            - type: string
              enum:
                - passed
                - failed
                - blocked
            - type: 'null'
          title: Outcome
        started_at:
          type: string
          format: date-time
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
        workflow_draft_fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Draft Fingerprint
        block_execution_fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: Block Execution Fingerprint
        validity_fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: Validity Fingerprint
        handle_inputs_fingerprint:
          anyOf:
            - type: string
            - type: 'null'
          title: Handle Inputs Fingerprint
        assertions_passed:
          type: integer
          title: Assertions Passed
          default: 0
        assertions_failed:
          type: integer
          title: Assertions Failed
          default: 0
        blocked_assertions:
          type: integer
          title: Blocked Assertions
          default: 0
      type: object
      required:
        - run_record_id
        - started_at
        - status
      title: LatestBlockEvalRunSummary
      description: |-
        Summary of the most recent block-eval run.

        Execution status and verdict outcome are exposed as separate fields.
        The summary is written on terminal-state transitions, so in practice
        `status` is one of `completed | error | cancelled` and `outcome` is
        populated when `status == "completed"`.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
          default: null
        ctx:
          type: object
          title: Context
          default: {}
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    OutputTarget:
      properties:
        output_handle_id:
          type: string
          minLength: 1
          title: Output Handle Id
        path:
          anyOf:
            - type: string
            - type: 'null'
          title: Path
      additionalProperties: false
      type: object
      required:
        - output_handle_id
      title: OutputTarget
      description: Structured block-eval assertion target.
    ExistsCondition:
      properties:
        kind:
          type: string
          const: exists
          title: Kind
          default: exists
      type: object
      title: ExistsCondition
    NotExistsCondition:
      properties:
        kind:
          type: string
          const: not_exists
          title: Kind
          default: not_exists
      type: object
      title: NotExistsCondition
    EqualsCondition:
      properties:
        kind:
          type: string
          const: equals
          title: Kind
          default: equals
        expected:
          title: Expected
      type: object
      required:
        - expected
      title: EqualsCondition
    NotEqualsCondition:
      properties:
        kind:
          type: string
          const: not_equals
          title: Kind
          default: not_equals
        expected:
          title: Expected
      type: object
      required:
        - expected
      title: NotEqualsCondition
    NumberCompareCondition:
      properties:
        kind:
          type: string
          const: number_compare
          title: Kind
          default: number_compare
        op:
          type: string
          enum:
            - gt
            - gte
            - lt
            - lte
            - eq
            - neq
          title: Op
        expected:
          anyOf:
            - type: integer
            - type: number
          title: Expected
      type: object
      required:
        - expected
        - op
      title: NumberCompareCondition
    ContainsCondition:
      properties:
        kind:
          type: string
          const: contains
          title: Kind
          default: contains
        expected:
          title: Expected
      type: object
      required:
        - expected
      title: ContainsCondition
    ObjectContainsCondition:
      properties:
        kind:
          type: string
          const: object_contains
          title: Kind
          default: object_contains
        expected:
          additionalProperties: true
          type: object
          title: Expected
      type: object
      required:
        - expected
      title: ObjectContainsCondition
    ArrayContainsCondition:
      properties:
        kind:
          type: string
          const: array_contains
          title: Kind
          default: array_contains
        expected:
          additionalProperties: true
          type: object
          title: Expected
      type: object
      required:
        - expected
      title: ArrayContainsCondition
    MatchesRegexCondition:
      properties:
        kind:
          type: string
          const: matches_regex
          title: Kind
          default: matches_regex
        pattern:
          type: string
          title: Pattern
      type: object
      required:
        - pattern
      title: MatchesRegexCondition
    JsonSchemaValidCondition:
      properties:
        kind:
          type: string
          const: json_schema_valid
          title: Kind
          default: json_schema_valid
        schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Schema
      type: object
      title: JsonSchemaValidCondition
    SimilarityGteCondition:
      properties:
        kind:
          type: string
          const: similarity_gte
          title: Kind
          default: similarity_gte
        reference:
          title: Reference
        threshold:
          type: number
          title: Threshold
        method:
          type: string
          enum:
            - levenshtein
            - embeddings
          title: Method
          default: levenshtein
      type: object
      required:
        - reference
        - threshold
      title: SimilarityGteCondition
    LlmJudgedAsCondition:
      properties:
        kind:
          type: string
          const: llm_judged_as
          title: Kind
          default: llm_judged_as
        rubric:
          type: string
          title: Rubric
        expected_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Expected Label
      type: object
      required:
        - rubric
      title: LlmJudgedAsCondition
    LlmNotJudgedAsCondition:
      properties:
        kind:
          type: string
          const: llm_not_judged_as
          title: Kind
          default: llm_not_judged_as
        rubric:
          type: string
          title: Rubric
        expected_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Expected Label
      type: object
      required:
        - rubric
      title: LlmNotJudgedAsCondition
    NotContainsCondition:
      properties:
        kind:
          type: string
          const: not_contains
          title: Kind
          default: not_contains
        expected:
          title: Expected
      type: object
      required:
        - expected
      title: NotContainsCondition
    LengthCompareCondition:
      properties:
        kind:
          type: string
          const: length_compare
          title: Kind
          default: length_compare
        op:
          type: string
          enum:
            - gt
            - gte
            - lt
            - lte
            - eq
            - neq
          title: Op
        expected:
          type: integer
          title: Expected
      type: object
      required:
        - expected
        - op
      title: LengthCompareCondition
    BetweenCondition:
      properties:
        kind:
          type: string
          const: between
          title: Kind
          default: between
        lower:
          anyOf:
            - type: integer
            - type: number
          title: Lower
        upper:
          anyOf:
            - type: integer
            - type: number
          title: Upper
        inclusive:
          type: boolean
          title: Inclusive
          default: true
      type: object
      required:
        - lower
        - upper
      title: BetweenCondition
    StartsWithCondition:
      properties:
        kind:
          type: string
          const: starts_with
          title: Kind
          default: starts_with
        expected:
          type: string
          title: Expected
      type: object
      required:
        - expected
      title: StartsWithCondition
    EndsWithCondition:
      properties:
        kind:
          type: string
          const: ends_with
          title: Kind
          default: ends_with
        expected:
          type: string
          title: Expected
      type: object
      required:
        - expected
      title: EndsWithCondition
    AllItemsMatchCondition:
      properties:
        kind:
          type: string
          const: all_items_match
          title: Kind
          default: all_items_match
        condition:
          oneOf:
            - $ref: '#/components/schemas/ExistsCondition'
            - $ref: '#/components/schemas/NotExistsCondition'
            - $ref: '#/components/schemas/EqualsCondition'
            - $ref: '#/components/schemas/NotEqualsCondition'
            - $ref: '#/components/schemas/NumberCompareCondition'
            - $ref: '#/components/schemas/ContainsCondition'
            - $ref: '#/components/schemas/ObjectContainsCondition'
            - $ref: '#/components/schemas/ArrayContainsCondition'
            - $ref: '#/components/schemas/MatchesRegexCondition'
            - $ref: '#/components/schemas/JsonSchemaValidCondition'
            - $ref: '#/components/schemas/SimilarityGteCondition'
            - $ref: '#/components/schemas/LlmJudgedAsCondition'
            - $ref: '#/components/schemas/LlmNotJudgedAsCondition'
            - $ref: '#/components/schemas/NotContainsCondition'
            - $ref: '#/components/schemas/LengthCompareCondition'
            - $ref: '#/components/schemas/BetweenCondition'
            - $ref: '#/components/schemas/StartsWithCondition'
            - $ref: '#/components/schemas/EndsWithCondition'
            - $ref: '#/components/schemas/AllItemsMatchCondition'
            - $ref: '#/components/schemas/AnyItemMatchesCondition'
            - $ref: '#/components/schemas/SplitIOUCondition'
          title: Condition
          discriminator:
            propertyName: kind
            mapping:
              all_items_match:
                $ref: '#/components/schemas/AllItemsMatchCondition'
              any_item_matches:
                $ref: '#/components/schemas/AnyItemMatchesCondition'
              array_contains:
                $ref: '#/components/schemas/ArrayContainsCondition'
              between:
                $ref: '#/components/schemas/BetweenCondition'
              contains:
                $ref: '#/components/schemas/ContainsCondition'
              ends_with:
                $ref: '#/components/schemas/EndsWithCondition'
              equals:
                $ref: '#/components/schemas/EqualsCondition'
              exists:
                $ref: '#/components/schemas/ExistsCondition'
              json_schema_valid:
                $ref: '#/components/schemas/JsonSchemaValidCondition'
              length_compare:
                $ref: '#/components/schemas/LengthCompareCondition'
              llm_judged_as:
                $ref: '#/components/schemas/LlmJudgedAsCondition'
              llm_not_judged_as:
                $ref: '#/components/schemas/LlmNotJudgedAsCondition'
              matches_regex:
                $ref: '#/components/schemas/MatchesRegexCondition'
              not_contains:
                $ref: '#/components/schemas/NotContainsCondition'
              not_equals:
                $ref: '#/components/schemas/NotEqualsCondition'
              not_exists:
                $ref: '#/components/schemas/NotExistsCondition'
              number_compare:
                $ref: '#/components/schemas/NumberCompareCondition'
              object_contains:
                $ref: '#/components/schemas/ObjectContainsCondition'
              similarity_gte:
                $ref: '#/components/schemas/SimilarityGteCondition'
              split_iou_gte:
                $ref: '#/components/schemas/SplitIOUCondition'
              starts_with:
                $ref: '#/components/schemas/StartsWithCondition'
      type: object
      required:
        - condition
      title: AllItemsMatchCondition
    AnyItemMatchesCondition:
      properties:
        kind:
          type: string
          const: any_item_matches
          title: Kind
          default: any_item_matches
        condition:
          oneOf:
            - $ref: '#/components/schemas/ExistsCondition'
            - $ref: '#/components/schemas/NotExistsCondition'
            - $ref: '#/components/schemas/EqualsCondition'
            - $ref: '#/components/schemas/NotEqualsCondition'
            - $ref: '#/components/schemas/NumberCompareCondition'
            - $ref: '#/components/schemas/ContainsCondition'
            - $ref: '#/components/schemas/ObjectContainsCondition'
            - $ref: '#/components/schemas/ArrayContainsCondition'
            - $ref: '#/components/schemas/MatchesRegexCondition'
            - $ref: '#/components/schemas/JsonSchemaValidCondition'
            - $ref: '#/components/schemas/SimilarityGteCondition'
            - $ref: '#/components/schemas/LlmJudgedAsCondition'
            - $ref: '#/components/schemas/LlmNotJudgedAsCondition'
            - $ref: '#/components/schemas/NotContainsCondition'
            - $ref: '#/components/schemas/LengthCompareCondition'
            - $ref: '#/components/schemas/BetweenCondition'
            - $ref: '#/components/schemas/StartsWithCondition'
            - $ref: '#/components/schemas/EndsWithCondition'
            - $ref: '#/components/schemas/AllItemsMatchCondition'
            - $ref: '#/components/schemas/AnyItemMatchesCondition'
            - $ref: '#/components/schemas/SplitIOUCondition'
          title: Condition
          discriminator:
            propertyName: kind
            mapping:
              all_items_match:
                $ref: '#/components/schemas/AllItemsMatchCondition'
              any_item_matches:
                $ref: '#/components/schemas/AnyItemMatchesCondition'
              array_contains:
                $ref: '#/components/schemas/ArrayContainsCondition'
              between:
                $ref: '#/components/schemas/BetweenCondition'
              contains:
                $ref: '#/components/schemas/ContainsCondition'
              ends_with:
                $ref: '#/components/schemas/EndsWithCondition'
              equals:
                $ref: '#/components/schemas/EqualsCondition'
              exists:
                $ref: '#/components/schemas/ExistsCondition'
              json_schema_valid:
                $ref: '#/components/schemas/JsonSchemaValidCondition'
              length_compare:
                $ref: '#/components/schemas/LengthCompareCondition'
              llm_judged_as:
                $ref: '#/components/schemas/LlmJudgedAsCondition'
              llm_not_judged_as:
                $ref: '#/components/schemas/LlmNotJudgedAsCondition'
              matches_regex:
                $ref: '#/components/schemas/MatchesRegexCondition'
              not_contains:
                $ref: '#/components/schemas/NotContainsCondition'
              not_equals:
                $ref: '#/components/schemas/NotEqualsCondition'
              not_exists:
                $ref: '#/components/schemas/NotExistsCondition'
              number_compare:
                $ref: '#/components/schemas/NumberCompareCondition'
              object_contains:
                $ref: '#/components/schemas/ObjectContainsCondition'
              similarity_gte:
                $ref: '#/components/schemas/SimilarityGteCondition'
              split_iou_gte:
                $ref: '#/components/schemas/SplitIOUCondition'
              starts_with:
                $ref: '#/components/schemas/StartsWithCondition'
      type: object
      required:
        - condition
      title: AnyItemMatchesCondition
    SplitIOUCondition:
      properties:
        kind:
          type: string
          const: split_iou_gte
          title: Kind
          default: split_iou_gte
        expected:
          additionalProperties: true
          type: object
          title: Expected
        threshold:
          type: number
          title: Threshold
          default: 1
      type: object
      required:
        - expected
      title: SplitIOUCondition
      description: |-
        Intersection-over-Union for split page assignments.

        `expected` uses the split payload shape:
        `{"splits": [{"name", "pages"}]}`
    EvalJsonHandleInput:
      properties:
        data:
          title: Data
          default: null
        type:
          type: string
          const: json
          title: Type
          default: json
      additionalProperties: false
      type: object
      title: EvalJsonHandleInput
    EvalFileHandleInput:
      properties:
        document:
          $ref: '#/components/schemas/EvalPublicFileRef'
        type:
          type: string
          const: file
          title: Type
          default: file
      additionalProperties: false
      type: object
      required:
        - document
      title: EvalFileHandleInput
    EvalPublicFileRef:
      properties:
        id:
          type: string
          title: Id
          description: ID of the file
        filename:
          type: string
          title: Filename
          description: Filename of the file
        mime_type:
          type: string
          title: Mime Type
          description: MIME type of the file
      type: object
      required:
        - filename
        - id
        - mime_type
      title: EvalPublicFileRef
      description: Public/shared file reference used across SDK and customer-facing APIs.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````