jevrecipes

Recipe catalog / listener-request-kind

Classify a listener's request

listener-request-kind is a Jev recipe from the jev-recipes TypeScript package. What does a listener's message ask of the performance? Use it when chat messages steer a live or generated musical performance and you need to know which control each message reaches for before deciding what to change.

Last updated .

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

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

const result = await listenerRequestKind({
  "message": "can you slow it down a bit? feels kinda frantic rn",
  "context": "Live piano stream. The current passage is a fast run of sixteenth notes in C minor at roughly 150 bpm.",
  "minConfidence": 0.8
});
console.log(result);

What input does listener-request-kind take?

FieldTypeNeeded
messagestringRequired
contextstringOptional
minConfidencenumberOptional
Full input and result schemas
{
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "message": {
        "type": "string"
      },
      "context": {
        "type": "string"
      },
      "minConfidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "required": [
      "message"
    ]
  },
  "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": [
          "mood",
          "tempo",
          "style",
          "specific_piece",
          "dynamics",
          "stop",
          "unclear"
        ]
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      },
      "probabilities": {
        "type": "object",
        "propertyNames": {
          "type": "string",
          "enum": [
            "mood",
            "tempo",
            "style",
            "specific_piece",
            "dynamics",
            "stop",
            "unclear"
          ]
        },
        "additionalProperties": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "required": [
          "mood",
          "tempo",
          "style",
          "specific_piece",
          "dynamics",
          "stop",
          "unclear"
        ]
      }
    },
    "required": [
      "model",
      "usage",
      "status",
      "verdict",
      "confidence",
      "probabilities"
    ],
    "additionalProperties": false
  }
}

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

{
  "model": "demo-fixture",
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  },
  "status": "ready",
  "verdict": "tempo",
  "confidence": 0.9,
  "probabilities": {
    "mood": 0.03,
    "tempo": 0.9,
    "style": 0.02,
    "specific_piece": 0.01,
    "dynamics": 0.02,
    "stop": 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 is one of mood, tempo, style, specific_piece, dynamics, stop, 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 label describes which control the message reaches for, not whether the performer should act on it or whether the request makes musical sense. A single message that asks for several changes is classified by the one it presses hardest, so application code should split or queue multi-part requests when each matters. Greetings, reactions, and questions land on unclear by design; treat that label as no steering signal rather than as a failure to classify.

Example input

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

How accurate is listener-request-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 listener-request-kind?