Skip to content

Commit c6e37bb

Browse files
authored
fix: BadRequestError cohere (#14691)
1 parent e733b61 commit c6e37bb

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

litellm/litellm_core_utils/exception_mapping_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,14 @@ def exception_type( # type: ignore # noqa: PLR0915
14491449
model=model,
14501450
response=getattr(original_exception, "response", None),
14511451
)
1452+
elif "invalid type: parameter" in error_str:
1453+
exception_mapping_worked = True
1454+
raise BadRequestError(
1455+
message=f"CohereException - {original_exception.message}",
1456+
llm_provider="cohere",
1457+
model=model,
1458+
response=getattr(original_exception, "response", None),
1459+
)
14521460
elif "too many tokens" in error_str:
14531461
exception_mapping_worked = True
14541462
raise ContextWindowExceededError(

litellm/model_prices_and_context_window_backup.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,18 @@
296296
"output_cost_per_token": 0.0,
297297
"output_vector_size": 1024
298298
},
299+
"twelvelabs.marengo-embed-2-7-v1:0": {
300+
"input_cost_per_token": 7e-05,
301+
"litellm_provider": "bedrock",
302+
"max_input_tokens": 77,
303+
"max_tokens": 77,
304+
"mode": "embedding",
305+
"output_cost_per_token": 0.0,
306+
"output_vector_size": 1024,
307+
"supports_embedding_image_input": true,
308+
"supports_image_input": true,
309+
"supports_multimodal_embedding": true
310+
},
299311
"amazon.titan-text-express-v1": {
300312
"input_cost_per_token": 1.3e-06,
301313
"litellm_provider": "bedrock",

0 commit comments

Comments
 (0)