diff --git a/libs/core/langchain_core/tools/__init__.py b/libs/core/langchain_core/tools/__init__.py index 9c3b61f4b01..3553ff10ec7 100644 --- a/libs/core/langchain_core/tools/__init__.py +++ b/libs/core/langchain_core/tools/__init__.py @@ -45,12 +45,14 @@ from langchain_core.tools.convert import ( convert_runnable_to_tool as convert_runnable_to_tool, ) from langchain_core.tools.convert import tool as tool +from langchain_core.tools.render import ToolsRenderer as ToolsRenderer from langchain_core.tools.render import ( render_text_description as render_text_description, ) from langchain_core.tools.render import ( render_text_description_and_args as render_text_description_and_args, ) +from langchain_core.tools.retriever import RetrieverInput as RetrieverInput from langchain_core.tools.retriever import ( create_retriever_tool as create_retriever_tool, ) diff --git a/libs/core/tests/unit_tests/test_tools.py b/libs/core/tests/unit_tests/test_tools.py index ef7e20d803b..cd6d843ac20 100644 --- a/libs/core/tests/unit_tests/test_tools.py +++ b/libs/core/tests/unit_tests/test_tools.py @@ -25,6 +25,7 @@ import pytest from pydantic import BaseModel as BaseModelProper # pydantic: ignore from typing_extensions import Annotated, TypedDict, TypeVar +from langchain_core import tools from langchain_core.callbacks import ( AsyncCallbackManagerForToolRun, CallbackManagerForToolRun, @@ -1904,3 +1905,26 @@ def test_tool_args_schema_pydantic_v2_with_metadata() -> None: assert foo.invoke({"x": [0] * 10}) with pytest.raises(ValidationErrorV2): foo.invoke({"x": [0] * 9}) + + +def test_imports() -> None: + expected_all = [ + "FILTERED_ARGS", + "SchemaAnnotationError", + "create_schema_from_function", + "ToolException", + "BaseTool", + "Tool", + "StructuredTool", + "tool", + "RetrieverInput", + "create_retriever_tool", + "ToolsRenderer", + "render_text_description", + "render_text_description_and_args", + "BaseToolkit", + "convert_runnable_to_tool", + "InjectedToolArg", + ] + for module_name in expected_all: + assert hasattr(tools, module_name) and getattr(tools, module_name) is not None