Update app.py
Browse files
app.py
CHANGED
|
@@ -229,6 +229,14 @@ Question: %s
|
|
| 229 |
|
| 230 |
Document:
|
| 231 |
""" % message
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
#[Wait for user's document]
|
| 233 |
|
| 234 |
# Create the agent
|
|
@@ -260,7 +268,9 @@ Document:
|
|
| 260 |
|
| 261 |
# Get the response stream
|
| 262 |
stream = agent.get_chat_response(
|
| 263 |
-
retriever_system
|
|
|
|
|
|
|
| 264 |
llm_sampling_settings=settings,
|
| 265 |
chat_history=messages,
|
| 266 |
returns_streaming_generator=True,
|
|
|
|
| 229 |
|
| 230 |
Document:
|
| 231 |
""" % message
|
| 232 |
+
retriever_system="""
|
| 233 |
+
You are an AI assistant that answers questions based on documents.
|
| 234 |
+
|
| 235 |
+
%s
|
| 236 |
+
|
| 237 |
+
Question: %s
|
| 238 |
+
Answer:
|
| 239 |
+
""" % (text,message)
|
| 240 |
#[Wait for user's document]
|
| 241 |
|
| 242 |
# Create the agent
|
|
|
|
| 268 |
|
| 269 |
# Get the response stream
|
| 270 |
stream = agent.get_chat_response(
|
| 271 |
+
retriever_system,
|
| 272 |
+
#retriever_system+text,
|
| 273 |
+
#retriever_system+text,
|
| 274 |
llm_sampling_settings=settings,
|
| 275 |
chat_history=messages,
|
| 276 |
returns_streaming_generator=True,
|