MCPcopy
hub / github.com/zai-org/Open-AutoGLM / remove_images_from_message

Method remove_images_from_message

phone_agent/model/client.py:261–275  ·  view source on GitHub ↗

Remove image content from a message to save context space. Args: message: Message dictionary. Returns: Message with images removed.

(message: dict[str, Any])

Source from the content-addressed store, hash-verified

259
260 @staticmethod
261 def remove_images_from_message(message: dict[str, Any]) -> dict[str, Any]:
262 """
263 Remove image content from a message to save context space.
264
265 Args:
266 message: Message dictionary.
267
268 Returns:
269 Message with images removed.
270 """
271 if isinstance(message.get("content"), list):
272 message["content"] = [
273 item for item in message["content"] if item.get("type") == "text"
274 ]
275 return message
276
277 @staticmethod
278 def build_screen_info(current_app: str, **extra_info) -> str:

Callers 2

_execute_stepMethod · 0.80
_execute_stepMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected