jevrecipes

Recipe catalog / clause-kind

Classify contract clause kind

clause-kind is a Jev recipe from the jev-recipes TypeScript package. What does clause primarily do? Use it when you need to sort contract or policy clauses by what they do so obligations and prohibitions can be tracked separately from rights and definitions.

Last updated .

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

How do I use clause-kind 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 { clauseKind } from 'jev-recipes/clause-kind';

const result = await clauseKind({
  "clause": "The Supplier shall deliver the Goods to the Delivery Address no later than thirty (30) days after receipt of a Purchase Order.",
  "context": "Clause 4.2 of a goods supply agreement between a manufacturer and a retailer.",
  "minConfidence": 0.8
});
console.log(result);

What input does clause-kind take?

FieldTypeNeeded
clausestringRequired
contextstringOptional
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "clause": {
        "type": "string"
      },
      "context": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "clause"
    ]
  },
  "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"
        ]
      },
      "verdict": {
        "type": "string",
        "enum": [
          "obligation",
          "right",
          "prohibition",
          "condition",
          "definition",
          "unclear"
        ]
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "enum": [
            "obligation",
            "right",
            "prohibition",
            "condition",
            "definition",
            "unclear"
          ]
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "required": [
          "obligation",
          "right",
          "prohibition",
          "condition",
          "definition",
          "unclear"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "verdict",
      "confidence",
      "probabilities"
    ],
    "additionalProperties": false
  }
}

What does a clause-kind 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 clause-kind.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "verdict": "obligation",
  "confidence": 0.92,
  "probabilities": {
    "obligation": 0.92,
    "right": 0.02,
    "prohibition": 0.01,
    "condition": 0.03,
    "definition": 0.01,
    "unclear": 0.01
  }
}

Input

See shared options and behavior for client configuration, validation, and errors. Types are inferred from this folder's Zod 4 schemas. context is optional and is omitted from the request when absent.

Result

Verdict Meaning
obligation The clause requires a party to do something.
right The clause permits or entitles a party to do something.
prohibition The clause forbids a party from doing something.
condition The clause makes something apply only if a stated circumstance occurs, without itself imposing the requirement.
definition The clause defines a term for use elsewhere in the document.
unclear The primary effect of the clause is not established by the supplied text.

The result includes verdict, confidence, and all choice probabilities. unclear always requires review, even at high confidence. Other verdicts can be ready.

Results include model and token usage. Decisions below minConfidence require review. Inspect the outcome as well as the status.

Reuse and calls

Uses the shared choice helper for the Jev call and response parsing. This folder owns its question, verdict criteria, and review policy. A live invocation makes one logical Jev request; SDK retries can add transport attempts.

Limits

The recipe classifies what a clause does as written. It is not legal advice: it does not establish whether the clause is enforceable, which party it favors, or how a court would read it. A clause that mixes effects, such as an obligation with a carve-out, is graded by its primary effect; split compound clauses in code when each part matters. For how binding a single constraint is, use constraint-strength.

Example input

demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo clause-kind shows the result offline. The fixture is an illustration, not an accuracy measurement. npx jev-recipes describe clause-kind shows the input and result schemas.

How accurate is clause-kind?

Fixture only

No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.

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

What are the limits of clause-kind?