Recipe catalog / slot-fit
Check a proposed slot against constraints
Does the time or slot proposed in proposal satisfy the availability constraints written in constraints?
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.
Explore this recipe interactively ยท Source and implementation guide
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);
Input contract
| 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
}
}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 slot-fit.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"probability": 0.06,
"confidence": 0.94,
"verdict": "violates"
}
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
- 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.
Related recipes
- 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.