jevrecipes

Recipe catalog / clarify

Check required information

clarify is a Jev recipe from the jev-recipes TypeScript package. Identify missing or ambiguous information before proceeding. Use it when you need to check for missing or ambiguous requirements before proceeding.

Last updated .

Explore this recipe interactively · Source and implementation guide · Markdown version

How do I use clarify in TypeScript?

Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.

import { clarify } from 'jev-recipes/clarify';

const result = await clarify({
  "request": "Please cancel it.",
  "context": "The customer has a monthly storage subscription and a pending hardware order.",
  "requirements": [
    {
      "id": "target",
      "description": "Which product or order should be changed"
    },
    {
      "id": "action",
      "description": "What change the customer wants"
    }
  ]
});
console.log(result);

What input does clarify take?

FieldTypeNeeded
requeststringRequired
contextstringOptional
requirementsarrayRequired
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "request": {
        "type": "string"
      },
      "context": {
        "type": "string"
      },
      "requirements": {
        "minItems": 1,
        "maxItems": 50,
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "description": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "description"
          ]
        }
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "request",
      "requirements"
    ]
  },
  "result": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "model": {
        "type": "string"
      },
      "usage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "input_tokens",
          "output_tokens"
        ],
        "additionalProperties": false
      },
      "status": {
        "type": "string",
        "enum": [
          "ready",
          "review"
        ]
      },
      "canProceed": {
        "type": "boolean"
      },
      "missing": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "ambiguous": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "checks": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "ready",
                "review"
              ]
            },
            "verdict": {
              "type": "string",
              "enum": [
                "present",
                "missing",
                "ambiguous"
              ]
            },
            "confidence": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "probabilities": {
              "type": "object",
              "propertyNames": {
                "type": "string",
                "enum": [
                  "present",
                  "missing",
                  "ambiguous"
                ]
              },
              "additionalProperties": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "required": [
                "present",
                "missing",
                "ambiguous"
              ]
            }
          },
          "required": [
            "id",
            "status",
            "verdict",
            "confidence",
            "probabilities"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "canProceed",
      "missing",
      "ambiguous",
      "checks"
    ],
    "additionalProperties": false
  }
}

What does a clarify result look like?

This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo clarify.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "canProceed": false,
  "missing": [],
  "ambiguous": [
    "target"
  ],
  "checks": [
    {
      "id": "target",
      "status": "ready",
      "verdict": "ambiguous",
      "confidence": 0.96,
      "probabilities": {
        "present": 0.015,
        "missing": 0.015,
        "ambiguous": 0.97
      }
    },
    {
      "id": "action",
      "status": "ready",
      "verdict": "present",
      "confidence": 0.96,
      "probabilities": {
        "present": 0.97,
        "missing": 0.015,
        "ambiguous": 0.015
      }
    }
  ]
}

Input

See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas.

Result

Verdict Meaning
present The required information is explicit or unambiguously implied.
missing The required information is absent.
ambiguous Relevant information has multiple plausible meanings or conflicting values.

checks preserves each requirement ID with its verdict, status, confidence, and probabilities. A check is ready when its confidence reaches minConfidence. Overall status is review if any check falls below the threshold.

canProceed is true only when every check is ready and present. missing and ambiguous contain confidently classified requirement IDs. A confident ambiguity assessment can be ready while canProceed remains false. Low-confidence checks also block proceeding, even if both ID lists are empty.

The result includes model and token usage. Inspect the outcome as well as its review status.

Reuse and calls

Uses the shared item-check helper. This folder owns the requirement criteria, follow-up ID lists, and can-proceed decision. All requirement questions are sent in one request. A live invocation makes one logical Jev request; SDK retries can add transport attempts.

Limits

Your application supplies the requirements and maps their IDs to follow-up questions. The recipe does not discover requirements, generate questions, validate identity, or enforce exact field formats.

Example input

demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo clarify shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe clarify to inspect the input and result schemas.

Build a conversation

Requirements and question text belong to the application. The starter asks the first unresolved requirement, includes the answer on the next turn, and sends an unresolved answer to review instead of asking again. See the support conversation starter.

How accurate is clarify?

Current measurement; labels unspecified

jev-1.13.0 / 2026-10-04 / 50 development cases

Scoring revision 2.

90%All-case accuracy
20Sent for review
0Failed calls / cases

30 ready decisions, with 100% accuracy among those decisions.

95% case-level interval: 79% to 96%. Related synthetic cases are correlated.

This measures the recorded dataset, not general readiness. Label sources: unspecified: Not recorded by the dataset author.

Use the evaluation guide to measure this decision on your own labeled cases.

What are the limits of clarify?