Standalone Next.js demo for an agentic hotel-booking flow:
- user enters natural-language travel constraints
- backend searches LiteAPI hotel rates
- backend validates a Concerto-shaped booking constraint payload
- backend evaluates obligations and violations
- Gemini summarizes the real provider results
- user can confirm a recommended offer, which calls LiteAPI prebook only
No final booking or payment is performed.
npm install
cp .env.example .env.local
npm run devOpen:
http://localhost:3000/demo/hotel-agent
LITEAPI_API_KEY=...
GEMINI_API_KEY=...
GEMINI_MODEL=gemini-3.1-flash-liteIf LITEAPI_API_KEY is missing, the demo uses deterministic sample offers.
If GEMINI_API_KEY is missing, the demo still evaluates offers but uses a deterministic summary.
GET /api/agent/card
POST /api/agent/tasks
POST /api/liteapi/prebook
/api/agent/tasks accepts:
{
"taskId": "demo-1",
"input": {
"message": "Find me a hotel under $250/night, refundable until 24 hours before check-in.",
"constraints": {
"maxNightlyRateUsd": 250,
"refundableUntilHoursBeforeCheckIn": 24,
"requireNoCookiePricing": true,
"requireUserConfirmationBeforePayment": true
}
}
}The demo includes two small Concerto model files under models/:
payment.ctohotel.cto
The runtime validates the generated booking object against the expected model shape. It does not embed a full Concerto parser.