subashpoudel commited on
Commit
66f3c65
·
1 Parent(s): 822cf1e
api/routers/analytics_chatbot.py CHANGED
@@ -51,10 +51,10 @@ def get_analytics(request: AnalyticsChatRequest):
51
  response_to_cache['response'] = result['response']
52
  response_to_cache['endpoint'] = result['endpoint']
53
 
54
- # if request.image_base64 and not response_to_cache.get('description'):
55
- # description = generate_analytics_description(user_query, request.image_base64)
56
- # if description is not None:
57
- # response_to_cache['description'] = description
58
 
59
  redis_client.set(cache_key, json.dumps(response_to_cache), ex=3000)
60
  return response_to_cache
 
51
  response_to_cache['response'] = result['response']
52
  response_to_cache['endpoint'] = result['endpoint']
53
 
54
+ if request.image_base64 and not response_to_cache.get('description'):
55
+ description = generate_analytics_description(user_query, request.image_base64)
56
+ if description is not None:
57
+ response_to_cache['description'] = description
58
 
59
  redis_client.set(cache_key, json.dumps(response_to_cache), ex=3000)
60
  return response_to_cache
api/schemas/analytics_chatbot.py CHANGED
@@ -3,4 +3,4 @@ from typing import Optional
3
 
4
  class AnalyticsChatRequest(BaseModel):
5
  msg: str
6
- # image_base64:Optional[str] = None
 
3
 
4
  class AnalyticsChatRequest(BaseModel):
5
  msg: str
6
+ image_base64:Optional[str] = None
logs/access.log CHANGED
@@ -1835,3 +1835,15 @@
1835
  2025-11-17 12:35:00,599 | INFO | access_logger | app.py:18 | Request: POST http://127.0.0.1:8000/api/analytics-chatbot
1836
  2025-11-17 12:35:24,309 | INFO | access_logger | app.py:20 | Response status: 200
1837
  2025-11-17 12:36:00,652 | INFO | access_logger | app.py:18 | Request: POST http://127.0.0.1:8000/api/analytics-chatbot
 
 
 
 
 
 
 
 
 
 
 
 
 
1835
  2025-11-17 12:35:00,599 | INFO | access_logger | app.py:18 | Request: POST http://127.0.0.1:8000/api/analytics-chatbot
1836
  2025-11-17 12:35:24,309 | INFO | access_logger | app.py:20 | Response status: 200
1837
  2025-11-17 12:36:00,652 | INFO | access_logger | app.py:18 | Request: POST http://127.0.0.1:8000/api/analytics-chatbot
1838
+ 2025-11-18 13:35:20,974 | INFO | access_logger | app.py:18 | Request: GET http://127.0.0.1:8000/
1839
+ 2025-11-18 13:35:20,975 | INFO | access_logger | app.py:20 | Response status: 200
1840
+ 2025-11-18 13:35:21,168 | INFO | access_logger | app.py:18 | Request: GET http://127.0.0.1:8000/favicon.ico
1841
+ 2025-11-18 13:35:21,168 | INFO | access_logger | app.py:20 | Response status: 404
1842
+ 2025-11-18 13:35:25,360 | INFO | access_logger | app.py:18 | Request: GET http://127.0.0.1:8000/docs
1843
+ 2025-11-18 13:35:25,361 | INFO | access_logger | app.py:20 | Response status: 200
1844
+ 2025-11-18 13:35:25,537 | INFO | access_logger | app.py:18 | Request: GET http://127.0.0.1:8000/openapi.json
1845
+ 2025-11-18 13:35:25,540 | INFO | access_logger | app.py:20 | Response status: 200
1846
+ 2025-11-18 13:35:49,176 | INFO | access_logger | app.py:18 | Request: POST http://127.0.0.1:8000/api/analytics-chatbot
1847
+ 2025-11-18 13:36:20,855 | INFO | access_logger | app.py:20 | Response status: 200
1848
+ 2025-11-18 13:36:37,986 | INFO | access_logger | app.py:18 | Request: POST http://127.0.0.1:8000/api/analytics-chatbot
1849
+ 2025-11-18 13:36:43,906 | INFO | access_logger | app.py:20 | Response status: 200