Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

fix UserWarning: Pydantic serializer warning Expected str but got dict

better6296b52ee3e7c2a
diff --git a/metagpt/schema.py b/metagpt/schema.py
index 853a9c6bb..c0f867831 100644
--- a/metagpt/schema.py
+++ b/metagpt/schema.py
@@ -212,7 +212,7 @@ class Message(BaseModel):
return any_to_str_set(send_to if send_to else {MESSAGE_ROUTE_TO_ALL})
@field_serializer("instruct_content", mode="plain")
- def ser_instruct_content(self, ic: BaseModel) -> Union[str, None]:
+ def ser_instruct_content(self, ic: BaseModel) -> Union[dict, None]:
ic_dict = None
if ic:
# compatible with custom-defined ActionOutput