Update app.py
Browse files
app.py
CHANGED
@@ -93,7 +93,7 @@ async def chat(request: ChatRequest):
|
|
93 |
system_instruction=["You are a helpful assistant who is an expert at summarization."]
|
94 |
),
|
95 |
)
|
96 |
-
request.chat_history = request.chat_history[-(summary_thresh+
|
97 |
request.chat_history.insert(1,
|
98 |
{"role": "user",
|
99 |
"parts": [{"text": f"Here is a summary of this conversation so far: {summary_response.text}"}]})
|
|
|
93 |
system_instruction=["You are a helpful assistant who is an expert at summarization."]
|
94 |
),
|
95 |
)
|
96 |
+
request.chat_history = request.chat_history[-(summary_thresh+2):] # keep last k items
|
97 |
request.chat_history.insert(1,
|
98 |
{"role": "user",
|
99 |
"parts": [{"text": f"Here is a summary of this conversation so far: {summary_response.text}"}]})
|