Skip to content

Commit

Permalink
Add documentation to tools (#11938)
Browse files Browse the repository at this point in the history
Add security notes to tools

---------

Co-authored-by: Predrag Gruevski <[email protected]>
  • Loading branch information
eyurtsev and obi1kenobi authored Oct 18, 2023
1 parent 43dc669 commit 908c7bf
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions libs/langchain/langchain/agents/load_tools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# flake8: noqa
"""Load tools."""
"""Tools provide access to various resources and services.
LangChain has a large ecosystem of integrations with various external resources
like local and remote file systems, APIs and databases.
These integrations allow developers to create versatile applications that combine the
power of LLMs with the ability to access, interact with and manipulate external
resources.
When developing an application, developers should inspect the capabilities and
permissions of the tools that underlie the given agent toolkit, and determine
whether permissions of the given toolkit are appropriate for the application.
See [Security](https://python.langchain.com/docs/security) for more information.
"""
import warnings
from typing import Any, Dict, List, Optional, Callable, Tuple
from mypy_extensions import Arg, KwArg
Expand Down Expand Up @@ -397,7 +411,6 @@ def load_huggingface_tool(
Returns:
A tool.
"""
try:
from transformers import load_tool
Expand Down Expand Up @@ -434,6 +447,22 @@ def load_tools(
) -> List[BaseTool]:
"""Load tools based on their name.
Tools allow agents to interact with various resources and services like
APIs, databases, file systems, etc.
Please scope the permissions of each tools to the minimum required for the
application.
For example, if an application only needs to read from a database,
the database tool should not be given write permissions. Moreover
consider scoping the permissions to only allow accessing specific
tables and impose user-level quota for limiting resource usage.
Please read the APIs of the individual tools to determine which configuration
they support.
See [Security](https://python.langchain.com/docs/security) for more information.
Args:
tool_names: name of tools to load.
llm: An optional language model, may be needed to initialize certain tools.
Expand Down

0 comments on commit 908c7bf

Please sign in to comment.