Skip to content

Commit

Permalink
fix(community summmarizer): add error catch
Browse files Browse the repository at this point in the history
  • Loading branch information
parkererickson-tg committed Sep 3, 2024
1 parent 689e7d5 commit 4e39863
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ async def summarize(self, name: str, text: list[str]) -> CommunitySummary:

# remove iteration tags from name
name = id_pat.sub("", name)
summary = await chain.ainvoke(
{
"entity_name": name,
"description_list": text,
}
)
try:
summary = await chain.ainvoke(
{
"entity_name": name,
"description_list": text,
}
)
except Exception as e:
return "error generating summary: {}".format(e)
return summary.summary

0 comments on commit 4e39863

Please sign in to comment.