Spaces:
Configuration error
Configuration error
Download openhands/events/action/message.py from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 976 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/openhands/events/action/message.py
- Command line
-
hf download hf://spaces/flyingdarkdev/README/openhands/events/action/message.py
-
curl -L -o message.py https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/openhands/events/action/message.py
976 Bytes
| from dataclasses import dataclass | |
| from openhands.core.schema import ActionType | |
| from openhands.events.action.action import Action, ActionSecurityRisk | |
| class MessageAction(Action): | |
| content: str | |
| image_urls: list[str] | None = None | |
| wait_for_response: bool = False | |
| action: str = ActionType.MESSAGE | |
| security_risk: ActionSecurityRisk | None = None | |
| def message(self) -> str: | |
| return self.content | |
| def images_urls(self) -> list[str] | None: | |
| # Deprecated alias for backward compatibility | |
| return self.image_urls | |
| def images_urls(self, value: list[str] | None) -> None: | |
| self.image_urls = value | |
| def __str__(self) -> str: | |
| ret = f'**MessageAction** (source={self.source})\n' | |
| ret += f'CONTENT: {self.content}' | |
| if self.image_urls: | |
| for url in self.image_urls: | |
| ret += f'\nIMAGE_URL: {url}' | |
| return ret | |