Skip to content

Commit 46bbf69

Browse files
committed
fix: response format in run context badly set
1 parent 595da24 commit 46bbf69

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/mistralai/extra/run/context.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,8 @@ async def prepare_model_request(
229229
elif isinstance(completion_args, CompletionArgs) and self.output_format:
230230
completion_args.response_format = self.response_format
231231
elif isinstance(completion_args, dict) and self.output_format:
232-
completion_args["response_format"] = typing.cast(
233-
ResponseFormatTypedDict, self.response_format.model_dump()
234-
)
232+
completion_args = CompletionArgs.model_validate(completion_args)
233+
completion_args.response_format = self.response_format
235234
request_tools = []
236235
if isinstance(tools, list):
237236
for tool in tools:

0 commit comments

Comments
 (0)