Skip to content

Commit aebe297

Browse files
author
Mateusz
committed
Fixes
1 parent bf1bd77 commit aebe297

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/connectors/qwen_oauth.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,13 +1374,12 @@ async def _chat_completions_canonical(
13741374
elif isinstance(msg, dict):
13751375
content = msg.get("content")
13761376
if isinstance(content, str) and not content.endswith(" /think"):
1377-
# Create a modified ChatMessage object from the dict
1378-
modified_msg_dict = dict(msg)
1379-
modified_msg_dict["content"] = content + " /think"
1380-
# Convert the modified dict to a ChatMessage object
1377+
# Convert the dict to a ChatMessage object with modified content
13811378
from src.core.domain.chat import ChatMessage
13821379

1383-
modified_chat_message = ChatMessage(**modified_msg_dict)
1380+
modified_chat_message = ChatMessage(
1381+
**{**msg, "content": content + " /think"}
1382+
)
13841383
processed_messages[last_client_message_idx] = (
13851384
modified_chat_message
13861385
)

0 commit comments

Comments
 (0)