mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 10:14:26 +00:00
Merge 260875e61d
into b82af5b826
This commit is contained in:
commit
e3334e6cc9
1 changed files with 14 additions and 0 deletions
|
@ -426,6 +426,13 @@ class OpenAIChatCompletion(BaseLLM, BaseOpenAILLM):
|
|||
else:
|
||||
headers = {}
|
||||
response = raw_response.parse()
|
||||
|
||||
if isinstance(response, str):
|
||||
raise OpenAIError(
|
||||
status_code=422,
|
||||
message="Could not parse response",
|
||||
)
|
||||
|
||||
return headers, response
|
||||
except openai.APITimeoutError as e:
|
||||
end_time = time.time()
|
||||
|
@ -459,6 +466,13 @@ class OpenAIChatCompletion(BaseLLM, BaseOpenAILLM):
|
|||
else:
|
||||
headers = {}
|
||||
response = raw_response.parse()
|
||||
|
||||
if isinstance(response, str):
|
||||
raise OpenAIError(
|
||||
status_code=422,
|
||||
message="Could not parse response",
|
||||
)
|
||||
|
||||
return headers, response
|
||||
except Exception as e:
|
||||
if raw_response is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue