Recipe catalog / slot-fit
Check a proposed slot against constraints
slot-fit is a Jev recipe from the jev-recipes TypeScript package. Does the time or slot proposed in proposal satisfy the availability constraints written in constraints? Use it when a scheduling assistant has a candidate time and the availability of a person described in plain language, and needs a yes/no check before offering the slot.
Last updated .
Explore this recipe interactively · Source and implementation guide · Markdown version
How do I use slot-fit 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 { slotFit } from 'jev-recipes/slot-fit';
const result = await slotFit({
"proposal": "How about Friday at 3:00 PM for the kickoff call?",
"constraints": "I am available weekday afternoons from 1 PM to 5 PM, except Fridays, which I keep meeting-free.",
"minConfidence": 0.8
});
console.log(result);
What input does slot-fit take?
| Field | Type | Needed |
|---|---|---|
| proposal | string | Required |
| constraints | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"proposal": {
"type": "string"
},
"constraints": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"proposal",
"constraints"
]
},
"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"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"verdict": {
"type": "string",
"enum": [
"fits",
"violates"
]
}
},
"required": [
"model",
"usage",
"status",
"probability",
"confidence",
"verdict"
],
"additionalProperties": false
}
}What does a slot-fit 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 slot-fit.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"probability": 0.06,
"confidence": 0.94,
"verdict": "violates"
}
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 fits when Jev's yes probability is at least 0.5 and violates otherwise. probability is that yes probability. confidence is the probability of the chosen side, so a 0.1 yes probability yields violates with 0.9 confidence.
A result is ready when confidence meets minConfidence. Otherwise it is review. Treat a review result as unknown and fall back to your safe default, such as asking the person to confirm the slot instead of booking it.
Reuse and calls
Uses the shared gate helper, a single yes/no question. This folder owns the question wording, the outcome descriptions, and the review policy. A live invocation makes one logical Jev request.
Limits
The recipe judges wording against wording. It reads natural-language rules such as "afternoons except Fridays" but does not compute calendar arithmetic, so resolve concrete dates, durations, and time zones in code before or after the call; a proposal and constraints written in different time zones will not be reconciled. Constraints are taken as complete, so other commitments, holidays, or preferences not stated in constraints are unknown. To decide whether an availability statement is a hard rule or a preference, use constraint-strength.
Example input
demo.json contains editable input and a hand-authored response. After installing jev-recipes, npx jev-recipes demo slot-fit shows an offline illustration, not an accuracy measurement. Use npx jev-recipes describe slot-fit to inspect the input and result schemas.
How accurate is slot-fit?
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 slot-fit?
- Judges the wording of the proposal against the wording of the constraints. Parse concrete dates, durations, and time zones in code; the recipe does not compute calendar arithmetic.
- Constraints are taken as written. It does not know about other commitments, holidays, or availability not stated in constraints.
Which recipes are related to slot-fit?
- constraint-strength: Use constraint-strength to decide whether an availability statement is a hard requirement or a preference before treating it as a constraint.
- step-complete: Use step-complete to check whether a scheduling step has finished rather than whether a slot is allowed.