mirror of
https://github.com/hwchase17/langchain.git
synced 2025-04-28 11:55:21 +00:00
standard-tests: rename langchain_standard_tests to langchain_tests, release 0.3.2 (#28203)
This commit is contained in:
parent
24eea2e398
commit
0dbaf05bb7
4
.github/workflows/_release.yml
vendored
4
.github/workflows/_release.yml
vendored
@ -219,11 +219,7 @@ jobs:
|
||||
|
||||
# Replace all dashes in the package name with underscores,
|
||||
# since that's how Python imports packages with dashes in the name.
|
||||
if [ "$PKG_NAME" == "langchain-tests" ]; then
|
||||
IMPORT_NAME="langchain_standard_tests"
|
||||
else
|
||||
IMPORT_NAME="$(echo "$PKG_NAME" | sed s/-/_/g)"
|
||||
fi
|
||||
|
||||
poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
|
||||
|
||||
|
@ -15,16 +15,10 @@
|
||||
"First, let's install 2 dependencies:\n",
|
||||
"\n",
|
||||
"- `langchain-core` will define the interfaces we want to import to define our custom tool.\n",
|
||||
"- `langchain-tests==0.3.0` will provide the standard tests we want to use.\n",
|
||||
"- `langchain-tests==0.3.2` will provide the standard tests we want to use.\n",
|
||||
"\n",
|
||||
":::note\n",
|
||||
"\n",
|
||||
"The `langchain-tests` package contains the module `langchain_standard_tests`. This name\n",
|
||||
"mistmatch is due to this package historically being called `langchain_standard_tests` and\n",
|
||||
"the name not being available on PyPi. This will either be reconciled by our \n",
|
||||
"[PEP 541 request](https://github.com/pypi/support/issues/5062) (we welcome upvotes!), \n",
|
||||
"or in a new release of `langchain-tests`.\n",
|
||||
"\n",
|
||||
"Because added tests in new versions of `langchain-tests` will always break your CI/CD pipelines, we recommend pinning the \n",
|
||||
"version of `langchain-tests==0.3.0` to avoid unexpected changes.\n",
|
||||
"\n",
|
||||
@ -91,8 +85,8 @@
|
||||
"\n",
|
||||
"There are 2 namespaces in the `langchain-tests` package: \n",
|
||||
"\n",
|
||||
"- unit tests (`langchain_standard_tests.unit_tests`): designed to be used to test the tool in isolation and without access to external services\n",
|
||||
"- integration tests (`langchain_standard_tests.integration_tests`): designed to be used to test the tool with access to external services (in particular, the external service that the tool is designed to interact with).\n",
|
||||
"- unit tests (`langchain_tests.unit_tests`): designed to be used to test the tool in isolation and without access to external services\n",
|
||||
"- integration tests (`langchain_tests.integration_tests`): designed to be used to test the tool with access to external services (in particular, the external service that the tool is designed to interact with).\n",
|
||||
"\n",
|
||||
":::note\n",
|
||||
"\n",
|
||||
@ -122,7 +116,7 @@
|
||||
"from typing import Type\n",
|
||||
"\n",
|
||||
"from langchain_parrot_link.tools import ParrotMultiplyTool\n",
|
||||
"from langchain_standard_tests.unit_tests import ToolsUnitTests\n",
|
||||
"from langchain_tests.unit_tests import ToolsUnitTests\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class TestParrotMultiplyToolUnit(ToolsUnitTests):\n",
|
||||
@ -156,7 +150,7 @@
|
||||
"from typing import Type\n",
|
||||
"\n",
|
||||
"from langchain_parrot_link.tools import ParrotMultiplyTool\n",
|
||||
"from langchain_standard_tests.integration_tests import ToolsIntegrationTests\n",
|
||||
"from langchain_tests.integration_tests import ToolsIntegrationTests\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class TestParrotMultiplyToolIntegration(ToolsIntegrationTests):\n",
|
||||
@ -217,7 +211,7 @@
|
||||
"from typing import Tuple, Type\n",
|
||||
"\n",
|
||||
"from langchain_parrot_link.chat_models import ChatParrotLink\n",
|
||||
"from langchain_standard_tests.unit_tests import ChatModelUnitTests\n",
|
||||
"from langchain_tests.unit_tests import ChatModelUnitTests\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class TestChatParrotLinkUnit(ChatModelUnitTests):\n",
|
||||
@ -236,7 +230,7 @@
|
||||
"from typing import Type\n",
|
||||
"\n",
|
||||
"from langchain_parrot_link.chat_models import ChatParrotLink\n",
|
||||
"from langchain_standard_tests.integration_tests import ChatModelIntegrationTests\n",
|
||||
"from langchain_tests.integration_tests import ChatModelIntegrationTests\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"class TestChatParrotLinkIntegration(ChatModelIntegrationTests):\n",
|
||||
|
@ -4,7 +4,7 @@ from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests
|
||||
from langchain_tests.integration_tests import ChatModelIntegrationTests
|
||||
|
||||
from langchain_community.chat_models.litellm import ChatLiteLLM
|
||||
|
||||
|
@ -4,7 +4,7 @@ from typing import Type, cast
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests
|
||||
from langchain_tests.integration_tests import ChatModelIntegrationTests
|
||||
from pydantic import SecretStr
|
||||
|
||||
from langchain_community.chat_models.moonshot import MoonshotChat
|
||||
|
@ -2,7 +2,7 @@ from typing import Generator, Tuple
|
||||
|
||||
import pytest
|
||||
from langchain_core.documents import Document
|
||||
from langchain_standard_tests.integration_tests.base_store import BaseStoreSyncTests
|
||||
from langchain_tests.integration_tests.base_store import BaseStoreSyncTests
|
||||
|
||||
from langchain_community.storage.mongodb import MongoDBByteStore, MongoDBStore
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
from langchain_standard_tests.integration_tests.vectorstores import (
|
||||
from langchain_tests.integration_tests.vectorstores import (
|
||||
AsyncReadWriteTestSuite,
|
||||
ReadWriteTestSuite,
|
||||
)
|
||||
|
@ -11,7 +11,7 @@ from langchain_core.messages import (
|
||||
SystemMessage,
|
||||
ToolMessage,
|
||||
)
|
||||
from langchain_standard_tests.unit_tests import ChatModelUnitTests
|
||||
from langchain_tests.unit_tests import ChatModelUnitTests
|
||||
|
||||
from langchain_community.chat_models.cloudflare_workersai import (
|
||||
ChatCloudflareWorkersAI,
|
||||
|
@ -4,7 +4,7 @@ from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests import ChatModelUnitTests
|
||||
from langchain_tests.unit_tests import ChatModelUnitTests
|
||||
|
||||
from langchain_community.chat_models.litellm import ChatLiteLLM
|
||||
|
||||
|
@ -3,7 +3,7 @@ from typing import Any
|
||||
|
||||
import pytest
|
||||
from langchain_core.documents import Document
|
||||
from langchain_standard_tests.integration_tests.vectorstores import (
|
||||
from langchain_tests.integration_tests.vectorstores import (
|
||||
AsyncReadWriteTestSuite,
|
||||
ReadWriteTestSuite,
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
from collections.abc import AsyncGenerator, Generator
|
||||
|
||||
import pytest
|
||||
from langchain_standard_tests.integration_tests.indexer import (
|
||||
from langchain_tests.integration_tests.indexer import (
|
||||
AsyncDocumentIndexTestSuite,
|
||||
DocumentIndexerTestSuite,
|
||||
)
|
||||
|
@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from langchain_standard_tests.integration_tests.base_store import (
|
||||
from langchain_tests.integration_tests.base_store import (
|
||||
BaseStoreAsyncTests,
|
||||
BaseStoreSyncTests,
|
||||
)
|
||||
|
@ -2,7 +2,7 @@ from pathlib import Path
|
||||
from unittest.mock import AsyncMock, Mock
|
||||
|
||||
import pytest
|
||||
from langchain_standard_tests.integration_tests.vectorstores import (
|
||||
from langchain_tests.integration_tests.vectorstores import (
|
||||
AsyncReadWriteTestSuite,
|
||||
ReadWriteTestSuite,
|
||||
)
|
||||
|
@ -5,7 +5,7 @@ from langchain_core.language_models import BaseChatModel
|
||||
from langchain_core.messages import AIMessage
|
||||
from langchain_core.prompts import ChatPromptTemplate
|
||||
from langchain_core.runnables import RunnableConfig
|
||||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests
|
||||
from langchain_tests.integration_tests import ChatModelIntegrationTests
|
||||
from pydantic import BaseModel
|
||||
|
||||
from langchain.chat_models import init_chat_model
|
||||
|
@ -5,7 +5,7 @@ from typing import Dict, List, Literal, Type, cast
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_core.messages import AIMessage
|
||||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests
|
||||
from langchain_tests.integration_tests import ChatModelIntegrationTests
|
||||
|
||||
from langchain_anthropic import ChatAnthropic
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Type
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests import ChatModelUnitTests
|
||||
from langchain_tests.unit_tests import ChatModelUnitTests
|
||||
|
||||
from langchain_anthropic import ChatAnthropic
|
||||
|
||||
|
@ -4,7 +4,7 @@ from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.integration_tests import ( # type: ignore[import-not-found]
|
||||
from langchain_tests.integration_tests import ( # type: ignore[import-not-found]
|
||||
ChatModelIntegrationTests, # type: ignore[import-not-found]
|
||||
)
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Tuple, Type
|
||||
|
||||
from langchain_core.embeddings import Embeddings
|
||||
from langchain_standard_tests.unit_tests.embeddings import EmbeddingsUnitTests
|
||||
from langchain_tests.unit_tests.embeddings import EmbeddingsUnitTests
|
||||
|
||||
from langchain_fireworks import FireworksEmbeddings
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Tuple, Type
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests import ( # type: ignore[import-not-found]
|
||||
from langchain_tests.unit_tests import ( # type: ignore[import-not-found]
|
||||
ChatModelUnitTests, # type: ignore[import-not-found]
|
||||
)
|
||||
|
||||
|
@ -395,7 +395,7 @@ def test_json_mode_structured_output() -> None:
|
||||
|
||||
|
||||
def test_tool_calling_no_arguments() -> None:
|
||||
# Note: this is a variant of a test in langchain_standard_tests
|
||||
# Note: this is a variant of a test in langchain_tests
|
||||
# that as of 2024-08-19 fails with "Failed to call a function. Please
|
||||
# adjust your prompt." when `tool_choice="any"` is specified, but
|
||||
# passes when `tool_choice` is not specified.
|
||||
|
@ -5,7 +5,7 @@ from typing import Optional, Type
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_core.rate_limiters import InMemoryRateLimiter
|
||||
from langchain_standard_tests.integration_tests import (
|
||||
from langchain_tests.integration_tests import (
|
||||
ChatModelIntegrationTests,
|
||||
)
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Type
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests.chat_models import (
|
||||
from langchain_tests.unit_tests.chat_models import (
|
||||
ChatModelUnitTests,
|
||||
)
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
from typing import Type
|
||||
|
||||
from langchain_standard_tests.integration_tests import EmbeddingsIntegrationTests
|
||||
from langchain_tests.integration_tests import EmbeddingsIntegrationTests
|
||||
|
||||
from langchain_huggingface.embeddings import (
|
||||
HuggingFaceEmbeddings,
|
||||
|
@ -4,7 +4,7 @@ from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests
|
||||
from langchain_tests.integration_tests import ChatModelIntegrationTests
|
||||
|
||||
from langchain_huggingface import ChatHuggingFace, HuggingFaceEndpoint
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Optional, Type
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.integration_tests import ( # type: ignore[import-not-found]
|
||||
from langchain_tests.integration_tests import ( # type: ignore[import-not-found]
|
||||
ChatModelIntegrationTests, # type: ignore[import-not-found]
|
||||
)
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Type
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests import ( # type: ignore[import-not-found]
|
||||
from langchain_tests.unit_tests import ( # type: ignore[import-not-found]
|
||||
ChatModelUnitTests, # type: ignore[import-not-found]
|
||||
)
|
||||
|
||||
|
@ -4,7 +4,7 @@ from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests
|
||||
from langchain_tests.integration_tests import ChatModelIntegrationTests
|
||||
|
||||
from langchain_ollama.chat_models import ChatOllama
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
from typing import Type
|
||||
|
||||
from langchain_standard_tests.integration_tests import EmbeddingsIntegrationTests
|
||||
from langchain_tests.integration_tests import EmbeddingsIntegrationTests
|
||||
|
||||
from langchain_ollama.embeddings import OllamaEmbeddings
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
from typing import Dict, Type
|
||||
|
||||
from langchain_standard_tests.unit_tests import ChatModelUnitTests
|
||||
from langchain_tests.unit_tests import ChatModelUnitTests
|
||||
|
||||
from langchain_ollama.chat_models import ChatOllama
|
||||
|
||||
|
@ -5,7 +5,7 @@ from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests
|
||||
from langchain_tests.integration_tests import ChatModelIntegrationTests
|
||||
|
||||
from langchain_openai import AzureChatOpenAI
|
||||
|
||||
|
@ -22,10 +22,8 @@ from langchain_core.messages import (
|
||||
)
|
||||
from langchain_core.outputs import ChatGeneration, ChatResult, LLMResult
|
||||
from langchain_core.prompts import ChatPromptTemplate
|
||||
from langchain_standard_tests.integration_tests.chat_models import (
|
||||
_validate_tool_call_message,
|
||||
)
|
||||
from langchain_standard_tests.integration_tests.chat_models import (
|
||||
from langchain_tests.integration_tests.chat_models import _validate_tool_call_message
|
||||
from langchain_tests.integration_tests.chat_models import (
|
||||
magic_function as invalid_magic_function,
|
||||
)
|
||||
from pydantic import BaseModel, Field
|
||||
@ -1022,7 +1020,8 @@ def test_audio_input_modality() -> None:
|
||||
|
||||
|
||||
def test_prediction_tokens() -> None:
|
||||
code = dedent("""
|
||||
code = dedent(
|
||||
"""
|
||||
/// <summary>
|
||||
/// Represents a user with a first name, last name, and username.
|
||||
/// </summary>
|
||||
@ -1043,7 +1042,8 @@ def test_prediction_tokens() -> None:
|
||||
/// </summary>
|
||||
public string Username { get; set; }
|
||||
}
|
||||
""")
|
||||
"""
|
||||
)
|
||||
|
||||
llm = ChatOpenAI(model="gpt-4o")
|
||||
query = (
|
||||
|
@ -5,7 +5,7 @@ from typing import Dict, List, Literal, Type, cast
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_core.messages import AIMessage
|
||||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests
|
||||
from langchain_tests.integration_tests import ChatModelIntegrationTests
|
||||
|
||||
from langchain_openai import ChatOpenAI
|
||||
|
||||
|
@ -4,7 +4,7 @@ from typing import Tuple, Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests import ChatModelUnitTests
|
||||
from langchain_tests.unit_tests import ChatModelUnitTests
|
||||
|
||||
from langchain_openai import AzureChatOpenAI
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Tuple, Type
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests import ChatModelUnitTests
|
||||
from langchain_tests.unit_tests import ChatModelUnitTests
|
||||
|
||||
from langchain_openai import ChatOpenAI
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
from typing import Tuple, Type
|
||||
|
||||
from langchain_core.embeddings import Embeddings
|
||||
from langchain_standard_tests.unit_tests.embeddings import EmbeddingsUnitTests
|
||||
from langchain_tests.unit_tests.embeddings import EmbeddingsUnitTests
|
||||
|
||||
from langchain_openai import AzureOpenAIEmbeddings
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Tuple, Type
|
||||
|
||||
from langchain_core.embeddings import Embeddings
|
||||
from langchain_standard_tests.unit_tests.embeddings import EmbeddingsUnitTests
|
||||
from langchain_tests.unit_tests.embeddings import EmbeddingsUnitTests
|
||||
|
||||
from langchain_openai import OpenAIEmbeddings
|
||||
|
||||
|
@ -5,7 +5,7 @@ from typing import Optional, Type
|
||||
import pytest # type: ignore[import-not-found]
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_core.rate_limiters import InMemoryRateLimiter
|
||||
from langchain_standard_tests.integration_tests import ( # type: ignore[import-not-found]
|
||||
from langchain_tests.integration_tests import ( # type: ignore[import-not-found]
|
||||
ChatModelIntegrationTests, # type: ignore[import-not-found]
|
||||
)
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
from typing import Tuple, Type
|
||||
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests import ( # type: ignore[import-not-found]
|
||||
from langchain_tests.unit_tests import ( # type: ignore[import-not-found]
|
||||
ChatModelUnitTests, # type: ignore[import-not-found]
|
||||
)
|
||||
|
||||
|
@ -25,7 +25,7 @@ PYTHON_FILES=.
|
||||
MYPY_CACHE=.mypy_cache
|
||||
lint format: PYTHON_FILES=.
|
||||
lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/standard-tests --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$')
|
||||
lint_package: PYTHON_FILES=langchain_standard_tests
|
||||
lint_package: PYTHON_FILES=langchain_tests
|
||||
lint_tests: PYTHON_FILES=tests
|
||||
lint_tests: MYPY_CACHE=.mypy_cache_test
|
||||
|
||||
@ -44,7 +44,7 @@ spell_check:
|
||||
spell_fix:
|
||||
poetry run codespell --toml pyproject.toml -w
|
||||
|
||||
check_imports: $(shell find langchain_standard_tests -name '*.py')
|
||||
check_imports: $(shell find langchain_tests -name '*.py')
|
||||
poetry run python ./scripts/check_imports.py $^
|
||||
|
||||
######################
|
||||
|
@ -40,7 +40,7 @@ from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.unit_tests import ChatModelUnitTests
|
||||
from langchain_tests.unit_tests import ChatModelUnitTests
|
||||
|
||||
from langchain_parrot_chain import ChatParrotChain
|
||||
|
||||
@ -60,7 +60,7 @@ from typing import Type
|
||||
|
||||
import pytest
|
||||
from langchain_core.language_models import BaseChatModel
|
||||
from langchain_standard_tests.integration_tests import ChatModelIntegrationTests
|
||||
from langchain_tests.integration_tests import ChatModelIntegrationTests
|
||||
|
||||
from langchain_parrot_chain import ChatParrotChain
|
||||
|
||||
|
@ -13,7 +13,7 @@ class BaseStandardTests(ABC):
|
||||
def explore_bases(cls: Type) -> None:
|
||||
nonlocal comparison_class
|
||||
for base in cls.__bases__:
|
||||
if base.__module__.startswith("langchain_standard_tests."):
|
||||
if base.__module__.startswith("langchain_tests."):
|
||||
if comparison_class is None:
|
||||
comparison_class = base
|
||||
else:
|
@ -14,9 +14,7 @@ modules = [
|
||||
]
|
||||
|
||||
for module in modules:
|
||||
pytest.register_assert_rewrite(
|
||||
f"langchain_standard_tests.integration_tests.{module}"
|
||||
)
|
||||
pytest.register_assert_rewrite(f"langchain_tests.integration_tests.{module}")
|
||||
|
||||
from .base_store import BaseStoreAsyncTests, BaseStoreSyncTests
|
||||
from .cache import AsyncCacheTestSuite, SyncCacheTestSuite
|
@ -4,7 +4,7 @@ from typing import AsyncGenerator, Generator, Generic, Tuple, TypeVar
|
||||
import pytest
|
||||
from langchain_core.stores import BaseStore
|
||||
|
||||
from langchain_standard_tests.base import BaseStandardTests
|
||||
from langchain_tests.base import BaseStandardTests
|
||||
|
||||
V = TypeVar("V")
|
||||
|
@ -4,7 +4,7 @@ import pytest
|
||||
from langchain_core.caches import BaseCache
|
||||
from langchain_core.outputs import Generation
|
||||
|
||||
from langchain_standard_tests.base import BaseStandardTests
|
||||
from langchain_tests.base import BaseStandardTests
|
||||
|
||||
|
||||
class SyncCacheTestSuite(BaseStandardTests):
|
@ -21,11 +21,11 @@ from pydantic import BaseModel, Field
|
||||
from pydantic.v1 import BaseModel as BaseModelV1
|
||||
from pydantic.v1 import Field as FieldV1
|
||||
|
||||
from langchain_standard_tests.unit_tests.chat_models import (
|
||||
from langchain_tests.unit_tests.chat_models import (
|
||||
ChatModelTests,
|
||||
my_adder_tool,
|
||||
)
|
||||
from langchain_standard_tests.utils.pydantic import PYDANTIC_MAJOR_VERSION
|
||||
from langchain_tests.utils.pydantic import PYDANTIC_MAJOR_VERSION
|
||||
|
||||
|
||||
class MagicFunctionSchema(BaseModel):
|
@ -2,7 +2,7 @@ from typing import List
|
||||
|
||||
from langchain_core.embeddings import Embeddings
|
||||
|
||||
from langchain_standard_tests.unit_tests.embeddings import EmbeddingsTests
|
||||
from langchain_tests.unit_tests.embeddings import EmbeddingsTests
|
||||
|
||||
|
||||
class EmbeddingsIntegrationTests(EmbeddingsTests):
|
@ -1,7 +1,7 @@
|
||||
from langchain_core.messages import ToolCall
|
||||
from langchain_core.tools import BaseTool
|
||||
|
||||
from langchain_standard_tests.unit_tests.tools import ToolsTests
|
||||
from langchain_tests.unit_tests.tools import ToolsTests
|
||||
|
||||
|
||||
class ToolsIntegrationTests(ToolsTests):
|
@ -7,7 +7,7 @@ from langchain_core.documents import Document
|
||||
from langchain_core.embeddings.fake import DeterministicFakeEmbedding, Embeddings
|
||||
from langchain_core.vectorstores import VectorStore
|
||||
|
||||
from langchain_standard_tests.base import BaseStandardTests
|
||||
from langchain_tests.base import BaseStandardTests
|
||||
|
||||
# Arbitrarily chosen. Using a small embedding size
|
||||
# so tests are faster and easier to debug.
|
@ -11,7 +11,7 @@ modules = [
|
||||
]
|
||||
|
||||
for module in modules:
|
||||
pytest.register_assert_rewrite(f"langchain_standard_tests.unit_tests.{module}")
|
||||
pytest.register_assert_rewrite(f"langchain_tests.unit_tests.{module}")
|
||||
|
||||
from .chat_models import ChatModelUnitTests
|
||||
from .embeddings import EmbeddingsUnitTests
|
@ -22,8 +22,8 @@ from pydantic.v1 import (
|
||||
)
|
||||
from syrupy import SnapshotAssertion
|
||||
|
||||
from langchain_standard_tests.base import BaseStandardTests
|
||||
from langchain_standard_tests.utils.pydantic import PYDANTIC_MAJOR_VERSION
|
||||
from langchain_tests.base import BaseStandardTests
|
||||
from langchain_tests.utils.pydantic import PYDANTIC_MAJOR_VERSION
|
||||
|
||||
|
||||
class Person(BaseModel): # Used by some dependent tests. Should be deprecated.
|
@ -7,7 +7,7 @@ import pytest
|
||||
from langchain_core.embeddings import Embeddings
|
||||
from pydantic import SecretStr
|
||||
|
||||
from langchain_standard_tests.base import BaseStandardTests
|
||||
from langchain_tests.base import BaseStandardTests
|
||||
|
||||
|
||||
class EmbeddingsTests(BaseStandardTests):
|
@ -7,7 +7,7 @@ import pytest
|
||||
from langchain_core.tools import BaseTool
|
||||
from pydantic import SecretStr
|
||||
|
||||
from langchain_standard_tests.base import BaseStandardTests
|
||||
from langchain_tests.base import BaseStandardTests
|
||||
|
||||
|
||||
class ToolsTests(BaseStandardTests):
|
@ -4,8 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.poetry]
|
||||
name = "langchain-tests"
|
||||
packages = [{ include = "langchain_standard_tests" }]
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
description = "Standard tests for LangChain implementations"
|
||||
authors = ["Erick Friis <erick@langchain.dev>"]
|
||||
readme = "README.md"
|
||||
|
@ -5,7 +5,7 @@ from typing import Tuple
|
||||
import pytest
|
||||
from langchain_core.stores import InMemoryStore
|
||||
|
||||
from langchain_standard_tests.integration_tests.base_store import (
|
||||
from langchain_tests.integration_tests.base_store import (
|
||||
BaseStoreAsyncTests,
|
||||
BaseStoreSyncTests,
|
||||
)
|
||||
|
@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
from langchain_core.caches import InMemoryCache
|
||||
|
||||
from langchain_standard_tests.integration_tests.cache import (
|
||||
from langchain_tests.integration_tests.cache import (
|
||||
AsyncCacheTestSuite,
|
||||
SyncCacheTestSuite,
|
||||
)
|
||||
|
@ -4,7 +4,7 @@ from langchain_core.vectorstores import (
|
||||
VectorStore,
|
||||
)
|
||||
|
||||
from langchain_standard_tests.integration_tests.vectorstores import (
|
||||
from langchain_tests.integration_tests.vectorstores import (
|
||||
AsyncReadWriteTestSuite,
|
||||
ReadWriteTestSuite,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user