small fix for better error handling if the summarizer ever fails

- fix #231
This commit is contained in:
Joshua Vial 2023-09-06 15:00:35 +12:00
parent 30a3cc0847
commit 98097005c7
2 changed files with 7 additions and 1 deletions

View file

@ -87,6 +87,8 @@ class ChatSummary:
]
summary = simple_send_with_retries(self.model.name, messages)
if summary is None:
raise ValueError(f"summarizer unexpectedly failed for {self.model.name}")
summary = prompts.summary_prefix + summary
return [dict(role="user", content=summary)]