diff --git a/.github/scripts/prep_api_docs_build.py b/.github/scripts/prep_api_docs_build.py index 2c2655e2155a4..0ddd7ac053de5 100644 --- a/.github/scripts/prep_api_docs_build.py +++ b/.github/scripts/prep_api_docs_build.py @@ -11,7 +11,9 @@ def load_packages_yaml() -> Dict[str, Any]: """Load and parse the packages.yml file.""" with open("langchain/libs/packages.yml", "r") as f: - return yaml.safe_load(f) + all_packages = yaml.safe_load(f) + + return {k: v for k, v in all_packages.items() if k["repo"]} def get_target_dir(package_name: str) -> Path: @@ -23,24 +25,19 @@ def get_target_dir(package_name: str) -> Path: return base_path / "partners" / package_name_short -def clean_target_directories(packages: Dict[str, Any]) -> None: +def clean_target_directories(packages: list) -> None: """Remove old directories that will be replaced.""" - for package in packages["packages"]: - if package["repo"] != "langchain-ai/langchain": - target_dir = get_target_dir(package["name"]) - if target_dir.exists(): - print(f"Removing {target_dir}") - shutil.rmtree(target_dir) + for package in packages: + + target_dir = get_target_dir(package["name"]) + if target_dir.exists(): + print(f"Removing {target_dir}") + shutil.rmtree(target_dir) -def move_libraries(packages: Dict[str, Any]) -> None: +def move_libraries(packages: list) -> None: """Move libraries from their source locations to the target directories.""" - for package in packages["packages"]: - # Skip if it's the main langchain repo or disabled - if package["repo"] == "langchain-ai/langchain" or package.get( - "disabled", False - ): - continue + for package in packages: repo_name = package["repo"].split("/")[1] source_path = package["path"] @@ -68,7 +65,14 @@ def main(): """Main function to orchestrate the library sync process.""" try: # Load packages configuration - packages = load_packages_yaml() + package_yaml = load_packages_yaml() + packages = [ + p + for p in package_yaml["packages"] + if not p.get("disabled", False) + and p["repo"].startswith("langchain-ai/") + and p["repo"] != "langchain-ai/langchain" + ] # Clean target directories clean_target_directories(packages) diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 6dcbfcda11043..bf0c1e0454f20 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -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 + IMPORT_NAME="$(echo "$PKG_NAME" | sed s/-/_/g)" poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))" diff --git a/.github/workflows/api_doc_build.yml b/.github/workflows/api_doc_build.yml index 26e2b19cb4602..959f35a94bd37 100644 --- a/.github/workflows/api_doc_build.yml +++ b/.github/workflows/api_doc_build.yml @@ -37,9 +37,9 @@ jobs: # Get unique repositories REPOS=$(echo "$REPOS_UNSORTED" | sort -u) - # Checkout each unique repository + # Checkout each unique repository that is in langchain-ai org for repo in $REPOS; do - if [ "$repo" != "langchain-ai/langchain" ]; then + if [[ "$repo" != "langchain-ai/langchain" && "$repo" == langchain-ai/* ]]; then REPO_NAME=$(echo $repo | cut -d'/' -f2) echo "Checking out $repo to $REPO_NAME" git clone --depth 1 https://github.com/$repo.git $REPO_NAME diff --git a/docs/docs/contributing/how_to/index.mdx b/docs/docs/contributing/how_to/index.mdx index e4eda7ddbc1d8..d9f903f4156d6 100644 --- a/docs/docs/contributing/how_to/index.mdx +++ b/docs/docs/contributing/how_to/index.mdx @@ -2,4 +2,8 @@ - [**Documentation**](documentation/index.mdx): Help improve our docs, including this one! - [**Code**](code/index.mdx): Help us write code, fix bugs, or improve our infrastructure. -- [**Integrations**](integrations/index.mdx): Help us integrate with your favorite vendors and tools. \ No newline at end of file + +## Integrations + +- [**Start Here**](integrations/index.mdx): Help us integrate with your favorite vendors and tools. +- [**Standard Tests**](integrations/standard_tests): Ensure your integration passes an expected set of tests. diff --git a/docs/docs/contributing/how_to/integrations/community.mdx b/docs/docs/contributing/how_to/integrations/community.mdx index a33ae002cd0d4..c7c3dadef917e 100644 --- a/docs/docs/contributing/how_to/integrations/community.mdx +++ b/docs/docs/contributing/how_to/integrations/community.mdx @@ -1,13 +1,11 @@ -## How to add a community integration (deprecated guide) +## How to add a community integration (not recommended) :::danger -We are no longer accepting new community integrations. Please see the -[main integration guide](./index.mdx) for more information on contributing new -integrations. +We recommend following the [main integration guide](./index.mdx) to add new integrations instead. -Note that `langchain-community` is **not** deprecated. Only -the process for adding new community integrations is deprecated. +If you follow this guide, there is a high likelihood we will close your PR with the above +guide linked without much discussion. ::: diff --git a/docs/docs/contributing/how_to/integrations/index.mdx b/docs/docs/contributing/how_to/integrations/index.mdx index 5f08dce43606e..159f4ac4e999b 100644 --- a/docs/docs/contributing/how_to/integrations/index.mdx +++ b/docs/docs/contributing/how_to/integrations/index.mdx @@ -65,10 +65,10 @@ that will render on this site (https://python.langchain.com/). As a prerequisite to adding your integration to our documentation, you must: -1. Confirm that your integration is in the list of components we are currently accepting. +1. Confirm that your integration is in the [list of components](#components-to-integrate) we are currently accepting. 2. Ensure that your integration is in a separate package that can be installed with `pip install `. -3. Implement the standard tests for your integration and successfully run them. -3. Write documentation for your integration in the `docs/docs/integrations` directory of the LangChain monorepo. +3. [Implement the standard tests](/docs/contributing/how_to/integrations/standard_tests) for your integration and successfully run them. +3. Write documentation for your integration in the `docs/docs/integrations/` directory of the LangChain monorepo. 4. Add a provider page for your integration in the `docs/docs/integrations/providers` directory of the LangChain monorepo. Once you have completed these steps, you can submit a PR to the LangChain monorepo to add your integration to the documentation. diff --git a/docs/docs/contributing/how_to/integrations/standard_tests.ipynb b/docs/docs/contributing/how_to/integrations/standard_tests.ipynb index c741a76077304..4607fc83c2147 100644 --- a/docs/docs/contributing/how_to/integrations/standard_tests.ipynb +++ b/docs/docs/contributing/how_to/integrations/standard_tests.ipynb @@ -6,27 +6,19 @@ "source": [ "# How to add standard tests to an integration\n", "\n", - "Implementing standard tests \n", - "\n", - "When creating either a custom class for yourself or a new tool to publish in a LangChain integration, it is important to add standard tests to ensure it works as expected. This guide will show you how to add standard tests to a tool, and the templates for implementing each different kind of integration are linked [at the bottom](#standard-test-templates-per-component).\n", + "When creating either a custom class for yourself or a new tool to publish in a LangChain integration, it is important to add standard tests to ensure it works as expected. This guide will show you how to add standard tests to a tool, and you can **[Skip to the test templates](#standard-test-templates-per-component)** for implementing tests for each integration.\n", "\n", "## Setup\n", "\n", "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", + "version of `langchain-tests==0.3.2` to avoid unexpected changes.\n", "\n", ":::" ] @@ -37,7 +29,7 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install -U langchain-core langchain-tests==0.3.0 pytest pytest-socket" + "%pip install -U langchain-core langchain-tests==0.3.2 pytest pytest-socket" ] }, { @@ -91,8 +83,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 +114,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 +148,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,13 +209,17 @@ "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", " @property\n", " def chat_model_class(self) -> Type[ChatParrotLink]:\n", - " return ChatParrotLink" + " return ChatParrotLink\n", + "\n", + " @property\n", + " def chat_model_params(self) -> dict:\n", + " return {\"model\": \"bird-brain-001\", \"temperature\": 0}" ] }, { @@ -236,7 +232,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", @@ -254,22 +250,54 @@ "metadata": {}, "source": [ "\n", - "\n", - "
\n", - "Work in progress:\n", "
\n", - " Retrievers\n", - " TODO" + " Embedding Models" ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": null, "metadata": {}, + "outputs": [], "source": [ - "
\n", - "
\n", - " Vector Stores\n", - " TODO" + "# title=\"tests/unit_tests/test_embeddings.py\"\n", + "from typing import Tuple, Type\n", + "\n", + "from langchain_parrot_link.embeddings import ParrotLinkEmbeddings\n", + "from langchain_standard_tests.unit_tests import EmbeddingsUnitTests\n", + "\n", + "\n", + "class TestParrotLinkEmbeddingsUnit(EmbeddingsUnitTests):\n", + " @property\n", + " def embeddings_class(self) -> Type[ParrotLinkEmbeddings]:\n", + " return ParrotLinkEmbeddings\n", + "\n", + " @property\n", + " def embedding_model_params(self) -> dict:\n", + " return {\"model\": \"nest-embed-001\", \"temperature\": 0}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# title=\"tests/integration_tests/test_embeddings.py\"\n", + "from typing import Type\n", + "\n", + "from langchain_parrot_link.embeddings import ParrotLinkEmbeddings\n", + "from langchain_standard_tests.integration_tests import EmbeddingsIntegrationTests\n", + "\n", + "\n", + "class TestParrotLinkEmbeddingsIntegration(EmbeddingsIntegrationTests):\n", + " @property\n", + " def embeddings_class(self) -> Type[ParrotLinkEmbeddings]:\n", + " return ParrotLinkEmbeddings\n", + "\n", + " @property\n", + " def embedding_model_params(self) -> dict:\n", + " return {\"model\": \"nest-embed-001\", \"temperature\": 0}" ] }, { @@ -278,16 +306,83 @@ "source": [ "
\n", "
\n", - " Embedding Models\n", - " TODO" + " Tools/Toolkits\n", + " Note: The standard tests for tools/toolkits are implemented in the example in the main body of this guide too." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# title=\"tests/unit_tests/test_tools.py\"\n", + "from typing import Type\n", + "\n", + "from langchain_parrot_link.tools import ParrotMultiplyTool\n", + "from langchain_standard_tests.unit_tests import ToolsUnitTests\n", + "\n", + "\n", + "class TestParrotMultiplyToolUnit(ToolsUnitTests):\n", + " @property\n", + " def tool_constructor(self) -> Type[ParrotMultiplyTool]:\n", + " return ParrotMultiplyTool\n", + "\n", + " def tool_constructor_params(self) -> dict:\n", + " # if your tool constructor instead required initialization arguments like\n", + " # `def __init__(self, some_arg: int):`, you would return those here\n", + " # as a dictionary, e.g.: `return {'some_arg': 42}`\n", + " return {}\n", + "\n", + " def tool_invoke_params_example(self) -> dict:\n", + " \"\"\"\n", + " Returns a dictionary representing the \"args\" of an example tool call.\n", + "\n", + " This should NOT be a ToolCall dict - i.e. it should not\n", + " have {\"name\", \"id\", \"args\"} keys.\n", + " \"\"\"\n", + " return {\"a\": 2, \"b\": 3}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# title=\"tests/integration_tests/test_tools.py\"\n", + "from typing import Type\n", + "\n", + "from langchain_parrot_link.tools import ParrotMultiplyTool\n", + "from langchain_standard_tests.integration_tests import ToolsIntegrationTests\n", + "\n", + "\n", + "class TestParrotMultiplyToolIntegration(ToolsIntegrationTests):\n", + " @property\n", + " def tool_constructor(self) -> Type[ParrotMultiplyTool]:\n", + " return ParrotMultiplyTool\n", + "\n", + " def tool_constructor_params(self) -> dict:\n", + " # if your tool constructor instead required initialization arguments like\n", + " # `def __init__(self, some_arg: int):`, you would return those here\n", + " # as a dictionary, e.g.: `return {'some_arg': 42}`\n", + " return {}\n", + "\n", + " def tool_invoke_params_example(self) -> dict:\n", + " \"\"\"\n", + " Returns a dictionary representing the \"args\" of an example tool call.\n", + "\n", + " This should NOT be a ToolCall dict - i.e. it should not\n", + " have {\"name\", \"id\", \"args\"} keys.\n", + " \"\"\"\n", + " return {\"a\": 2, \"b\": 3}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "
\n", - "
" + "" ] } ], diff --git a/docs/docs/contributing/index.mdx b/docs/docs/contributing/index.mdx index 67930710585dc..d2c1231789d8d 100644 --- a/docs/docs/contributing/index.mdx +++ b/docs/docs/contributing/index.mdx @@ -17,6 +17,7 @@ More coming soon! We are working on tutorials to help you make your first contri - [**Documentation**](how_to/documentation/index.mdx): Help improve our docs, including this one! - [**Code**](how_to/code/index.mdx): Help us write code, fix bugs, or improve our infrastructure. - [**Integrations**](how_to/integrations/index.mdx): Help us integrate with your favorite vendors and tools. +- [**Standard Tests**](how_to/integrations/standard_tests): Ensure your integration passes an expected set of tests. ## Reference diff --git a/libs/community/tests/integration_tests/chat_models/test_litellm_standard.py b/libs/community/tests/integration_tests/chat_models/test_litellm_standard.py index 972617617bd4c..5e87e3ac8a0e2 100644 --- a/libs/community/tests/integration_tests/chat_models/test_litellm_standard.py +++ b/libs/community/tests/integration_tests/chat_models/test_litellm_standard.py @@ -4,7 +4,7 @@ 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 diff --git a/libs/community/tests/integration_tests/chat_models/test_moonshot.py b/libs/community/tests/integration_tests/chat_models/test_moonshot.py index 68d9f43b5d8f0..de4725cfa6c8e 100644 --- a/libs/community/tests/integration_tests/chat_models/test_moonshot.py +++ b/libs/community/tests/integration_tests/chat_models/test_moonshot.py @@ -4,7 +4,7 @@ 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 diff --git a/libs/community/tests/integration_tests/storage/test_mongodb.py b/libs/community/tests/integration_tests/storage/test_mongodb.py index 850e4f73c2b47..82aa4b76057f3 100644 --- a/libs/community/tests/integration_tests/storage/test_mongodb.py +++ b/libs/community/tests/integration_tests/storage/test_mongodb.py @@ -2,7 +2,7 @@ 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 diff --git a/libs/community/tests/integration_tests/vectorstores/test_aperturedb.py b/libs/community/tests/integration_tests/vectorstores/test_aperturedb.py index 9e5f370d7d4cb..15d65de90b136 100644 --- a/libs/community/tests/integration_tests/vectorstores/test_aperturedb.py +++ b/libs/community/tests/integration_tests/vectorstores/test_aperturedb.py @@ -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, ) diff --git a/libs/community/tests/unit_tests/chat_models/test_cloudflare_workersai.py b/libs/community/tests/unit_tests/chat_models/test_cloudflare_workersai.py index 940616048de02..0f0fabe3cd1e5 100644 --- a/libs/community/tests/unit_tests/chat_models/test_cloudflare_workersai.py +++ b/libs/community/tests/unit_tests/chat_models/test_cloudflare_workersai.py @@ -11,7 +11,7 @@ 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, diff --git a/libs/community/tests/unit_tests/chat_models/test_litellm.py b/libs/community/tests/unit_tests/chat_models/test_litellm.py index 583c53d64bd1d..1d11fe5bd3f0a 100644 --- a/libs/community/tests/unit_tests/chat_models/test_litellm.py +++ b/libs/community/tests/unit_tests/chat_models/test_litellm.py @@ -4,7 +4,7 @@ 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 diff --git a/libs/community/tests/unit_tests/vectorstores/test_inmemory.py b/libs/community/tests/unit_tests/vectorstores/test_inmemory.py index 6facca3429b2a..b650cda14fdd1 100644 --- a/libs/community/tests/unit_tests/vectorstores/test_inmemory.py +++ b/libs/community/tests/unit_tests/vectorstores/test_inmemory.py @@ -3,7 +3,7 @@ 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, ) diff --git a/libs/core/langchain_core/sys_info.py b/libs/core/langchain_core/sys_info.py index f70df1f631864..532b4e63802ed 100644 --- a/libs/core/langchain_core/sys_info.py +++ b/libs/core/langchain_core/sys_info.py @@ -47,7 +47,6 @@ def print_sys_info(*, additional_pkgs: Sequence[str] = ()) -> None: # Packages that do not start with "langchain" prefix. other_langchain_packages = [ "langserve", - "langgraph", "langsmith", ] @@ -55,8 +54,17 @@ def print_sys_info(*, additional_pkgs: Sequence[str] = ()) -> None: name for _, name, _ in pkgutil.iter_modules() if name.startswith("langchain") ] + langgraph_pkgs = [ + name for _, name, _ in pkgutil.iter_modules() if name.startswith("langgraph") + ] + all_packages = sorted( - set(langchain_pkgs + other_langchain_packages + list(additional_pkgs)) + set( + langchain_pkgs + + langgraph_pkgs + + other_langchain_packages + + list(additional_pkgs) + ) ) # Always surface these packages to the top diff --git a/libs/core/tests/unit_tests/indexing/test_in_memory_indexer.py b/libs/core/tests/unit_tests/indexing/test_in_memory_indexer.py index 6ddeefc62330b..58ee2514644dd 100644 --- a/libs/core/tests/unit_tests/indexing/test_in_memory_indexer.py +++ b/libs/core/tests/unit_tests/indexing/test_in_memory_indexer.py @@ -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, ) diff --git a/libs/core/tests/unit_tests/stores/test_in_memory.py b/libs/core/tests/unit_tests/stores/test_in_memory.py index 3c5f810b1fc6a..1ae91db4a385e 100644 --- a/libs/core/tests/unit_tests/stores/test_in_memory.py +++ b/libs/core/tests/unit_tests/stores/test_in_memory.py @@ -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, ) diff --git a/libs/core/tests/unit_tests/vectorstores/test_in_memory.py b/libs/core/tests/unit_tests/vectorstores/test_in_memory.py index 1ab6186882639..34764f99c1016 100644 --- a/libs/core/tests/unit_tests/vectorstores/test_in_memory.py +++ b/libs/core/tests/unit_tests/vectorstores/test_in_memory.py @@ -2,7 +2,7 @@ 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, ) diff --git a/libs/langchain/tests/integration_tests/chat_models/test_base.py b/libs/langchain/tests/integration_tests/chat_models/test_base.py index efed6e1d52290..baee018999c28 100644 --- a/libs/langchain/tests/integration_tests/chat_models/test_base.py +++ b/libs/langchain/tests/integration_tests/chat_models/test_base.py @@ -5,7 +5,7 @@ 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 diff --git a/libs/partners/anthropic/tests/integration_tests/test_standard.py b/libs/partners/anthropic/tests/integration_tests/test_standard.py index 241588f32a34c..dc69c1dda4034 100644 --- a/libs/partners/anthropic/tests/integration_tests/test_standard.py +++ b/libs/partners/anthropic/tests/integration_tests/test_standard.py @@ -5,7 +5,7 @@ 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 diff --git a/libs/partners/anthropic/tests/unit_tests/test_standard.py b/libs/partners/anthropic/tests/unit_tests/test_standard.py index 7976dcb2bc9cf..7879e2995bb8e 100644 --- a/libs/partners/anthropic/tests/unit_tests/test_standard.py +++ b/libs/partners/anthropic/tests/unit_tests/test_standard.py @@ -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 diff --git a/libs/partners/fireworks/tests/integration_tests/test_standard.py b/libs/partners/fireworks/tests/integration_tests/test_standard.py index cfefb2445e6a3..692dcb40cf357 100644 --- a/libs/partners/fireworks/tests/integration_tests/test_standard.py +++ b/libs/partners/fireworks/tests/integration_tests/test_standard.py @@ -4,7 +4,7 @@ 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] ) diff --git a/libs/partners/fireworks/tests/unit_tests/test_embeddings_standard.py b/libs/partners/fireworks/tests/unit_tests/test_embeddings_standard.py index ea8d16f92d0a8..44b6197a39181 100644 --- a/libs/partners/fireworks/tests/unit_tests/test_embeddings_standard.py +++ b/libs/partners/fireworks/tests/unit_tests/test_embeddings_standard.py @@ -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 diff --git a/libs/partners/fireworks/tests/unit_tests/test_standard.py b/libs/partners/fireworks/tests/unit_tests/test_standard.py index 61d0d152ba831..4f444897154a8 100644 --- a/libs/partners/fireworks/tests/unit_tests/test_standard.py +++ b/libs/partners/fireworks/tests/unit_tests/test_standard.py @@ -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] ) diff --git a/libs/partners/groq/tests/integration_tests/test_chat_models.py b/libs/partners/groq/tests/integration_tests/test_chat_models.py index 1b2cf05b54239..a672de34bc53e 100644 --- a/libs/partners/groq/tests/integration_tests/test_chat_models.py +++ b/libs/partners/groq/tests/integration_tests/test_chat_models.py @@ -395,7 +395,7 @@ class Joke(BaseModel): 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. diff --git a/libs/partners/groq/tests/integration_tests/test_standard.py b/libs/partners/groq/tests/integration_tests/test_standard.py index d34257b4c529e..3870ae953f6ee 100644 --- a/libs/partners/groq/tests/integration_tests/test_standard.py +++ b/libs/partners/groq/tests/integration_tests/test_standard.py @@ -5,7 +5,7 @@ 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, ) diff --git a/libs/partners/groq/tests/unit_tests/test_standard.py b/libs/partners/groq/tests/unit_tests/test_standard.py index 939d817499e25..e4df2916f3052 100644 --- a/libs/partners/groq/tests/unit_tests/test_standard.py +++ b/libs/partners/groq/tests/unit_tests/test_standard.py @@ -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, ) diff --git a/libs/partners/huggingface/tests/integration_tests/test_embeddings_standard.py b/libs/partners/huggingface/tests/integration_tests/test_embeddings_standard.py index 4f5cefcbdff2c..a878bea8cfa8a 100644 --- a/libs/partners/huggingface/tests/integration_tests/test_embeddings_standard.py +++ b/libs/partners/huggingface/tests/integration_tests/test_embeddings_standard.py @@ -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, diff --git a/libs/partners/huggingface/tests/integration_tests/test_standard.py b/libs/partners/huggingface/tests/integration_tests/test_standard.py index 34392e979f437..682a4c625ee9f 100644 --- a/libs/partners/huggingface/tests/integration_tests/test_standard.py +++ b/libs/partners/huggingface/tests/integration_tests/test_standard.py @@ -4,7 +4,7 @@ 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 diff --git a/libs/partners/mistralai/tests/integration_tests/test_standard.py b/libs/partners/mistralai/tests/integration_tests/test_standard.py index cea6399ee4cd8..822f2284abc1c 100644 --- a/libs/partners/mistralai/tests/integration_tests/test_standard.py +++ b/libs/partners/mistralai/tests/integration_tests/test_standard.py @@ -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] ) diff --git a/libs/partners/mistralai/tests/unit_tests/test_standard.py b/libs/partners/mistralai/tests/unit_tests/test_standard.py index 408a6e5a6b9f8..fde82de2d5071 100644 --- a/libs/partners/mistralai/tests/unit_tests/test_standard.py +++ b/libs/partners/mistralai/tests/unit_tests/test_standard.py @@ -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] ) diff --git a/libs/partners/ollama/tests/integration_tests/test_chat_models.py b/libs/partners/ollama/tests/integration_tests/test_chat_models.py index 10ffcb39d2777..9133106cae7b9 100644 --- a/libs/partners/ollama/tests/integration_tests/test_chat_models.py +++ b/libs/partners/ollama/tests/integration_tests/test_chat_models.py @@ -4,7 +4,7 @@ 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 diff --git a/libs/partners/ollama/tests/integration_tests/test_embeddings.py b/libs/partners/ollama/tests/integration_tests/test_embeddings.py index 26722362e6b66..0953510c901aa 100644 --- a/libs/partners/ollama/tests/integration_tests/test_embeddings.py +++ b/libs/partners/ollama/tests/integration_tests/test_embeddings.py @@ -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 diff --git a/libs/partners/ollama/tests/unit_tests/test_chat_models.py b/libs/partners/ollama/tests/unit_tests/test_chat_models.py index d086914310489..850e3423e0bf9 100644 --- a/libs/partners/ollama/tests/unit_tests/test_chat_models.py +++ b/libs/partners/ollama/tests/unit_tests/test_chat_models.py @@ -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 diff --git a/libs/partners/openai/tests/integration_tests/chat_models/test_azure_standard.py b/libs/partners/openai/tests/integration_tests/chat_models/test_azure_standard.py index c99bfb1126e22..fff0599963c2f 100644 --- a/libs/partners/openai/tests/integration_tests/chat_models/test_azure_standard.py +++ b/libs/partners/openai/tests/integration_tests/chat_models/test_azure_standard.py @@ -5,7 +5,7 @@ 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 diff --git a/libs/partners/openai/tests/integration_tests/chat_models/test_base.py b/libs/partners/openai/tests/integration_tests/chat_models/test_base.py index 858ab1e4b4321..cbee0d7041850 100644 --- a/libs/partners/openai/tests/integration_tests/chat_models/test_base.py +++ b/libs/partners/openai/tests/integration_tests/chat_models/test_base.py @@ -22,10 +22,8 @@ ) 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( + """ /// /// Represents a user with a first name, last name, and username. /// @@ -1043,7 +1042,8 @@ def test_prediction_tokens() -> None: /// public string Username { get; set; } } - """) + """ + ) llm = ChatOpenAI(model="gpt-4o") query = ( diff --git a/libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py b/libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py index b021603aace41..890e70268085f 100644 --- a/libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py +++ b/libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py @@ -5,7 +5,7 @@ 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 diff --git a/libs/partners/openai/tests/unit_tests/chat_models/test_azure_standard.py b/libs/partners/openai/tests/unit_tests/chat_models/test_azure_standard.py index 465c1dc0c22a5..3d1faa97db485 100644 --- a/libs/partners/openai/tests/unit_tests/chat_models/test_azure_standard.py +++ b/libs/partners/openai/tests/unit_tests/chat_models/test_azure_standard.py @@ -4,7 +4,7 @@ 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 diff --git a/libs/partners/openai/tests/unit_tests/chat_models/test_base_standard.py b/libs/partners/openai/tests/unit_tests/chat_models/test_base_standard.py index 8049da874cbf3..d24ddd1e71f7e 100644 --- a/libs/partners/openai/tests/unit_tests/chat_models/test_base_standard.py +++ b/libs/partners/openai/tests/unit_tests/chat_models/test_base_standard.py @@ -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 diff --git a/libs/partners/openai/tests/unit_tests/embeddings/test_azure_standard.py b/libs/partners/openai/tests/unit_tests/embeddings/test_azure_standard.py index b5f1591c476ca..a972fe5e38581 100644 --- a/libs/partners/openai/tests/unit_tests/embeddings/test_azure_standard.py +++ b/libs/partners/openai/tests/unit_tests/embeddings/test_azure_standard.py @@ -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 diff --git a/libs/partners/openai/tests/unit_tests/embeddings/test_base_standard.py b/libs/partners/openai/tests/unit_tests/embeddings/test_base_standard.py index b265e5600eb35..b1b2f2d368fa9 100644 --- a/libs/partners/openai/tests/unit_tests/embeddings/test_base_standard.py +++ b/libs/partners/openai/tests/unit_tests/embeddings/test_base_standard.py @@ -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 diff --git a/libs/partners/xai/tests/integration_tests/test_chat_models_standard.py b/libs/partners/xai/tests/integration_tests/test_chat_models_standard.py index c686f7e19486c..1152fe44946f7 100644 --- a/libs/partners/xai/tests/integration_tests/test_chat_models_standard.py +++ b/libs/partners/xai/tests/integration_tests/test_chat_models_standard.py @@ -5,7 +5,7 @@ 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] ) diff --git a/libs/partners/xai/tests/unit_tests/test_chat_models_standard.py b/libs/partners/xai/tests/unit_tests/test_chat_models_standard.py index a0d6a5170a8d6..a70718f3224a2 100644 --- a/libs/partners/xai/tests/unit_tests/test_chat_models_standard.py +++ b/libs/partners/xai/tests/unit_tests/test_chat_models_standard.py @@ -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] ) diff --git a/libs/standard-tests/Makefile b/libs/standard-tests/Makefile index a48f80928b993..5283db9a9dc43 100644 --- a/libs/standard-tests/Makefile +++ b/libs/standard-tests/Makefile @@ -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 $^ ###################### diff --git a/libs/standard-tests/README.md b/libs/standard-tests/README.md index 0060203a1e2be..029a9bafb76da 100644 --- a/libs/standard-tests/README.md +++ b/libs/standard-tests/README.md @@ -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 diff --git a/libs/standard-tests/langchain_standard_tests/__init__.py b/libs/standard-tests/langchain_tests/__init__.py similarity index 100% rename from libs/standard-tests/langchain_standard_tests/__init__.py rename to libs/standard-tests/langchain_tests/__init__.py diff --git a/libs/standard-tests/langchain_standard_tests/base.py b/libs/standard-tests/langchain_tests/base.py similarity index 96% rename from libs/standard-tests/langchain_standard_tests/base.py rename to libs/standard-tests/langchain_tests/base.py index e9f71802737ba..f2b7ca1f7e92d 100644 --- a/libs/standard-tests/langchain_standard_tests/base.py +++ b/libs/standard-tests/langchain_tests/base.py @@ -13,7 +13,7 @@ def test_no_overrides_DO_NOT_OVERRIDE(self) -> None: 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: diff --git a/libs/standard-tests/langchain_standard_tests/integration_tests/__init__.py b/libs/standard-tests/langchain_tests/integration_tests/__init__.py similarity index 90% rename from libs/standard-tests/langchain_standard_tests/integration_tests/__init__.py rename to libs/standard-tests/langchain_tests/integration_tests/__init__.py index ec26de72a4a7e..67ccb38f29e94 100644 --- a/libs/standard-tests/langchain_standard_tests/integration_tests/__init__.py +++ b/libs/standard-tests/langchain_tests/integration_tests/__init__.py @@ -14,9 +14,7 @@ ] 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 diff --git a/libs/standard-tests/langchain_standard_tests/integration_tests/base_store.py b/libs/standard-tests/langchain_tests/integration_tests/base_store.py similarity index 99% rename from libs/standard-tests/langchain_standard_tests/integration_tests/base_store.py rename to libs/standard-tests/langchain_tests/integration_tests/base_store.py index e4b461d98227a..cc5fab8bcf7a4 100644 --- a/libs/standard-tests/langchain_standard_tests/integration_tests/base_store.py +++ b/libs/standard-tests/langchain_tests/integration_tests/base_store.py @@ -4,7 +4,7 @@ import pytest from langchain_core.stores import BaseStore -from langchain_standard_tests.base import BaseStandardTests +from langchain_tests.base import BaseStandardTests V = TypeVar("V") diff --git a/libs/standard-tests/langchain_standard_tests/integration_tests/cache.py b/libs/standard-tests/langchain_tests/integration_tests/cache.py similarity index 99% rename from libs/standard-tests/langchain_standard_tests/integration_tests/cache.py rename to libs/standard-tests/langchain_tests/integration_tests/cache.py index 7d1359f5154ec..7087da8ea07b3 100644 --- a/libs/standard-tests/langchain_standard_tests/integration_tests/cache.py +++ b/libs/standard-tests/langchain_tests/integration_tests/cache.py @@ -4,7 +4,7 @@ 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): diff --git a/libs/standard-tests/langchain_standard_tests/integration_tests/chat_models.py b/libs/standard-tests/langchain_tests/integration_tests/chat_models.py similarity index 99% rename from libs/standard-tests/langchain_standard_tests/integration_tests/chat_models.py rename to libs/standard-tests/langchain_tests/integration_tests/chat_models.py index 9eea91aebbe44..f0ac13d461443 100644 --- a/libs/standard-tests/langchain_standard_tests/integration_tests/chat_models.py +++ b/libs/standard-tests/langchain_tests/integration_tests/chat_models.py @@ -21,11 +21,11 @@ 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): diff --git a/libs/standard-tests/langchain_standard_tests/integration_tests/embeddings.py b/libs/standard-tests/langchain_tests/integration_tests/embeddings.py similarity index 96% rename from libs/standard-tests/langchain_standard_tests/integration_tests/embeddings.py rename to libs/standard-tests/langchain_tests/integration_tests/embeddings.py index 1de2aece78023..7e3689d0f5429 100644 --- a/libs/standard-tests/langchain_standard_tests/integration_tests/embeddings.py +++ b/libs/standard-tests/langchain_tests/integration_tests/embeddings.py @@ -2,7 +2,7 @@ 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): diff --git a/libs/standard-tests/langchain_standard_tests/integration_tests/indexer.py b/libs/standard-tests/langchain_tests/integration_tests/indexer.py similarity index 100% rename from libs/standard-tests/langchain_standard_tests/integration_tests/indexer.py rename to libs/standard-tests/langchain_tests/integration_tests/indexer.py diff --git a/libs/standard-tests/langchain_standard_tests/integration_tests/tools.py b/libs/standard-tests/langchain_tests/integration_tests/tools.py similarity index 97% rename from libs/standard-tests/langchain_standard_tests/integration_tests/tools.py rename to libs/standard-tests/langchain_tests/integration_tests/tools.py index ad854c3b1d41d..2609a87c84521 100644 --- a/libs/standard-tests/langchain_standard_tests/integration_tests/tools.py +++ b/libs/standard-tests/langchain_tests/integration_tests/tools.py @@ -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): diff --git a/libs/standard-tests/langchain_standard_tests/integration_tests/vectorstores.py b/libs/standard-tests/langchain_tests/integration_tests/vectorstores.py similarity index 99% rename from libs/standard-tests/langchain_standard_tests/integration_tests/vectorstores.py rename to libs/standard-tests/langchain_tests/integration_tests/vectorstores.py index d7735cfdd2bcf..08b0358dcfb9e 100644 --- a/libs/standard-tests/langchain_standard_tests/integration_tests/vectorstores.py +++ b/libs/standard-tests/langchain_tests/integration_tests/vectorstores.py @@ -7,7 +7,7 @@ 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. diff --git a/libs/standard-tests/langchain_standard_tests/py.typed b/libs/standard-tests/langchain_tests/py.typed similarity index 100% rename from libs/standard-tests/langchain_standard_tests/py.typed rename to libs/standard-tests/langchain_tests/py.typed diff --git a/libs/standard-tests/langchain_standard_tests/unit_tests/__init__.py b/libs/standard-tests/langchain_tests/unit_tests/__init__.py similarity index 86% rename from libs/standard-tests/langchain_standard_tests/unit_tests/__init__.py rename to libs/standard-tests/langchain_tests/unit_tests/__init__.py index df94c79ae61cc..ee4a1700edaf1 100644 --- a/libs/standard-tests/langchain_standard_tests/unit_tests/__init__.py +++ b/libs/standard-tests/langchain_tests/unit_tests/__init__.py @@ -11,7 +11,7 @@ ] 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 diff --git a/libs/standard-tests/langchain_standard_tests/unit_tests/chat_models.py b/libs/standard-tests/langchain_tests/unit_tests/chat_models.py similarity index 98% rename from libs/standard-tests/langchain_standard_tests/unit_tests/chat_models.py rename to libs/standard-tests/langchain_tests/unit_tests/chat_models.py index 9bde7fbf3e1a5..f5e5fe54f6e76 100644 --- a/libs/standard-tests/langchain_standard_tests/unit_tests/chat_models.py +++ b/libs/standard-tests/langchain_tests/unit_tests/chat_models.py @@ -22,8 +22,8 @@ ) 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. diff --git a/libs/standard-tests/langchain_standard_tests/unit_tests/embeddings.py b/libs/standard-tests/langchain_tests/unit_tests/embeddings.py similarity index 96% rename from libs/standard-tests/langchain_standard_tests/unit_tests/embeddings.py rename to libs/standard-tests/langchain_tests/unit_tests/embeddings.py index 39c6e941c5d7e..da7b78513844b 100644 --- a/libs/standard-tests/langchain_standard_tests/unit_tests/embeddings.py +++ b/libs/standard-tests/langchain_tests/unit_tests/embeddings.py @@ -7,7 +7,7 @@ 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): diff --git a/libs/standard-tests/langchain_standard_tests/unit_tests/tools.py b/libs/standard-tests/langchain_tests/unit_tests/tools.py similarity index 97% rename from libs/standard-tests/langchain_standard_tests/unit_tests/tools.py rename to libs/standard-tests/langchain_tests/unit_tests/tools.py index 0decc51230fbf..b92cb4f5263a4 100644 --- a/libs/standard-tests/langchain_standard_tests/unit_tests/tools.py +++ b/libs/standard-tests/langchain_tests/unit_tests/tools.py @@ -7,7 +7,7 @@ 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): diff --git a/libs/standard-tests/langchain_standard_tests/utils/__init__.py b/libs/standard-tests/langchain_tests/utils/__init__.py similarity index 100% rename from libs/standard-tests/langchain_standard_tests/utils/__init__.py rename to libs/standard-tests/langchain_tests/utils/__init__.py diff --git a/libs/standard-tests/langchain_standard_tests/utils/pydantic.py b/libs/standard-tests/langchain_tests/utils/pydantic.py similarity index 100% rename from libs/standard-tests/langchain_standard_tests/utils/pydantic.py rename to libs/standard-tests/langchain_tests/utils/pydantic.py diff --git a/libs/standard-tests/pyproject.toml b/libs/standard-tests/pyproject.toml index 8b1098c000307..238d90b102906 100644 --- a/libs/standard-tests/pyproject.toml +++ b/libs/standard-tests/pyproject.toml @@ -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 "] readme = "README.md" diff --git a/libs/standard-tests/tests/unit_tests/test_in_memory_base_store.py b/libs/standard-tests/tests/unit_tests/test_in_memory_base_store.py index 5171c14c16230..35ad6674bc5a1 100644 --- a/libs/standard-tests/tests/unit_tests/test_in_memory_base_store.py +++ b/libs/standard-tests/tests/unit_tests/test_in_memory_base_store.py @@ -5,7 +5,7 @@ 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, ) diff --git a/libs/standard-tests/tests/unit_tests/test_in_memory_cache.py b/libs/standard-tests/tests/unit_tests/test_in_memory_cache.py index 4f67a876490d0..6c1a1647ade05 100644 --- a/libs/standard-tests/tests/unit_tests/test_in_memory_cache.py +++ b/libs/standard-tests/tests/unit_tests/test_in_memory_cache.py @@ -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, ) diff --git a/libs/standard-tests/tests/unit_tests/test_in_memory_vectorstore.py b/libs/standard-tests/tests/unit_tests/test_in_memory_vectorstore.py index d1becb40c9eb4..8a3bf5d0a32b2 100644 --- a/libs/standard-tests/tests/unit_tests/test_in_memory_vectorstore.py +++ b/libs/standard-tests/tests/unit_tests/test_in_memory_vectorstore.py @@ -4,7 +4,7 @@ VectorStore, ) -from langchain_standard_tests.integration_tests.vectorstores import ( +from langchain_tests.integration_tests.vectorstores import ( AsyncReadWriteTestSuite, ReadWriteTestSuite, )