I am trying to create a chat bot that takes the customer’s booking data and uses it to send an email as soon as the user has provided all the data. When the user provides all the data, ChatGPT responds as if it has already sent the booking email but the function has not triggered. GPT trigger the function only if the user responds to the booking confirmation with “ok” or “thank you”.
How can I get the function to be triggered in the background without the user having to give the final “ok”?
This is my function definition:
{
"name": "send_reservation_mail",
"description": "Send a reservation mail.",
"parameters": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the person booking",
},
"qty": {
"type": "integer",
"description": "The number of people for booking",
},
"date": {
"type": "string",
"description": "the booking date of the YYYY-MM-DD format",
},
"hour": {
"type": "string",
"description": "The booking hour",
},
"phone": {
"type": "string",
"description": "The telephone number for reservation",
},
"email": {
"type": "string",
"description": "The email address to send reservation email",
},
"lang": {
"type": "string",
"description": "the ISO 2 language the user is talking to",
},
"note": {
"type": "string",
"description": "any notes of the reservation",
}
},
"required": ["name", "qty", "date", "hour", "phone", "email", "lang"],
},
}