2024-04-12 01:23:13 +00:00
|
|
|
"""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_ai21 import ChatAI21
|
|
|
|
|
|
|
|
|
2024-05-01 17:12:44 +00:00
|
|
|
class TestAI21J2(ChatModelUnitTests):
|
2024-04-12 01:23:13 +00:00
|
|
|
@pytest.fixture
|
|
|
|
def chat_model_class(self) -> Type[BaseChatModel]:
|
|
|
|
return ChatAI21
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def chat_model_params(self) -> dict:
|
|
|
|
return {
|
|
|
|
"model": "j2-ultra",
|
|
|
|
"api_key": "test_api_key",
|
|
|
|
}
|
2024-05-01 17:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestAI21Jamba(ChatModelUnitTests):
|
|
|
|
@pytest.fixture
|
|
|
|
def chat_model_class(self) -> Type[BaseChatModel]:
|
|
|
|
return ChatAI21
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def chat_model_params(self) -> dict:
|
|
|
|
return {
|
|
|
|
"model": "jamba-instruct",
|
|
|
|
"api_key": "test_api_key",
|
|
|
|
}
|