Using OpenAI/ChatGPT, I can provide available time slots and other context that allows the assistant to supply available times; however, I'm not sure how to process the response in a way that can confidently trigger the API to schedule a visit.
Use case: Allow a user to book an appointment through SMS/chat. Steps:
- User: "Hi, I'd like to book a visit. Do you have availability Friday?"
- Assistant: "Yes, we have availability Friday at 2pm or 3pm. If that doesn't work we also have Monday at 10am available"
- User: "I'll take Friday at 3pm"
- Determine the correct time slot chosen by the user
- Book the user
Hello @cjharlin! This is a pretty cool use case! How does your chat interface work? I would trigger a Retool Workflow when the user selects their time and send the user's response (e.g. "I'll take Friday at 3PM") to the Workflow.
Then, you can use Retool AI to parse the user response using an AI Actions query. I'd say there are two options for this.
- Use a
Generate text AI Action and use a prompt of something along the lines of "Convert this statement from a user into a datetime timestamp. The format must be a unix timestamp.
- Use a
Extract entities AI Action select date, time, and/or day as your entities to extract.
Once this is done, add a conditional block to the Workflow to confirm that the AI block outputted the date/time in the correct format. If it was correct, add a REST API (or whatever resource you need) block that calls your API with the date/time. If it was not in the correct format, add some error handling (such as sending yourself an email that it failed).
Let me know if you have any questions.