Skip to content

Commit

Permalink
fix: Strip closing ct:summarized-messages tag
Browse files Browse the repository at this point in the history
  • Loading branch information
whiterabbit1983 committed May 28, 2024
1 parent e2eec7f commit 2dfbe42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion agents-api/agents_api/rec_sum/summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ async def summarize_messages(

assert "<ct:summarized-messages>" in result["content"]
summarized_messages = json.loads(
result["content"].split("<ct:summarized-messages>")[-1].strip()
result["content"]
.split("<ct:summarized-messages>")[-1]
.replace("/<ct:summarized-messages>", "")
.strip()
)

assert all((msg.get("summarizes") is not None for msg in summarized_messages))
Expand Down

0 comments on commit 2dfbe42

Please sign in to comment.