generated from langchain-ai/integration-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from langchain-ai/cc/standard_tests
add standard tests
- Loading branch information
Showing
4 changed files
with
143 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
libs/aws/tests/integration_tests/chat_models/test_standard.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
"""Standard LangChain interface tests""" | ||
|
||
from typing import Type | ||
|
||
import pytest | ||
from langchain_core.language_models import BaseChatModel | ||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests | ||
|
||
from langchain_aws.chat_models.bedrock import ChatBedrock | ||
|
||
|
||
class TestBedrockStandard(ChatModelIntegrationTests): | ||
@pytest.fixture | ||
def chat_model_class(self) -> Type[BaseChatModel]: | ||
return ChatBedrock | ||
|
||
@pytest.fixture | ||
def chat_model_params(self) -> dict: | ||
return { | ||
"model_id": "anthropic.claude-3-sonnet-20240229-v1:0", | ||
} | ||
|
||
@pytest.mark.xfail(reason="Not implemented.") | ||
def test_usage_metadata( | ||
self, | ||
chat_model_class: Type[BaseChatModel], | ||
chat_model_params: dict, | ||
) -> None: | ||
super().test_usage_metadata( | ||
chat_model_class, | ||
chat_model_params, | ||
) | ||
|
||
@pytest.mark.xfail(reason="Not implemented.") | ||
def test_stop_sequence( | ||
self, | ||
chat_model_class: Type[BaseChatModel], | ||
chat_model_params: dict, | ||
) -> None: | ||
super().test_stop_sequence( | ||
chat_model_class, | ||
chat_model_params, | ||
) | ||
|
||
@pytest.mark.xfail(reason="Not yet implemented.") | ||
def test_tool_message_histories_string_content( | ||
self, | ||
chat_model_class: Type[BaseChatModel], | ||
chat_model_params: dict, | ||
chat_model_has_tool_calling: bool, | ||
) -> None: | ||
super().test_tool_message_histories_string_content( | ||
chat_model_class, chat_model_params, chat_model_has_tool_calling | ||
) | ||
|
||
@pytest.mark.xfail(reason="Not yet implemented.") | ||
def test_tool_message_histories_list_content( | ||
self, | ||
chat_model_class: Type[BaseChatModel], | ||
chat_model_params: dict, | ||
chat_model_has_tool_calling: bool, | ||
) -> None: | ||
super().test_tool_message_histories_list_content( | ||
chat_model_class, chat_model_params, chat_model_has_tool_calling | ||
) | ||
|
||
@pytest.mark.xfail(reason="Not yet implemented.") | ||
def test_structured_few_shot_examples( | ||
self, | ||
chat_model_class: Type[BaseChatModel], | ||
chat_model_params: dict, | ||
chat_model_has_tool_calling: bool, | ||
) -> None: | ||
super().test_structured_few_shot_examples( | ||
chat_model_class, chat_model_params, chat_model_has_tool_calling | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""Standard LangChain interface tests""" | ||
|
||
from typing import Type | ||
|
||
import pytest | ||
from langchain_core.language_models import BaseChatModel | ||
from langchain_standard_tests.unit_tests import ChatModelUnitTests | ||
|
||
from langchain_aws.chat_models.bedrock import ChatBedrock | ||
|
||
|
||
class TestBedrockStandard(ChatModelUnitTests): | ||
@pytest.fixture | ||
def chat_model_class(self) -> Type[BaseChatModel]: | ||
return ChatBedrock | ||
|
||
@pytest.fixture | ||
def chat_model_params(self) -> dict: | ||
return { | ||
"model_id": "anthropic.claude-3-sonnet-20240229-v1:0", | ||
"region_name": "us-east-1", | ||
} | ||
|
||
@pytest.mark.xfail(reason="Not implemented.") | ||
def test_chat_model_init_api_key( | ||
self, | ||
chat_model_class: Type[BaseChatModel], | ||
chat_model_params: dict, | ||
) -> None: | ||
super().test_chat_model_init_api_key( | ||
chat_model_class, | ||
chat_model_params, | ||
) | ||
|
||
@pytest.mark.xfail(reason="Not implemented.") | ||
def test_standard_params( | ||
self, | ||
chat_model_class: Type[BaseChatModel], | ||
chat_model_params: dict, | ||
) -> None: | ||
super().test_standard_params( | ||
chat_model_class, | ||
chat_model_params, | ||
) |