Emmanuel Frimpong Asante
commited on
Commit
·
33a55fb
1
Parent(s):
0bb091b
update space
Browse files- .idea/workspace.xml +13 -10
- app.py +0 -2
- routes/chatbot.py +2 -2
- templates/chatbot.html +2 -1
- templates/main/base.html +1 -1
.idea/workspace.xml
CHANGED
|
@@ -6,6 +6,9 @@
|
|
| 6 |
<component name="ChangeListManager">
|
| 7 |
<list default="true" id="27c9ae1a-a6fa-4472-8bcd-a7087620894b" name="Changes" comment="update space">
|
| 8 |
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
|
|
|
|
|
|
|
|
|
| 9 |
<change beforePath="$PROJECT_DIR$/templates/main/base.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/main/base.html" afterDir="false" />
|
| 10 |
</list>
|
| 11 |
<option name="SHOW_DIALOG" value="false" />
|
|
@@ -125,15 +128,7 @@
|
|
| 125 |
<workItem from="1730378091154" duration="2435000" />
|
| 126 |
<workItem from="1730381153348" duration="8786000" />
|
| 127 |
<workItem from="1730397485849" duration="22781000" />
|
| 128 |
-
<workItem from="1730454506390" duration="
|
| 129 |
-
</task>
|
| 130 |
-
<task id="LOCAL-00057" summary="update space">
|
| 131 |
-
<option name="closed" value="true" />
|
| 132 |
-
<created>1730379649428</created>
|
| 133 |
-
<option name="number" value="00057" />
|
| 134 |
-
<option name="presentableId" value="LOCAL-00057" />
|
| 135 |
-
<option name="project" value="LOCAL" />
|
| 136 |
-
<updated>1730379649428</updated>
|
| 137 |
</task>
|
| 138 |
<task id="LOCAL-00058" summary="update space">
|
| 139 |
<option name="closed" value="true" />
|
|
@@ -519,7 +514,15 @@
|
|
| 519 |
<option name="project" value="LOCAL" />
|
| 520 |
<updated>1730471205719</updated>
|
| 521 |
</task>
|
| 522 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 523 |
<servers />
|
| 524 |
</component>
|
| 525 |
<component name="TypeScriptGeneratedFilesManager">
|
|
|
|
| 6 |
<component name="ChangeListManager">
|
| 7 |
<list default="true" id="27c9ae1a-a6fa-4472-8bcd-a7087620894b" name="Changes" comment="update space">
|
| 8 |
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
| 9 |
+
<change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
|
| 10 |
+
<change beforePath="$PROJECT_DIR$/routes/chatbot.py" beforeDir="false" afterPath="$PROJECT_DIR$/routes/chatbot.py" afterDir="false" />
|
| 11 |
+
<change beforePath="$PROJECT_DIR$/templates/chatbot.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/chatbot.html" afterDir="false" />
|
| 12 |
<change beforePath="$PROJECT_DIR$/templates/main/base.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/main/base.html" afterDir="false" />
|
| 13 |
</list>
|
| 14 |
<option name="SHOW_DIALOG" value="false" />
|
|
|
|
| 128 |
<workItem from="1730378091154" duration="2435000" />
|
| 129 |
<workItem from="1730381153348" duration="8786000" />
|
| 130 |
<workItem from="1730397485849" duration="22781000" />
|
| 131 |
+
<workItem from="1730454506390" duration="10479000" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
</task>
|
| 133 |
<task id="LOCAL-00058" summary="update space">
|
| 134 |
<option name="closed" value="true" />
|
|
|
|
| 514 |
<option name="project" value="LOCAL" />
|
| 515 |
<updated>1730471205719</updated>
|
| 516 |
</task>
|
| 517 |
+
<task id="LOCAL-00106" summary="update space">
|
| 518 |
+
<option name="closed" value="true" />
|
| 519 |
+
<created>1730471627598</created>
|
| 520 |
+
<option name="number" value="00106" />
|
| 521 |
+
<option name="presentableId" value="LOCAL-00106" />
|
| 522 |
+
<option name="project" value="LOCAL" />
|
| 523 |
+
<updated>1730471627598</updated>
|
| 524 |
+
</task>
|
| 525 |
+
<option name="localTasksCounter" value="107" />
|
| 526 |
<servers />
|
| 527 |
</component>
|
| 528 |
<component name="TypeScriptGeneratedFilesManager">
|
app.py
CHANGED
|
@@ -14,8 +14,6 @@ from routes.chatbot import chatbot_router
|
|
| 14 |
from routes.disease_detection import disease_router
|
| 15 |
from routes.administration import dashboard_router
|
| 16 |
from services.health_monitoring_service import evaluate_health_data, send_alerts
|
| 17 |
-
from services.auth_service import optional_get_current_user
|
| 18 |
-
from services.utils import db
|
| 19 |
from huggingface_hub import login
|
| 20 |
|
| 21 |
# Setup logging
|
|
|
|
| 14 |
from routes.disease_detection import disease_router
|
| 15 |
from routes.administration import dashboard_router
|
| 16 |
from services.health_monitoring_service import evaluate_health_data, send_alerts
|
|
|
|
|
|
|
| 17 |
from huggingface_hub import login
|
| 18 |
|
| 19 |
# Setup logging
|
routes/chatbot.py
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
# routes/chatbot.py
|
| 2 |
|
| 3 |
-
import io
|
| 4 |
-
|
| 5 |
import cv2
|
| 6 |
import numpy as np
|
| 7 |
from fastapi.templating import Jinja2Templates
|
|
@@ -14,6 +12,7 @@ from models.schemas.inquiry_schema import Inquiry
|
|
| 14 |
from services.auth_service import get_current_user
|
| 15 |
from typing import List
|
| 16 |
|
|
|
|
| 17 |
chatbot_router = APIRouter()
|
| 18 |
|
| 19 |
templates = Jinja2Templates(directory="templates")
|
|
@@ -115,3 +114,4 @@ async def inquire(text: str, current_user: str = Depends(get_current_user), file
|
|
| 115 |
inquiry_collection.insert_one(inquiry.dict(by_alias=True))
|
| 116 |
|
| 117 |
return JSONResponse(content={"response_text": response_text, "detected_disease": detected_disease, "confidence": disease_confidence})
|
|
|
|
|
|
| 1 |
# routes/chatbot.py
|
| 2 |
|
|
|
|
|
|
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
| 5 |
from fastapi.templating import Jinja2Templates
|
|
|
|
| 12 |
from services.auth_service import get_current_user
|
| 13 |
from typing import List
|
| 14 |
|
| 15 |
+
|
| 16 |
chatbot_router = APIRouter()
|
| 17 |
|
| 18 |
templates = Jinja2Templates(directory="templates")
|
|
|
|
| 114 |
inquiry_collection.insert_one(inquiry.dict(by_alias=True))
|
| 115 |
|
| 116 |
return JSONResponse(content={"response_text": response_text, "detected_disease": detected_disease, "confidence": disease_confidence})
|
| 117 |
+
|
templates/chatbot.html
CHANGED
|
@@ -110,7 +110,8 @@
|
|
| 110 |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
| 111 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
| 112 |
<script>
|
| 113 |
-
const
|
|
|
|
| 114 |
|
| 115 |
chatSocket.onmessage = function(event) {
|
| 116 |
const data = JSON.parse(event.data);
|
|
|
|
| 110 |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
| 111 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
| 112 |
<script>
|
| 113 |
+
const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
| 114 |
+
const chatSocket = new WebSocket(`${protocol}${window.location.host}/ws/chat`);
|
| 115 |
|
| 116 |
chatSocket.onmessage = function(event) {
|
| 117 |
const data = JSON.parse(event.data);
|
templates/main/base.html
CHANGED
|
@@ -58,7 +58,7 @@
|
|
| 58 |
<ul class="nav nav-pills nav-sidebar flex-column" role="menu" data-accordion="false">
|
| 59 |
<!-- Home -->
|
| 60 |
<li class="nav-item">
|
| 61 |
-
<a href="/admin/
|
| 62 |
<i class="nav-icon fas fa-home"></i>
|
| 63 |
<p>Dashboard</p>
|
| 64 |
</a>
|
|
|
|
| 58 |
<ul class="nav nav-pills nav-sidebar flex-column" role="menu" data-accordion="false">
|
| 59 |
<!-- Home -->
|
| 60 |
<li class="nav-item">
|
| 61 |
+
<a href="/admin/" class="nav-link">
|
| 62 |
<i class="nav-icon fas fa-home"></i>
|
| 63 |
<p>Dashboard</p>
|
| 64 |
</a>
|