mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
Fixing watsonx error: 'model_id' or 'model' cannot be specified in the request body for models in a deployment space
This commit is contained in:
parent
01af7fe1a8
commit
9d16a3000b
2 changed files with 7 additions and 1 deletions
|
|
@ -272,7 +272,11 @@ class OpenAILikeChatHandler(OpenAILikeBase):
|
|||
)
|
||||
|
||||
data = {
|
||||
"model": model,
|
||||
# watsonx: Deployment models do not support 'model_id' in their payload
|
||||
# https://github.com/BerriAI/litellm/issues/11837
|
||||
"model": None
|
||||
if custom_llm_provider == "watsonx" and model.startswith("deployment/")
|
||||
else model,
|
||||
"messages": messages,
|
||||
**optional_params,
|
||||
**extra_body,
|
||||
|
|
|
|||
|
|
@ -207,6 +207,7 @@ def test_watsonx_deployment_space_id(monkeypatch, watsonx_chat_completion_call,
|
|||
assert mock_post.call_count == 1
|
||||
json_data = json.loads(mock_post.call_args.kwargs["data"])
|
||||
assert my_fake_space_id not in json_data
|
||||
assert json_data.get("model") is None
|
||||
|
||||
|
||||
def test_watsonx_deployment_space_id_embedding(monkeypatch, watsonx_embedding_call):
|
||||
|
|
@ -218,3 +219,4 @@ def test_watsonx_deployment_space_id_embedding(monkeypatch, watsonx_embedding_ca
|
|||
assert mock_post.call_count == 1
|
||||
json_data = json.loads(mock_post.call_args.kwargs["data"])
|
||||
assert my_fake_space_id not in json_data
|
||||
assert json_data.get("model") is None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue