Skip to content

Commit

Permalink
fix: Strip closing ct:trimmed tag
Browse files Browse the repository at this point in the history
  • Loading branch information
whiterabbit1983 committed May 28, 2024
1 parent 7f286dd commit e2eec7f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion agents-api/agents_api/rec_sum/trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ async def trim_messages(
)

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

assert all((msg.get("index") is not None for msg in trimmed_messages))

Expand Down

0 comments on commit e2eec7f

Please sign in to comment.