Spaces:
Running
Running
darsoarafa
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -154,10 +154,10 @@ async def post_chat(
|
|
154 |
).encode('utf-8')
|
155 |
+ b'\n'
|
156 |
)
|
157 |
-
|
158 |
-
messages = await database.get_messages()
|
159 |
-
|
160 |
-
async with agent.run_stream(prompt
|
161 |
async for text in result.stream(debounce_by=0.01):
|
162 |
# text here is a `str` and the frontend wants
|
163 |
# JSON encoded ModelResponse, so we create one
|
|
|
154 |
).encode('utf-8')
|
155 |
+ b'\n'
|
156 |
)
|
157 |
+
## get the chat history so far to pass as context to the agent
|
158 |
+
#messages = await database.get_messages()
|
159 |
+
## run the agent with the user prompt and the chat history
|
160 |
+
async with agent.run_stream(prompt) as result:
|
161 |
async for text in result.stream(debounce_by=0.01):
|
162 |
# text here is a `str` and the frontend wants
|
163 |
# JSON encoded ModelResponse, so we create one
|