Recipe catalog / age-appropriateness
Grade audience age suitability
What is the youngest general audience for which content is appropriate, on a five-level rubric?
You need to route, filter, or label user-generated or model-generated content by audience age before publishing it.
Explore this recipe interactively ยท Source and implementation guide
Use age-appropriateness 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 { ageAppropriateness } from 'jev-recipes/age-appropriateness';
const result = await ageAppropriateness({
"content": "The two friends raced their bikes down the hill, laughing as the wind whipped past. At the bottom, Maya skidded and scraped her knee, but she grinned and said it was the best ride ever.",
"context": "Short story submitted to a reading app for young readers.",
"minConfidence": 0.8
});
console.log(result);
Input contract
| Field | Type | Needed |
|---|---|---|
| content | string | Required |
| context | string | Optional |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"content": {
"type": "string"
},
"context": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"content"
]
},
"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"
]
},
"score": {
"type": "number",
"minimum": 0
},
"level": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"probabilities": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"rating": {
"type": "string",
"enum": [
"everyone",
"children",
"teens",
"mature",
"adults"
]
}
},
"required": [
"model",
"usage",
"status",
"score",
"level",
"confidence",
"probabilities",
"rating"
],
"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 age-appropriateness.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"score": 0.21,
"level": 0,
"confidence": 0.82,
"probabilities": {
"0": 0.82,
"1": 0.15,
"2": 0.03,
"3": 0,
"4": 0
},
"rating": "everyone"
}
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
- Not a legal or regulatory rating. It approximates common content-rating conventions and does not replace an official classification.
- The score is an expected value over rubric levels. Application code chooses cutoffs.
Related recipes
- audience-fit: Use audience-fit to check whether content suits a specific named audience rather than an age band.
- policy-severity: Use policy-severity to grade how seriously content breaches a stated policy.