serialize mgxenv

This commit is contained in:
seehi 2024-08-09 10:34:20 +08:00
parent 98ac5fbce3
commit d98d36fec5

View file

@ -28,9 +28,6 @@ class MGXEnv(Environment):
default_serialization_path: ClassVar[str] = str(SERDESER_PATH / "mgxenv" / "mgxenv.json")
def __repr__(self):
return "MGXEnv()"
def _publish_message(self, message: Message, peekable: bool = True) -> bool:
return super().publish_message(message, peekable)
@ -130,6 +127,9 @@ class MGXEnv(Environment):
converted_msg.content = f"from {sent_from} to {converted_msg.send_to}: {converted_msg.content}"
return converted_msg
def __repr__(self):
return "MGXEnv()"
@handle_exception
def serialize(self, file_path: str = None) -> str:
"""Serializes the current instance to a JSON file.