|
| 1 | +"""Standard LangChain interface tests""" |
| 2 | + |
| 3 | +from typing import Type |
| 4 | + |
| 5 | +import pytest |
| 6 | +from langchain_core.language_models import BaseChatModel |
| 7 | +from langchain_standard_tests.integration_tests import ChatModelIntegrationTests |
| 8 | + |
| 9 | +from langchain_aws.chat_models.bedrock import ChatBedrock |
| 10 | + |
| 11 | + |
| 12 | +class TestBedrockStandard(ChatModelIntegrationTests): |
| 13 | + @pytest.fixture |
| 14 | + def chat_model_class(self) -> Type[BaseChatModel]: |
| 15 | + return ChatBedrock |
| 16 | + |
| 17 | + @pytest.fixture |
| 18 | + def chat_model_params(self) -> dict: |
| 19 | + return { |
| 20 | + "model_id": "anthropic.claude-3-sonnet-20240229-v1:0", |
| 21 | + } |
| 22 | + |
| 23 | + @pytest.mark.xfail(reason="Not implemented.") |
| 24 | + def test_usage_metadata( |
| 25 | + self, |
| 26 | + chat_model_class: Type[BaseChatModel], |
| 27 | + chat_model_params: dict, |
| 28 | + ) -> None: |
| 29 | + super().test_usage_metadata( |
| 30 | + chat_model_class, |
| 31 | + chat_model_params, |
| 32 | + ) |
| 33 | + |
| 34 | + @pytest.mark.xfail(reason="Not implemented.") |
| 35 | + def test_stop_sequence( |
| 36 | + self, |
| 37 | + chat_model_class: Type[BaseChatModel], |
| 38 | + chat_model_params: dict, |
| 39 | + ) -> None: |
| 40 | + super().test_stop_sequence( |
| 41 | + chat_model_class, |
| 42 | + chat_model_params, |
| 43 | + ) |
| 44 | + |
| 45 | + @pytest.mark.xfail(reason="Not yet implemented.") |
| 46 | + def test_tool_message_histories_string_content( |
| 47 | + self, |
| 48 | + chat_model_class: Type[BaseChatModel], |
| 49 | + chat_model_params: dict, |
| 50 | + chat_model_has_tool_calling: bool, |
| 51 | + ) -> None: |
| 52 | + super().test_tool_message_histories_string_content( |
| 53 | + chat_model_class, chat_model_params, chat_model_has_tool_calling |
| 54 | + ) |
| 55 | + |
| 56 | + @pytest.mark.xfail(reason="Not yet implemented.") |
| 57 | + def test_tool_message_histories_list_content( |
| 58 | + self, |
| 59 | + chat_model_class: Type[BaseChatModel], |
| 60 | + chat_model_params: dict, |
| 61 | + chat_model_has_tool_calling: bool, |
| 62 | + ) -> None: |
| 63 | + super().test_tool_message_histories_list_content( |
| 64 | + chat_model_class, chat_model_params, chat_model_has_tool_calling |
| 65 | + ) |
| 66 | + |
| 67 | + @pytest.mark.xfail(reason="Not yet implemented.") |
| 68 | + def test_structured_few_shot_examples( |
| 69 | + self, |
| 70 | + chat_model_class: Type[BaseChatModel], |
| 71 | + chat_model_params: dict, |
| 72 | + chat_model_has_tool_calling: bool, |
| 73 | + ) -> None: |
| 74 | + super().test_structured_few_shot_examples( |
| 75 | + chat_model_class, chat_model_params, chat_model_has_tool_calling |
| 76 | + ) |
0 commit comments