MCPcopy Create free account
hub / github.com/HKUDS/AutoAgent / clean_msg

Function clean_msg

evaluation/utils.py:363–379  ·  view source on GitHub ↗
(msg: List[Dict[str, Any]])

Source from the content-addressed store, hash-verified

361 return False # the port is not available
362
363def clean_msg(msg: List[Dict[str, Any]]):
364 new_msg = []
365 for m in msg:
366 msg_content = m['content']
367 if isinstance(msg_content, str):
368 m['content'] = msg_content
369 new_msg.append(m.copy())
370 elif isinstance(msg_content, List):
371 new_content = []
372 for c in msg_content:
373 if c['type'] == 'text':
374 new_content.append(c.copy())
375 elif c['type'] == 'image_url':
376 new_content.append({'type': 'image_url', 'image_url': 'placeholder'})
377 m['content'] = new_content
378 new_msg.append(m.copy())
379 return new_msg

Callers 1

process_instanceFunction · 0.90

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected