Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions libs/core/langchain_core/tools/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def tool(
response_format: Literal["content", "content_and_artifact"] = "content",
parse_docstring: bool = False,
error_on_invalid_docstring: bool = True,
) -> Callable[[Union[Callable, Runnable]], BaseTool]: ...
) -> Callable[[Union[Callable[..., Any], Runnable[Any, Any]]], BaseTool]: ...


@overload
def tool(
name_or_callable: str,
runnable: Runnable,
runnable: Runnable[Any, Any],
*,
description: Optional[str] = None,
return_direct: bool = False,
Expand All @@ -42,7 +42,7 @@ def tool(

@overload
def tool(
name_or_callable: Callable,
name_or_callable: Callable[..., Any],
*,
description: Optional[str] = None,
return_direct: bool = False,
Expand All @@ -65,12 +65,12 @@ def tool(
response_format: Literal["content", "content_and_artifact"] = "content",
parse_docstring: bool = False,
error_on_invalid_docstring: bool = True,
) -> Callable[[Union[Callable, Runnable]], BaseTool]: ...
) -> Callable[[Union[Callable[..., Any], Runnable[Any, Any]]], BaseTool]: ...


def tool(
name_or_callable: Optional[Union[str, Callable]] = None,
runnable: Optional[Runnable] = None,
name_or_callable: Optional[Union[str, Callable[..., Any]]] = None,
runnable: Optional[Runnable[Any, Any]] = None,
*args: Any,
description: Optional[str] = None,
return_direct: bool = False,
Expand All @@ -81,7 +81,7 @@ def tool(
error_on_invalid_docstring: bool = True,
) -> Union[
BaseTool,
Callable[[Union[Callable, Runnable]], BaseTool],
Callable[[Union[Callable[..., Any], Runnable[Any, Any]]], BaseTool],
]:
"""Make tools out of functions, can be used with or without arguments.

Expand Down
Loading