File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 3030 FunctionTool ,
3131 MessageInputEntry ,
3232 InputEntries ,
33- ResponseFormatTypedDict ,
3433)
3534
3635from logging import getLogger
@@ -229,9 +228,8 @@ async def prepare_model_request(
229228 elif isinstance (completion_args , CompletionArgs ) and self .output_format :
230229 completion_args .response_format = self .response_format
231230 elif isinstance (completion_args , dict ) and self .output_format :
232- completion_args ["response_format" ] = typing .cast (
233- ResponseFormatTypedDict , self .response_format .model_dump ()
234- )
231+ completion_args = CompletionArgs .model_validate (completion_args )
232+ completion_args .response_format = self .response_format
235233 request_tools = []
236234 if isinstance (tools , list ):
237235 for tool in tools :
You can’t perform that action at this time.
0 commit comments