Spaces:
Sleeping
Sleeping
updated the routes code `✅✅
Browse files
app.py
CHANGED
|
@@ -55,11 +55,14 @@ def end_call():
|
|
| 55 |
return "Error: Appointment ID not found. Please try again."
|
| 56 |
|
| 57 |
# Send a request to the backend to mark the appointment as completed
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
# Gradio interface
|
| 65 |
with gr.Blocks() as demo:
|
|
@@ -72,7 +75,7 @@ with gr.Blocks() as demo:
|
|
| 72 |
gr.HTML("""
|
| 73 |
<div style="position: relative; overflow: hidden; aspect-ratio: 16/9;">
|
| 74 |
<video autoplay muted loop preload="none" style="width: 100%; height: auto; border-radius: 10px;">
|
| 75 |
-
<source src="
|
| 76 |
Your browser does not support the video tag.
|
| 77 |
</video>
|
| 78 |
</div>
|
|
|
|
| 55 |
return "Error: Appointment ID not found. Please try again."
|
| 56 |
|
| 57 |
# Send a request to the backend to mark the appointment as completed
|
| 58 |
+
try:
|
| 59 |
+
response = requests.post(COMPLETE_APPOINTMENT_ENDPOINT, json={"appointment_id": appointment_id})
|
| 60 |
+
if response.status_code == 200:
|
| 61 |
+
return "Appointment marked as completed. Redirecting to the doctors' page..."
|
| 62 |
+
else:
|
| 63 |
+
return f"Error: {response.json().get('message', 'Failed to complete the appointment')}"
|
| 64 |
+
except Exception as e:
|
| 65 |
+
return f"Error: Unable to connect to the backend. Details: {str(e)}"
|
| 66 |
|
| 67 |
# Gradio interface
|
| 68 |
with gr.Blocks() as demo:
|
|
|
|
| 75 |
gr.HTML("""
|
| 76 |
<div style="position: relative; overflow: hidden; aspect-ratio: 16/9;">
|
| 77 |
<video autoplay muted loop preload="none" style="width: 100%; height: auto; border-radius: 10px;">
|
| 78 |
+
<source src="https://your-cdn-or-server.com/path-to-video.mp4" type="video/mp4">
|
| 79 |
Your browser does not support the video tag.
|
| 80 |
</video>
|
| 81 |
</div>
|