Update app.py
Browse files
app.py
CHANGED
@@ -100,8 +100,10 @@ async def chat(request: ChatRequest):
|
|
100 |
"parts": [{"text": f"Here is a summary of this conversation so far: {summary_response.text}"}]})
|
101 |
|
102 |
# ------------ rephrase user question ------------
|
103 |
-
rephrase_prompt = f"""
|
|
|
104 |
|
|
|
105 |
- Expand only where necessary to remove vagueness.
|
106 |
- Keep the question natural and concise.
|
107 |
- Avoid adding excessive detail or unrelated context.
|
@@ -117,8 +119,12 @@ async def chat(request: ChatRequest):
|
|
117 |
|
118 |
User: "What does it mean if I see does while buck hunting?"
|
119 |
Refined: "If I see does while hunting for a buck, what does that indicate about deer movement and buck activity?"
|
|
|
|
|
|
|
120 |
|
121 |
-
Now, refine the following user question
|
|
|
122 |
{request.message}
|
123 |
"""
|
124 |
|
|
|
100 |
"parts": [{"text": f"Here is a summary of this conversation so far: {summary_response.text}"}]})
|
101 |
|
102 |
# ------------ rephrase user question ------------
|
103 |
+
rephrase_prompt = f"""Given the user question and the chat history, rewrite the user question to improve clarity, specificity, and retrieval accuracy while
|
104 |
+
maintaining its original intent within the given chat.
|
105 |
|
106 |
+
- Read the chat history
|
107 |
- Expand only where necessary to remove vagueness.
|
108 |
- Keep the question natural and concise.
|
109 |
- Avoid adding excessive detail or unrelated context.
|
|
|
119 |
|
120 |
User: "What does it mean if I see does while buck hunting?"
|
121 |
Refined: "If I see does while hunting for a buck, what does that indicate about deer movement and buck activity?"
|
122 |
+
|
123 |
+
Chat history:
|
124 |
+
{request.chat_history}
|
125 |
|
126 |
+
Now, given the chat history, refine the following user question to improve clarity, specificity, and retrieval accuracy while maintaining its original
|
127 |
+
intent within the given chat:
|
128 |
{request.message}
|
129 |
"""
|
130 |
|