File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments