Recipe catalog / tempo-change
Steer the tempo
Should the beat slow down, hold, or speed up next, given what listeners said about pace in context and how fast recentMaterial moved?
A live loop has read chat about speed and must choose one pacing direction for the coming bars.
Explore this recipe interactively ยท Source and implementation guide
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);
Input contract
| Field | Type | Needed |
|---|---|---|
| context | string | Required |
| recentMaterial | string | Required |
| minConfidence | number | Optional |
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
}
}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 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
}
}
Evaluation evidence
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
- Chooses a direction only. It does not pick a beats-per-minute value or a rate of change; application code owns the amount.
- Weighs the requests stated in context as written and does not know which listeners matter more unless context says so.
- Reads recentMaterial as described; it cannot hear audio or verify that the description matches what was played.
Related recipes
- intent-change: Use intent-change to detect that a listener has changed what they want, rather than to choose a tempo direction from the whole context.
- step-progress: Use step-progress to judge movement toward a caller-defined objective rather than a tempo adjustment.