Setting An Appointment With Structured Outputs
demo: https://vit.xwm.mybluehost.me/samples-site/?appointment
JSON Schema
{
"name": "appointment_booking",
"strict": true,
"schema": {
"type": "object",
"required": [
"user_id",
"appointment_details",
"confirmation_status",
"notes",
"chatbot_response"
],
"properties": {
"notes": {
"type": "string",
"description": "Any additional notes provided by the user regarding the appointment."
},
"user_id": {
"type": "string",
"description": "Unique identifier for the user booking the appointment."
},
"appointment_details": {
"type": "object",
"required": [
"date",
"time",
"service"
],
"properties": {
"date": {
"type": "string",
"description": "The date of the appointment."
},
"time": {
"type": "string",
"description": "The time of the appointment."
},
"service": {
"type": "string",
"description": "The type of service being booked."
}
},
"additionalProperties": false
},
"confirmation_status": {
"enum": [
"pending",
"confirmed",
"canceled"
],
"type": "string",
"description": "The status of the appointment confirmation."
},
"chatbot_response": {
"type": "string",
"description": "The response generated by the chatbot. Should ask the next relevant question until all properties have values."
}
},
"additionalProperties": false
}
}
Final output:
{"notes":"Request for Jennifer to cut hair.","user_id":"user_123","appointment_details":{"date":"2024-01-03","time":"16:00","service":"haircut"},"confirmation_status":"confirmed","chatbot_response":"Your appointment has been confirmed! You are scheduled for a haircut with Jennifer on January 3rd at 4 PM. If you need to make any changes or have any questions, feel free to let me know!"}