jevrecipes

Recipe catalog / dynamic-change

Steer the loudness

Should the upcoming phrase be softer, equally loud, or louder, judged from audience remarks about volume in context and the dynamics written in recentMaterial?

Your player must pick a volume level for the next phrase from requests for quiet or power.

Explore this recipe interactively ยท Source and implementation guide

Use dynamic-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 { dynamicChange } from 'jev-recipes/dynamic-change';

const result = await dynamicChange({
  "context": "Two chat messages: 'I'm studying, could you keep it quieter?' and 'seconded, the big chords are a lot'. No requests for more volume in the last five minutes. Stream goal: follow chat when requests agree.",
  "recentMaterial": "Forte chords in both hands, octaves in the bass, accented downbeats, marked fortissimo for the last eight bars, sustain pedal held through each bar.",
  "minConfidence": 0.8
});
console.log(result);

Input contract

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": [
          "softer",
          "same",
          "louder",
          "unclear"
        ]
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "enum": [
            "softer",
            "same",
            "louder",
            "unclear"
          ]
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "required": [
          "softer",
          "same",
          "louder",
          "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 dynamic-change.

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

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