fix UserWarning: Pydantic serializer warning Expected str but got dict

This commit is contained in:
better629 2024-01-15 20:10:39 +08:00
parent 49e7d7eaea
commit 6b52ee3e7c

View file

@ -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