Skip to content

Commit

Permalink
fix error in code formating
Browse files Browse the repository at this point in the history
  • Loading branch information
wujiren committed Oct 25, 2024
1 parent 1c26592 commit 5613dbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/agentscope/parsers/json_object_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 5613dbb

Please sign in to comment.