mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
add context window exceeded error for anthropic
This commit is contained in:
parent
4b6922918f
commit
509120bf61
4 changed files with 23 additions and 6 deletions
|
@ -113,10 +113,13 @@ class AnthropicLLM:
|
|||
)
|
||||
print_verbose(f"raw model_response: {response.text}")
|
||||
## RESPONSE OBJECT
|
||||
completion_response = response.json()
|
||||
try:
|
||||
completion_response = response.json()
|
||||
except:
|
||||
raise AnthropicError(message=response.text, status_code=response.status_code)
|
||||
if "error" in completion_response:
|
||||
raise AnthropicError(
|
||||
message=completion_response["error"],
|
||||
message=str(completion_response["error"]),
|
||||
status_code=response.status_code,
|
||||
)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue