mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(utils.py): return additional kwargs from openai-like response body
Closes https://github.com/BerriAI/litellm/issues/4981
This commit is contained in:
parent
bd68714f51
commit
09ee8c6e2d
2 changed files with 70 additions and 19 deletions
|
@ -5859,6 +5859,11 @@ def convert_to_model_response_object(
|
|||
if _response_headers is not None:
|
||||
model_response_object._response_headers = _response_headers
|
||||
|
||||
special_keys = litellm.ModelResponse.model_fields.keys()
|
||||
for k, v in response_object.items():
|
||||
if k not in special_keys:
|
||||
setattr(model_response_object, k, v)
|
||||
|
||||
return model_response_object
|
||||
elif response_type == "embedding" and (
|
||||
model_response_object is None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue