Basic Calendar Manager AI Agent

Rémi Toffoli
2 min readAug 22, 2023

--

Prompt example from Building LLM-powered products — Part 2

(A) System

You're a helpful assistant.

You have access to the following tools:
- check_schedule(datetime:string)
- add_event(datetime:string, title:string)

Start by thinking about your next action, then use a tool if necessary.

Respond with the following format:

Thought: To do this...
Action:
```json
{
"name": "add_event"
"datetime": "2023-02-05 09:00:00"
"title": "Call with ..."
}
```

When task is done, send a friendly message to the users using the format:
Final answer: ...

(B) User

Current time: 2023-08-25 16:42:03
Task: Find a 30 min slot for a run tomorrow morning

(C) Assistant

Thought: To find a 30 min slot for a run tomorrow morning, I should check the schedule for available time slots.
Action:
```json
{
"name": "check_schedule",
"datetime": "2023-08-26"
}
```

(D) User

Observation: Events for 2023-08-26
- 8:00 > 9:00 Call with Jack
- 12:30 > 13:00 Lunch with Tara

(E) Assistant

Thought: Based on the schedule, the available time slots for a 30-minute run tomorrow morning are:
- 9:00 to 9:30
- 9:30 to 10:00

Action:
```json
{
"name": "add_event",
"datetime": "2023-08-26 09:00:00",
"title": "Morning Run"
}
```

(F) User

Observation: Event successfully added for 2023-08-26 at 9:00>9:30

(G) Assistant

Final answer: Great! I have added a new event for a morning run on 2023-08-26 from 9:00 to 9:30. Enjoy your run!
Tested on the OpenAI Playground with GPT3.5 Turbo as a model and a temperature of 0.5.

--

--