Skip to content

Commit

Permalink
Update Chat standard tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszOssGit committed Oct 18, 2024
1 parent bc7434d commit 85403f5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions libs/ibm/tests/integration_tests/test_chat_models_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,26 @@
URL = "https://us-south.ml.cloud.ibm.com"

MODEL_ID = "mistralai/mistral-large"
MODEL_ID_IMAGE = "meta-llama/llama-3-2-11b-vision-instruct"


class TestChatWatsonxStandard(ChatModelIntegrationTests):
@property
def chat_model_class(self) -> Type[BaseChatModel]:
return ChatWatsonx

@property
def supports_image_inputs(self) -> bool:
return True

@property
def returns_usage_metadata(self) -> bool:
return True

@property
def has_tool_calling(self) -> bool:
return True

@property
def supported_usage_metadata_details(
self,
Expand Down Expand Up @@ -49,6 +62,12 @@ def chat_model_params(self) -> dict:
"project_id": WX_PROJECT_ID,
}

@pytest.mark.xfail(reason="Supported for vision model.")
def test_image_inputs(self, model: BaseChatModel) -> None:
model.watsonx_model._inference.model_id = MODEL_ID_IMAGE # type: ignore[attr-defined]
super().test_image_inputs(model)
model.watsonx_model._inference.model_id = MODEL_ID # type: ignore[attr-defined]

@pytest.mark.xfail(reason="Not implemented tool_choice as `any`.")
def test_structured_few_shot_examples(self, model: BaseChatModel) -> None:
super().test_structured_few_shot_examples(model)

0 comments on commit 85403f5

Please sign in to comment.