Book an appointment
This could be used in a scenario when the model is connected to other services such as calendar and scheduling API.
Prompt
# Customer I want to book an appointment for a haircut next Friday at 3pm. # Available times 2024-03-11 Monday 5pm - 6pm 2024-03-13 Wednesday 12pm - 3pm 2024-03-15 Friday 4pm - 5pm # Context Now is 2024-03-11 3:27pm # Instruction Each appointment takes 1 hour. If there is availabiltiy within "available times" that meets Customer's schedule, output a start time of the appointment that can be scheduled in the following format "%Y-%m-%d %H". If there are multiple times, choose the earliest. If no times are available, output None. Output should be in JSON format: ```json JSON { next_available_time: "%Y-%m-%d %H" } ```
Output
{ "next_available_time": "2024-03-15 4pm" }
API Request
PYTHON
1 import cohere 2 3 co = cohere.Client("Your API key") 4 response = co.chat( 5 model="command-a-03-2025", 6 message=""" 7 # Customer 8 I want to book an appointment for a haircut next Friday at 3pm. 9 10 # Available times 11 2024-03-11 Monday 5pm - 6pm 12 2024-03-13 Wednesday 12pm - 3pm 13 2024-03-15 Friday 4pm - 5pm 14 15 # Context 16 Now is 2024-03-11 3:27pm 17 18 # Instruction 19 Each appointment takes 1 hour. If there is availabiltiy within "available times" that meets Customer's schedule, output a start time of the appointment that can be scheduled in the following format "%Y-%m-%d %H". 20 21 If there are multiple times, choose the earliest. If no times are available, output None. 22 23 Output should be in JSON format: 24 ```json JSON 25 { 26 next_available_time: "%Y-%m-%d %H" 27 } 28 ``` 29 """, 30 ) 31 print(response.text)