return response headers

This commit is contained in:
Ishaan Jaff 2024-07-20 15:26:44 -07:00
parent 2e9f1e8de2
commit 5e52f50a82
2 changed files with 65 additions and 1 deletions

View file

@ -1059,6 +1059,7 @@ class OpenAIChatCompletion(BaseLLM):
response_object=stringified_response,
model_response_object=model_response,
hidden_params={"headers": headers},
response_headers=headers,
)
except Exception as e:
raise e
@ -1159,6 +1160,7 @@ class OpenAIChatCompletion(BaseLLM):
custom_llm_provider="openai",
logging_obj=logging_obj,
stream_options=data.get("stream_options", None),
response_headers=headers,
)
return streamwrapper
except (
@ -1263,7 +1265,12 @@ class OpenAIChatCompletion(BaseLLM):
additional_args={"complete_input_dict": data},
original_response=stringified_response,
)
return convert_to_model_response_object(response_object=stringified_response, model_response_object=model_response, response_type="embedding") # type: ignore
return convert_to_model_response_object(
response_object=stringified_response,
model_response_object=model_response,
response_type="embedding",
response_headers=headers,
) # type: ignore
except Exception as e:
## LOGGING
logging_obj.post_call(