Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 6c07434

Browse files
authored
fix: copy the whole message content when doing normalization (#818)
When using tools like openiterpreter, messages come with extra keys apart from content and role, like "tool_calls". With this normalization they were stripped and the tool was broken Closes: #812
1 parent 14a8ac5 commit 6c07434

File tree

1 file changed

+1
-2
lines changed
  • src/codegate/providers/normalizer

1 file changed

+1
-2
lines changed

src/codegate/providers/normalizer/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ def _normalize_content_messages(self, data: Dict) -> Dict:
2323
messages = normalized_data["messages"]
2424
converted_messages = []
2525
for msg in messages:
26-
role = msg.get("role", "")
26+
new_msg = msg.copy()
2727
content = msg.get("content", "")
28-
new_msg = {"role": role, "content": content}
2928
if isinstance(content, list):
3029
# Convert list format to string
3130
content_parts = []

0 commit comments

Comments
 (0)