Provide default new_events value when empty.

This commit is contained in:
Toran Bruce Richards
2023-04-30 14:26:36 +12:00
parent 0bea5e38a4
commit d6cb10432b

View File

@@ -67,6 +67,10 @@ def update_running_summary(new_events: List[Dict]) -> str:
if event["role"] == "assistant":
event["role"] = "you"
# This can happen at any point during execturion, not just the beginning
if (len(new_events) == 0):
new_events = "Nothing new happened."
prompt = f'''Your task is to create a concise running summary of actions in the provided text, focusing on key and potentially important information to remember.
You will receive the current summary and the latest development. Combine them, adding relevant key information from the latest development in 1st person past tense and keeping the summary concise.