forked from phoenix/litellm-mirror
fix(utils.py): return optional params from groq
This commit is contained in:
parent
73bfc299f7
commit
a176feeacc
2 changed files with 8 additions and 2 deletions
|
@ -5813,6 +5813,11 @@ def convert_to_model_response_object(
|
|||
if "text" in response_object:
|
||||
model_response_object.text = response_object["text"]
|
||||
|
||||
optional_keys = ["language", "task", "duration", "words", "segments"]
|
||||
for key in optional_keys: # not guaranteed to be in response
|
||||
if key in response_object:
|
||||
setattr(model_response_object, key, response_object[key])
|
||||
|
||||
if hidden_params is not None:
|
||||
model_response_object._hidden_params = hidden_params
|
||||
return model_response_object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue