fix(azure.py): fix raw response dump

This commit is contained in:
Krrish Dholakia 2024-08-27 13:44:38 -07:00
parent 18731cf42b
commit 63adb3f940
2 changed files with 6 additions and 4 deletions

View file

@ -1130,7 +1130,8 @@ class AzureChatCompletion(BaseLLM):
else: else:
azure_client = client azure_client = client
## COMPLETION CALL ## COMPLETION CALL
response = azure_client.embeddings.with_raw_response.create(**data, timeout=timeout) # type: ignore raw_response = azure_client.embeddings.with_raw_response.create(**data, timeout=timeout) # type: ignore
response = raw_response.parse()
## LOGGING ## LOGGING
logging_obj.post_call( logging_obj.post_call(
input=input, input=input,

View file

@ -2126,7 +2126,8 @@ class OpenAITextCompletion(BaseLLM):
openai_client = client openai_client = client
try: try:
response = openai_client.completions.with_raw_response.create(**data) raw_response = openai_client.completions.with_raw_response.create(**data)
response = raw_response.parse()
except Exception as e: except Exception as e:
status_code = getattr(e, "status_code", 500) status_code = getattr(e, "status_code", 500)
error_headers = getattr(e, "headers", None) error_headers = getattr(e, "headers", None)
@ -2170,8 +2171,8 @@ class OpenAITextCompletion(BaseLLM):
else: else:
openai_client = client openai_client = client
response = await openai_client.completions.with_raw_response.create(**data) raw_response = await openai_client.completions.with_raw_response.create(**data)
response = raw_response.parse()
streamwrapper = CustomStreamWrapper( streamwrapper = CustomStreamWrapper(
completion_stream=response, completion_stream=response,
model=model, model=model,