jevrecipes

Recipe catalog / tempo-change

Steer the tempo

tempo-change is a Jev recipe from the jev-recipes TypeScript package. Should the beat slow down, hold, or speed up next, given what listeners said about pace in context and how fast recentMaterial moved? Use it when a live loop has read chat about speed and must choose one pacing direction for the coming bars.

Last updated .

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

How do I use tempo-change 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 { tempoChange } from 'jev-recipes/tempo-change';

const result = await tempoChange({
  "context": "Three chat messages in the last minute: 'pick it up a little', 'faster!!', and 'this is dragging'. No one asked for it to stay slow. Stream goal: follow chat when requests agree.",
  "recentMaterial": "Slow ballad in E-flat major at about 60 bpm, half notes and quarter notes in the left hand, sparse melody, moderate dynamics, held for the last two minutes.",
  "minConfidence": 0.8
});
console.log(result);

What input does tempo-change take?

FieldTypeNeeded
contextstringRequired
recentMaterialstringRequired
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "context": {
        "type": "string"
      },
      "recentMaterial": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "context",
      "recentMaterial"
    ]
  },
  "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": [
          "slower",
          "same",
          "faster",
          "unclear"
        ]
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "enum": [
            "slower",
            "same",
            "faster",
            "unclear"
          ]
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "required": [
          "slower",
          "same",
          "faster",
          "unclear"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "verdict",
      "confidence",
      "probabilities"
    ],
    "additionalProperties": false
  }
}

What does a tempo-change 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 tempo-change.

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "verdict": "faster",
  "confidence": 0.9,
  "probabilities": {
    "slower": 0.01,
    "same": 0.05,
    "faster": 0.9,
    "unclear": 0.04
  }
}

Input

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

Result

verdict is one of slower, same, faster, unclear. unclear means the supplied facts do not establish a decision and always requires review.

A result is ready when confidence meets minConfidence and the verdict is not unclear. Inspect the verdict as well as the status: a ready result can name an outcome your application treats as negative. probabilities covers every verdict.

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.

Limits

The result is a direction, not a number. Choosing how many beats per minute to shift, how quickly to ramp, and where the floor and ceiling sit belongs in application code. Requests are weighed as context states them; if some listeners should count more than others, or a moderator has overridden chat, say so in context rather than expecting the recipe to know. The recipe reads the description in recentMaterial and cannot check it against audio, so a stale or inaccurate description produces a poorly grounded direction.

Example input

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

How accurate is tempo-change?

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 tempo-change?