mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
core[patch]: tool import fix (#25419)
This commit is contained in:
parent
df632b8cde
commit
2494cecabf
@ -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,
|
||||
)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user