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
1import cohere
2
3co = cohere.Client("Your API key")
4response = co.chat(
5 model="command-a-03-2025",
6 message="""
7# Customer
8I want to book an appointment for a haircut next Friday at 3pm.
9
10# Available times
112024-03-11 Monday 5pm - 6pm
122024-03-13 Wednesday 12pm - 3pm
132024-03-15 Friday 4pm - 5pm
14
15# Context
16Now is 2024-03-11 3:27pm
17
18# Instruction
19Each 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
21If there are multiple times, choose the earliest. If no times are available, output None.
22
23Output should be in JSON format:
24```json JSON
25{
26next_available_time: "%Y-%m-%d %H"
27}
28```
29""",
30)
31print(response.text)