File tree 1 file changed +10
-3
lines changed 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ def _get_completion_inputs(
447
447
llm_request: The LlmRequest to convert.
448
448
449
449
Returns:
450
- The litellm inputs (message list and tool dictionary).
450
+ The litellm inputs (message list, tool dictionary and response format ).
451
451
"""
452
452
messages = []
453
453
for content in llm_request .contents or []:
@@ -476,7 +476,13 @@ def _get_completion_inputs(
476
476
_function_declaration_to_tool_param (tool )
477
477
for tool in llm_request .config .tools [0 ].function_declarations
478
478
]
479
- return messages , tools
479
+
480
+ response_format = None
481
+
482
+ if llm_request .config .response_schema :
483
+ response_format = llm_request .config .response_schema
484
+
485
+ return messages , tools , response_format
480
486
481
487
482
488
def _build_function_declaration_log (
@@ -613,12 +619,13 @@ async def generate_content_async(
613
619
self ._maybe_append_user_content (llm_request )
614
620
logger .info (_build_request_log (llm_request ))
615
621
616
- messages , tools = _get_completion_inputs (llm_request )
622
+ messages , tools , response_format = _get_completion_inputs (llm_request )
617
623
618
624
completion_args = {
619
625
"model" : self .model ,
620
626
"messages" : messages ,
621
627
"tools" : tools ,
628
+ "response_format" : response_format ,
622
629
}
623
630
completion_args .update (self ._additional_args )
624
631
You can’t perform that action at this time.
0 commit comments