File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -229,7 +229,6 @@ def render_message(msg: ContextMessage, allow_multipart: bool) -> str | List[dic
229229 return parts [0 ]["text" ]
230230 raise ValueError ("Image content requires multipart support" )
231231
232- multipart = any (m .image for m in input_data .context ) or input_data .image is not None
233232 messages = [{"role" : "system" , "content" : input_data .system_prompt }] if input_data .system_prompt is not None and input_data .system_prompt != "" else []
234233
235234 def merge_messages (messages : List [ContextMessage ]) -> ContextMessage :
@@ -241,9 +240,13 @@ def merge_messages(messages: List[ContextMessage]) -> ContextMessage:
241240 user_input_text = ""
242241 if hasattr (input_data , "text" ):
243242 user_input_text = transform_user_message (input_data .text ) if transform_user_message else input_data .text
243+
244244 user_input_image = None
245+ multipart = any (m .image for m in input_data .context )
245246 if hasattr (input_data , "image" ):
246247 user_input_image = input_data .image
248+ multipart = multipart or input_data .image is not None
249+
247250 user_msg = ContextMessage (role = ContextMessageRole .USER , text = user_input_text , image = user_input_image )
248251
249252 input_data .context .append (user_msg )
You can’t perform that action at this time.
0 commit comments