Recipe catalog / guest-request-facets
Label the booking facets a guest request states
Which of these does request state: travel dates, party size, accessibility needs, a budget, or a special occasion?
A reservations or concierge assistant receives a free-form guest inquiry and needs to know which standard booking details are already present so it can pre-fill the request and ask only for what is missing.
Explore this recipe interactively ยท Source and implementation guide
Use guest-request-facets 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 { guestRequestFacets } from 'jev-recipes/guest-request-facets';
const result = await guestRequestFacets({
"request": "Hello, we are hoping to book two rooms from Friday 14 November to Sunday 16 November for my parents' 40th wedding anniversary. There will be six of us: my parents, my husband and me, and our two teenagers. My father uses a walker, so one of the rooms needs to be step-free with a roll-in shower and close to the elevator. Could you also let us know whether the restaurant can do a small celebration dinner on the Saturday?",
"minConfidence": 0.8
});
console.log(result);
Input contract
| Field | Type | Needed |
|---|---|---|
| request | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"request": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"request"
]
},
"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"
]
},
"detected": {
"type": "array",
"items": {
"type": "string",
"enum": [
"statesDates",
"statesPartySize",
"statesAccessibilityNeeds",
"statesBudget",
"statesOccasion"
]
}
},
"labels": {
"type": "object",
"properties": {
"statesDates": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"statesPartySize": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"statesAccessibilityNeeds": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"statesBudget": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
},
"statesOccasion": {
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"present",
"absent"
]
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"status",
"verdict",
"probability",
"confidence"
],
"additionalProperties": false
}
},
"required": [
"statesDates",
"statesPartySize",
"statesAccessibilityNeeds",
"statesBudget",
"statesOccasion"
],
"additionalProperties": false
}
},
"required": [
"model",
"usage",
"status",
"detected",
"labels"
],
"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 guest-request-facets.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"detected": [
"statesDates",
"statesPartySize",
"statesAccessibilityNeeds",
"statesOccasion"
],
"labels": {
"statesDates": {
"status": "ready",
"verdict": "present",
"probability": 0.96,
"confidence": 0.96
},
"statesPartySize": {
"status": "ready",
"verdict": "present",
"probability": 0.95,
"confidence": 0.95
},
"statesAccessibilityNeeds": {
"status": "ready",
"verdict": "present",
"probability": 0.93,
"confidence": 0.93
},
"statesBudget": {
"status": "ready",
"verdict": "absent",
"probability": 0.07,
"confidence": 0.9299999999999999
},
"statesOccasion": {
"status": "ready",
"verdict": "present",
"probability": 0.94,
"confidence": 0.94
}
}
}
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
- Reports only whether the wording states each facet, not whether the dates are available, the party fits a room, or the budget is realistic. Parse actual dates, counts, and amounts in application code.
- Labels are independent, so a request can state several facets or none. It does not judge urgency or sentiment.
Related recipes
- message-facets: Use message-facets for the general communicative facets of a message, such as questions, deadlines, and requests, rather than booking-specific details.
- clarify: Use clarify to decide whether to ask the guest a follow-up question about the facets this recipe finds missing.