Skip to main content

Tools

Tool components are used to interact with external services, APIs, and tools. They can be used to search the web, query databases, and perform other tasks.

Calculator Tool​

This component creates a tool for performing basic arithmetic operations on a given expression.

Parameters​

Inputs​

NameTypeDescription
expressionStringThe arithmetic expression to evaluate (e.g., 4*4*(33/22)+12-20).

Outputs​

NameTypeDescription
resultToolCalculator tool for use in LangChain

This component allows you to evaluate basic arithmetic expressions. It supports addition, subtraction, multiplication, division, and exponentiation. The tool uses a secure evaluation method that prevents the execution of arbitrary Python code.

Python Code Structured Tool​

This component creates a structured tool from Python code using a dataclass.

The component dynamically updates its configuration based on the provided Python code, allowing for custom function arguments and descriptions.

Parameters​

Inputs​

NameTypeDescription
tool_codeStringPython code for the tool's dataclass
tool_nameStringName of the tool
tool_descriptionStringDescription of the tool
return_directBooleanWhether to return the function output directly
tool_functionStringSelected function for the tool
global_variablesDictGlobal variables or data for the tool

Outputs​

NameTypeDescription
result_toolTool β”‚ Structured tool created from the Python code

Python REPL Tool​

This component creates a Python REPL (Read-Eval-Print Loop) tool for executing Python code.

Parameters​

Inputs​

NameTypeDescription
nameStringThe name of the tool (default: "python_repl")
descriptionStringA description of the tool's functionality
global_importsList[String]List of modules to import globally (default: ["math"])

Outputs​

NameTypeDescription
toolToolPython REPL tool for use in LangChain

Retriever Tool​

This component creates a tool for interacting with a retriever in LangChain.

Parameters​

Inputs​

NameTypeDescription
retrieverBaseRetrieverThe retriever to interact with
nameStringThe name of the tool
descriptionStringA description of the tool's functionality

Outputs​

NameTypeDescription
toolToolRetriever tool for use in LangChain

Wikipedia API​

This component creates a tool for searching and retrieving information from Wikipedia.

Parameters​

Inputs​

NameTypeDescription
input_valueStringSearch query input
langStringLanguage code for Wikipedia (default: "en")
kIntegerNumber of results to return
load_all_available_metaBooleanWhether to load all available metadata (advanced)
doc_content_chars_maxIntegerMaximum number of characters for document content (advanced)

Outputs​

NameTypeDescription
resultsList[Data]List of Wikipedia search results
toolToolWikipedia search tool for use in LangChain

Hallo, wie kann ich Ihnen helfen?