Recipe catalog / mood-request
Identify a requested mood
mood-request is a Jev recipe from the jev-recipes TypeScript package. What mood does the listener's message ask to hear? Use it when a listener's message asks for a feeling from a musical performance and you need one of a fixed set of moods to steer the next passage.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use mood-request 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 { moodRequest } from 'jev-recipes/mood-request';
const result = await moodRequest({
"message": "long day, can we get something soft and dreamy? trying to wind down before bed",
"minConfidence": 0.8
});
console.log(result);
What input does mood-request take?
| Field | Type | Needed |
|---|---|---|
| message | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"message": {
"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": [
"happy",
"sad",
"calm",
"energetic",
"tense",
"romantic",
"unclear"
]
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"probabilities": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"happy",
"sad",
"calm",
"energetic",
"tense",
"romantic",
"unclear"
]
},
"additionalProperties": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"required": [
"happy",
"sad",
"calm",
"energetic",
"tense",
"romantic",
"unclear"
]
}
},
"required": [
"model",
"usage",
"status",
"verdict",
"confidence",
"probabilities"
],
"additionalProperties": false
}
}What does a mood-request 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 mood-request.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"verdict": "calm",
"confidence": 0.9,
"probabilities": {
"happy": 0.01,
"sad": 0.02,
"calm": 0.9,
"energetic": 0.01,
"tense": 0.01,
"romantic": 0.03,
"unclear": 0.02
}
}
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 happy, sad, calm, energetic, tense, romantic, 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 is the mood the listener asks the music to take on, which is not the same as how the listener feels, so it should not be used as a read on the listener's emotional state. Requests phrased as a tempo, style, or named piece carry no explicit feeling and land on unclear; use a separate classifier for those controls. One label is returned, so a message that asks for two moods at once is resolved to the one pressed hardest and application code should decide how to blend or sequence them.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo mood-request shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe mood-request to inspect the input and result schemas.
How accurate is mood-request?
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 mood-request?
- Labels the mood the message asks for, not the mood the listener is in. A listener who says they are sad may be asking for cheerful music.
- Messages that ask for a tempo, style, or piece without naming a feeling land on unclear rather than being translated into a mood.
- Mixed or contradictory requests collapse to the mood pressed most or to unclear; the recipe returns one label.
Which recipes are related to mood-request?
- emotion-kind: Use emotion-kind to label the emotion the writer expresses, rather than the mood they ask the music to take on.
- turn-intent: Use turn-intent to find out what a message is doing conversationally before asking which mood it requests.