Official Tools

Overview

Gen AI Builder provides a set of official Tools for common tasks. In general, Gen AI Builder-included Tools are designed to be general-purpose and Driver-based for easy integration with different backends.

Tools

Audio Transcription

This Tool enables Agents to transcribe speech from text using Audio Transcription Drivers.

Calculator

This tool enables LLMs to make simple calculations.

Computer

This tool enables LLMs to execute Python code and run shell commands inside a Docker container. You have to have the Docker daemon running in order for this tool to work.

You can specify a local working directory and environment variables during tool initialization:

from griptape.structures import Agent
from griptape.tools import ComputerTool

# Initialize the ComputerTool tool
computer = ComputerTool()

# Create an agent with the ComputerTool tool
agent = Agent(tools=[computer])

agent.run("Make 2 files and then list the files in the current directory")

Date Time

This tool enables LLMs to get current date and time.

Email

The EmailTool enables LLMs to send emails.

import os

from griptape.tools import EmailTool

email_tool = EmailTool(
    smtp_host=os.environ.get("SMTP_HOST"),
    smtp_port=int(os.environ.get("SMTP_PORT", "465")),
    smtp_password=os.environ.get("SMTP_PASSWORD"),
    smtp_user=os.environ.get("FROM_EMAIL"),
    smtp_use_ssl=bool(os.environ.get("SMTP_USE_SSL")),
)

For debugging purposes, you can run a local SMTP server that the LLM can send emails to:

python -m smtpd -c DebuggingServer -n localhost:1025

Extraction

The ExractionTool enables LLMs to extract structured text from unstructured data.

File Manager

This tool enables LLMs to save and load files.

Gen AI Builder Tool

The GriptapeCloudToolTool integrates with Gen AI Builder's hosted Tools.

Note: This tool requires a Tool hosted in Gen AI Builder and an API Key for access.

Image Query

This tool allows Agents to execute natural language queries on the contents of images using multimodal models.

Inpainting Image Generation

This tool allows LLMs to generate images using inpainting, where an input image is altered within the area specified by a mask image according to a prompt. The input and mask images can be provided either by their file path or by their Task Memory references.

Outpainting Image Generation

This tool allows LLMs to generate images using outpainting, where an input image is altered outside of the area specified by a mask image according to a prompt. The input and mask images can be provided either by their file path or by their Task Memory references.

Prompt Image Generation

This tool allows LLMs to generate images from a text prompt.

Prompt Summary

The PromptSummaryTool enables LLMs summarize text data.

Rag

The RagTool enables LLMs to query modular RAG engines.

Here is an example of how it can be used with a local vector store driver:

Query

The QueryTool enables Agents to query unstructured data for specific information.

Rest Api

This tool enables LLMs to call REST APIs.

The RestApiTool tool uses the following parameters:

The following example is built using https://jsonplaceholder.typicode.com/guide/.

Sql

This tool enables LLMs to execute SQL statements via SQLAlchemy. Depending on your underlying SQL engine, configure your engine_url and give the LLM a hint about what engine you are using via engine_name, so that it can create engine-specific statements.

Structure Run

The StructureRunTool Tool provides a way to run Structures via a Tool. It requires you to provide a Structure Run Driver to run the Structure in the desired environment.

Text To Speech

This Tool enables LLMs to synthesize speech from text using Text to Speech Drivers.

Variation Image Generation

This Tool allows LLMs to generate variations of an input image from a text prompt. The input image can be provided either by its file path or by its Task Memory reference.

Referencing an Image by File Path

Referencing an Image in Task Memory

Vector Store

The VectorStoreTool enables LLMs to query vector stores.

Here is an example of how it can be used with a local vector store driver:

Web Scraper

This tool enables LLMs to scrape web pages for full text, summaries, authors, titles, and keywords. It can also execute search queries to answer specific questions about the page. This tool uses OpenAI APIs for some of its activities, so in order to use it provide a valid API key in openai_api_key.

This tool enables LLMs to search the web.

Extra schema properties can be added to the Tool to allow for more customization if the Driver supports it. In this example, we add a sort property to the search Activity which will be added as a Google custom search query parameter.


Could this page be better? Report a problem or suggest an addition!