mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
fix(palm.py): exception mapping bad requests / filtered responses
This commit is contained in:
parent
e1a567a353
commit
e9e86cac79
3 changed files with 24 additions and 7 deletions
|
@ -3445,6 +3445,15 @@ def exception_type(
|
|||
llm_provider="palm",
|
||||
response=original_exception.response
|
||||
)
|
||||
if hasattr(original_exception, "status_code"):
|
||||
if original_exception.status_code == 400:
|
||||
exception_mapping_worked = True
|
||||
raise BadRequestError(
|
||||
message=f"PalmException - {error_str}",
|
||||
model=model,
|
||||
llm_provider="palm",
|
||||
response=original_exception.response
|
||||
)
|
||||
# Dailed: Error occurred: 400 Request payload size exceeds the limit: 20000 bytes
|
||||
elif custom_llm_provider == "cohere": # Cohere
|
||||
if (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue