Tools

Tools represent the functions that agents can use to interact with. These tools can be generic utilities (e.g., search), other chains, or even other agents.

RequestsGetTool

RequestsGetTool acts like a portal to the internet. Use this when you need to get specific content from a website. When you require content from a website, you input the URL (e.g., https://google.com), and the output will be the text response retrieved from the GET request.

RequestsPatchTool

Use this when you want to PATCH to a website. Input should be a json string with two keys: "url" and "data.” The value of the URL should be a string, and the value of the data should be a dictionary of key-value pairs you want to patch to the URL. Be careful always to use double quotes for strings in the json string. The output will be the text response of the PATCH request.

RequestsDeleteTool

Similar to RequestsGetTool, ​RequestsDeleteTool can also be considered a portal to the Internet. Use this when you need to make a DELETE request to a URL. Input should be a specific URL, and the output will be the text response of the DELETE request.

RequestsPostTool

Use this when you want to post to a website. Input should be a json string with two keys: "url" and "data." The value of the URL should be a string, and the value of the data should be a dictionary of key-value pairs you want to post to the URL. Be careful always to use double quotes for strings in the json string. The output will be the text response to the POST request.

RequestsPutTool

RequestsPutTool is used for making HTTP PUT requests to a website. Input should be a json string with two keys: "url" and "data.” The URL value should be a string, and the data value should be a dictionary of key-value pairs you want to put to the URL. Be careful always to use double quotes for strings in the json string. The output will be the text response to the PUT request.

PythonFunctionTool

ZBrain Flow enables the creation of custom tools by utilizing the PythonFunctionTool component. These custom tools can then be used with an agent.

Parameters:

  • Name: The name you give to the tool

  • Description: States what the Python function is about.

  • Code: This is where the Python function is written.

  • return_direct: It is often desirable to have its output returned directly to the user. You can do this by setting the return_direct flag for a tool to be True.

PythonFunction

Similar to PythonFunctionTool, this is also used to create a custom tool with the difference of not having the option to return the output to the user directly.

Parameters:

  • Code: This is where the Python function is written.

JsonSpec

This is useful when you want to interact with a JSON blob that's too large to fit in the context window of an LLM.

Parameters:

  • path: The file path to the JSON data.

  • max_value_length: It specifies the maximum length of the json blob that will be explored iteratively in case the file is too large. The default is set to 400.

JsonGetValueTool

This component can be used to see value in string format at a given path. Before calling this, you should be SURE that the path to this exists. The input is a text representation of the path to the dict in Python syntax (e.g., data["key1"][0]["key2"]).

JsonListKeysTool

This component can be used to list all keys at a given path. Before calling this, you should be SURE that the path to this exists. The input is a text representation of the path to the dict in Python syntax (e.g., data["key1"][0]["key2"]).

Last updated