From 6b52ee3e7c2a6d78c9552d3bb3b1e67fbbb1486f Mon Sep 17 00:00:00 2001 From: better629 Date: Mon, 15 Jan 2024 20:10:39 +0800 Subject: [PATCH] fix UserWarning: Pydantic serializer warning Expected str but got dict --- metagpt/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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