mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-02 14:45:17 +02:00
use pydantic's exclude
This commit is contained in:
parent
11894d12f3
commit
b4207cec92
4 changed files with 17 additions and 49 deletions
|
|
@ -125,15 +125,3 @@ class MGXEnv(Environment, SerializationMixin):
|
|||
|
||||
def __repr__(self):
|
||||
return "MGXEnv()"
|
||||
|
||||
def remove_unserializable(self, data: dict):
|
||||
"""Removes unserializable content from the data dictionary.
|
||||
|
||||
Args:
|
||||
data (dict): The data dictionary to clean, obtained from Pydantic's model_dump method.
|
||||
"""
|
||||
|
||||
roles = data.get("roles", {})
|
||||
|
||||
for role in roles.values():
|
||||
[role.pop(key, None) for key in role.get("unserializable_fields", [])]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue