feat: Updated example response in README
Browse files
README.md
CHANGED
|
@@ -158,35 +158,33 @@ print(response)
|
|
| 158 |
The output should be something like:
|
| 159 |
|
| 160 |
````
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
1. First, we need to check if tomorrow's 10:00-12:00 time slot is available using check_availability()
|
| 164 |
-
2. If available, we'll make the appointment using make_appointment()
|
| 165 |
-
3. Finally, we'll add the appointment to reminders if it was successfully made
|
| 166 |
-
|
| 167 |
-
Here's the code to accomplish this:
|
| 168 |
-
|
| 169 |
-
```python
|
| 170 |
from datetime import datetime, timedelta
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
#
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
)
|
| 185 |
|
| 186 |
-
# Add
|
| 187 |
-
if
|
| 188 |
-
|
| 189 |
-
add_to_reminders(reminder_text)
|
| 190 |
```
|
| 191 |
|
| 192 |
This code will:
|
|
|
|
| 158 |
The output should be something like:
|
| 159 |
|
| 160 |
````
|
| 161 |
+
# Get today's date and calculate tomorrow's date
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
from datetime import datetime, timedelta
|
| 163 |
+
today = datetime.now()
|
| 164 |
+
tomorrow = (today + timedelta(days=1)).strftime("%Y-%m-%d")
|
| 165 |
+
|
| 166 |
+
# Define the time slots
|
| 167 |
+
start_time = "10:00"
|
| 168 |
+
end_time = "12:00"
|
| 169 |
+
|
| 170 |
+
# Check availability first
|
| 171 |
+
is_available = check_availability(tomorrow, start_time, end_time)
|
| 172 |
+
|
| 173 |
+
# Only proceed with making the appointment if it's available
|
| 174 |
+
appointment_result = (
|
| 175 |
+
make_appointment(
|
| 176 |
+
day=tomorrow,
|
| 177 |
+
start_time=start_time,
|
| 178 |
+
end_time=end_time,
|
| 179 |
+
title="Meeting with Thesis Supervisor"
|
| 180 |
+
)
|
| 181 |
+
if is_available
|
| 182 |
+
else {"appointment_made": False}
|
| 183 |
)
|
| 184 |
|
| 185 |
+
# Add to reminders only if the appointment was made
|
| 186 |
+
if appointment_result["appointment_made"]:
|
| 187 |
+
add_to_reminders("Meeting with Thesis Supervisor scheduled for 10:00 AM tomorrow")
|
|
|
|
| 188 |
```
|
| 189 |
|
| 190 |
This code will:
|