AtakanTekparmak commited on
Commit
fedf19e
·
verified ·
1 Parent(s): bf1a56c

feat: Updated example response in README

Browse files
Files changed (1) hide show
  1. README.md +24 -26
README.md CHANGED
@@ -158,35 +158,33 @@ print(response)
158
  The output should be something like:
159
 
160
  ````
161
- I'll help you check availability and make the appointment. Let's break this down into steps:
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
- # Calculate tomorrow's date
173
- tomorrow = (datetime.now() + timedelta(days=1)).strftime("%Y-%m-%d")
174
-
175
- # Check availability for 10:00-12:00
176
- available = check_availability(tomorrow, "10:00", "12:00")
177
-
178
- # If available, make the appointment
179
- appointment_details = make_appointment(
180
- day=tomorrow,
181
- start_time="10:00",
182
- end_time="12:00",
183
- title="Meeting with thesis supervisor"
 
 
 
 
 
 
 
184
  )
185
 
186
- # Add appointment to reminders if it was successfully made
187
- if appointment_details["appointment_made"]:
188
- reminder_text = f"Meeting with thesis supervisor on {tomorrow} from 10:00-12:00"
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: