jevrecipes

Recipe catalog / listing-fact-consistency

Check a listing description against its fact sheet

Does the free-text description contradict the structured facts about the property?

You need to catch a marketing description that disagrees with the structured listing data on bedrooms, size, year built, or features before the listing is published or syndicated.

Explore this recipe interactively ยท Source and implementation guide

Use listing-fact-consistency 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 { listingFactConsistency } from 'jev-recipes/listing-fact-consistency';

const result = await listingFactConsistency({
  "description": "Welcome to this beautifully maintained four-bedroom colonial on a half-acre lot. The 2,400 sq ft layout offers a renovated kitchen, hardwood floors throughout, a finished basement, and a two-car attached garage. Built in 1994 and lovingly updated, this home is move-in ready.",
  "facts": "Property type: Single-family, colonial\nBedrooms: 3\nBathrooms: 2.5\nLiving area: 2,380 sq ft\nLot size: 0.5 acres\nYear built: 1994\nGarage: 2-car attached\nBasement: Unfinished\nFlooring: Hardwood, carpet",
  "minConfidence": 0.8
});
console.log(result);

Input contract

FieldTypeNeeded
descriptionstringRequired
factsstringRequired
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "description": {
        "type": "string"
      },
      "facts": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "description",
      "facts"
    ]
  },
  "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"
        ]
      },
      "probability": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "verdict": {
        "type": "string",
        "enum": [
          "contradicts",
          "consistent"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "probability",
      "confidence",
      "verdict"
    ],
    "additionalProperties": false
  }
}

Saved example result

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

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "probability": 0.95,
  "confidence": 0.95,
  "verdict": "contradicts"
}

Evaluation evidence

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.

Limitations

Related recipes