multiple: langchain-standard-tests -> langchain-tests (#28139)

This commit is contained in:
Erick Friis
2024-11-15 11:32:04 -08:00
committed by GitHub
parent 409c7946ac
commit 6d2004ee7d
31 changed files with 315 additions and 253 deletions

View File

@@ -79,8 +79,7 @@ def my_adder(a: int, b: int) -> int:
class ChatModelTests(BaseStandardTests):
@property
@abstractmethod
def chat_model_class(self) -> Type[BaseChatModel]:
...
def chat_model_class(self) -> Type[BaseChatModel]: ...
@property
def chat_model_params(self) -> dict:
@@ -244,17 +243,19 @@ class ChatModelUnitTests(ChatModelTests):
ls_params = model._get_ls_params()
try:
ExpectedParams(**ls_params)
ExpectedParams(**ls_params) # type: ignore
except ValidationErrorV1 as e:
pytest.fail(f"Validation error: {e}")
# Test optional params
model = self.chat_model_class(
max_tokens=10, stop=["test"], **self.chat_model_params
max_tokens=10,
stop=["test"],
**self.chat_model_params, # type: ignore
)
ls_params = model._get_ls_params()
try:
ExpectedParams(**ls_params)
ExpectedParams(**ls_params) # type: ignore
except ValidationErrorV1 as e:
pytest.fail(f"Validation error: {e}")

View File

@@ -13,8 +13,7 @@ from langchain_standard_tests.base import BaseStandardTests
class EmbeddingsTests(BaseStandardTests):
@property
@abstractmethod
def embeddings_class(self) -> Type[Embeddings]:
...
def embeddings_class(self) -> Type[Embeddings]: ...
@property
def embedding_model_params(self) -> dict:

View File

@@ -13,8 +13,7 @@ from langchain_standard_tests.base import BaseStandardTests
class ToolsTests(BaseStandardTests):
@property
@abstractmethod
def tool_constructor(self) -> Union[Type[BaseTool], Callable]:
...
def tool_constructor(self) -> Union[Type[BaseTool], Callable]: ...
@property
def tool_constructor_params(self) -> dict: