Skip to content

Commit 66cf600

Browse files
committed
fix: simplify dump in format_output
1 parent 91871df commit 66cf600

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

workflowai/core/domain/run.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,12 @@ def format_output(self) -> str:
110110
# Format the output string
111111
output: list[str] = []
112112
# In case of partial validation, it is possible that the output is an empty model
113-
if self.output.model_dump():
113+
if dumped_output := self.output.model_dump(mode="json"):
114114
# Use model_dump_json which handles datetime serialization correctly
115-
output_json = self.output.model_dump_json(indent=2)
116115
output += [
117116
"\nOutput:",
118117
"=" * 50,
119-
output_json, # Use the JSON string directly
118+
json.dumps(dumped_output, indent=2),
120119
"=" * 50,
121120
]
122121
if self.tool_call_requests:

0 commit comments

Comments
 (0)