From 5613dbbafabcd04e18aa55db23268a602d12eb20 Mon Sep 17 00:00:00 2001 From: wujiren Date: Fri, 25 Oct 2024 21:33:12 +0800 Subject: [PATCH] fix error in code formating --- src/agentscope/parsers/json_object_parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/agentscope/parsers/json_object_parser.py b/src/agentscope/parsers/json_object_parser.py index 441af8286..6679943a1 100644 --- a/src/agentscope/parsers/json_object_parser.py +++ b/src/agentscope/parsers/json_object_parser.py @@ -271,7 +271,9 @@ def parse(self, response: ModelResponse) -> ModelResponse: # Requirement checking by Pydantic if self.pydantic_class is not None: try: - response.parsed = dict(self.pydantic_class(**response.parsed)) + response.parsed = self.pydantic_class( + **response.parsed, + ).model_dump() except Exception as e: raise JsonParsingError( message=str(e),