Tools in Griptape
Overview
One of the most powerful features of Griptape is the ability to use tools that interact with the outside world. Tools give the LLM abilities to invoke APIs, reference data sets, and expand their capabilities beyond simple text generation.
Many of our Prompt Drivers leverage the native function calling built into LLMs. For models that do not support this, Griptape provides its own implementation using the ReAct technique.
You can switch between these strategies by setting use_native_tools
to True
(LLM-native tool calling) or False
(Griptape tool calling) on your Prompt Driver.
Custom Tools
See Custom Tools for more information on building your own tools.
Tool Output and Task Memory
Output artifacts from all tool activities (except InfoArtifact
and ErrorArtifact
) are stored in short-term TaskMemory
. To disable this behavior, set the off_prompt
tool parameter to False
.
Using Tools in Pipelines
Griptape provides a set of official tools for accessing and processing data. You can also build your own tools.
Here is an example of a Pipeline using tools:
from griptape.structures import Pipeline
from griptape.tasks import PromptTask
from griptape.tools import FileManagerTool, PromptSummaryTool, WebScraperTool
pipeline = Pipeline()
pipeline.add_tasks(
PromptTask(
"Load https://www.griptape.ai, summarize it, and store it in a file called griptape.txt",
tools=[
WebScraperTool(off_prompt=True),
FileManagerTool(off_prompt=True),
PromptSummaryTool(off_prompt=False),
],
),
)
pipeline.run()