Spaces:
Sleeping
Sleeping
Commit ·
53ca471
1
Parent(s): 076ac50
next commit
Browse files- logs/access.log +10 -0
- src/genai/analytics_chatbot/utils/prompts.py +5 -13
logs/access.log
CHANGED
|
@@ -1457,3 +1457,13 @@
|
|
| 1457 |
2025-10-16 13:15:17,907 | INFO | access_logger | app.py:21 | Response status: 200
|
| 1458 |
2025-10-16 13:15:27,425 | INFO | access_logger | app.py:19 | Request: GET http://127.0.0.1:8000/api/analytics-chatbot?msg=I%20want%20the%20sentiment%20distribution%20of%20muna%20chiya
|
| 1459 |
2025-10-16 13:15:33,062 | INFO | access_logger | app.py:21 | Response status: 200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1457 |
2025-10-16 13:15:17,907 | INFO | access_logger | app.py:21 | Response status: 200
|
| 1458 |
2025-10-16 13:15:27,425 | INFO | access_logger | app.py:19 | Request: GET http://127.0.0.1:8000/api/analytics-chatbot?msg=I%20want%20the%20sentiment%20distribution%20of%20muna%20chiya
|
| 1459 |
2025-10-16 13:15:33,062 | INFO | access_logger | app.py:21 | Response status: 200
|
| 1460 |
+
2025-10-16 13:48:22,608 | INFO | access_logger | app.py:19 | Request: GET http://127.0.0.1:8000/api/analytics-chatbot?msg=I%20want%20the%20sentiment%20distribution%20of%20muna%20chiya
|
| 1461 |
+
2025-10-16 13:48:28,064 | INFO | access_logger | app.py:21 | Response status: 200
|
| 1462 |
+
2025-10-16 13:49:25,014 | INFO | access_logger | app.py:19 | Request: GET http://127.0.0.1:8000/api/analytics-chatbot?msg=now%20i%20want%20of%20divya%20dhakal
|
| 1463 |
+
2025-10-16 13:49:37,675 | INFO | access_logger | app.py:21 | Response status: 200
|
| 1464 |
+
2025-10-16 13:49:56,709 | INFO | access_logger | app.py:19 | Request: GET http://127.0.0.1:8000/api/analytics-chatbot?msg=now%20compare%20both%20of%20them%20in%20weekly%20basis
|
| 1465 |
+
2025-10-16 13:50:01,080 | INFO | access_logger | app.py:21 | Response status: 200
|
| 1466 |
+
2025-10-16 13:51:55,258 | INFO | access_logger | app.py:19 | Request: GET http://127.0.0.1:8000/api/analytics-chatbot?msg=is%20muna%20having%20strong%20engagement%20than%20divya%3F
|
| 1467 |
+
2025-10-16 13:51:59,731 | INFO | access_logger | app.py:21 | Response status: 200
|
| 1468 |
+
2025-10-16 13:59:15,639 | INFO | access_logger | app.py:19 | Request: GET http://127.0.0.1:8000/api/analytics-chatbot?msg=I%20want%20demographics%20analytics%20of%20munachiya
|
| 1469 |
+
2025-10-16 13:59:21,151 | INFO | access_logger | app.py:21 | Response status: 200
|
src/genai/analytics_chatbot/utils/prompts.py
CHANGED
|
@@ -66,21 +66,13 @@ Then the expected output is:
|
|
| 66 |
'''
|
| 67 |
|
| 68 |
fetch_last_message_prompt = '''
|
| 69 |
-
You are
|
| 70 |
-
Your task is to identify and return ONLY the user's most recent message, rewritten as a clear, complete sentence.
|
| 71 |
-
Do not include any other part of the conversation.
|
| 72 |
-
If the last message is incomplete or shorthand, infer the intended full meaning in natural language.
|
| 73 |
-
If there is only one message return it as it is.
|
| 74 |
-
Return only the final message as plain text — no explanations or extra text.
|
| 75 |
|
| 76 |
-
|
| 77 |
-
Conversation history:
|
| 78 |
-
User: I want analytics of divya dhakal.
|
| 79 |
-
AI: Sure, here are the analytics for Divya Dhakal.
|
| 80 |
-
User: Now i want of munachiya
|
| 81 |
|
| 82 |
-
|
| 83 |
-
|
|
|
|
| 84 |
|
| 85 |
'''
|
| 86 |
|
|
|
|
| 66 |
'''
|
| 67 |
|
| 68 |
fetch_last_message_prompt = '''
|
| 69 |
+
You are an expert query extractor and rewriter. You are given the entire conversation history between a user and an AI.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
Your task is to:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
+
1. Identify the user's **most recent query**. You have to grab the latest intention of the user.
|
| 74 |
+
2. Rewrite it as a **complete, grammatically correct sentence**, inferring any missing words, implied subjects, or context from earlier messages.
|
| 75 |
+
3. Return **complete final rewritten user query** as plain text. No explanations, no extra text, no quotes.
|
| 76 |
|
| 77 |
'''
|
| 78 |
|