Tools help your agent perform actions or fetch information from the outside world.
Your starter project already has a few tools in
src/example_tools (opens in a new tab) that you can edit and use.
And you can import or find more open source tools in the Steamship SDK (opens in a new tab):
- Audio Transcription:
- Image Generation:
- Speech Generation:
- Eleven Labs (opens in a new tab) - Turn text into the spoken word
- Google Search (opens in a new tab) - Find answers to questions on the web
- Question Answering:
- Text Generation:
- Image Prompt Generation (opens in a new tab) - Rewrite a topic into a Stable Diffusion image prompt
- Personality Tool (opens in a new tab) - Reword a response according to a particular personality
- Text Summarization (opens in a new tab) - Summarize text
- Text Rewriter (opens in a new tab) - Utility tool for building tools that use prompts to operate
- Translation (opens in a new tab) - Translate text using an LLM
- Conversation Starters:
- Knock Knock Joke Starter (opens in a new tab) - Initiate a knock knock joke. The world's most useful tool.
Every Steamship tool is managed for you and run in the cloud. That way you, and your agent, can use them like Python functions without worrying about:
- Authentication (for tools that require it, like DALL-E)
- Logging so you can track what each agent is doing
- Metering so you can track how much each agent is using
- Load balancing & rate limiting so you don't have to worry about overloading API endpoints
- Retry on error so you don't have to add your own retry logic
- Async execution so you can kick off large jobs without worrying about HTTP timeouts
A tool is just a basic Python class with a few fields:
class TextRewritingTool(Tool): name: str = "TextRewritingTool" human_description: str = "Rewrites a piece of text using the provided prompt." agent_description: str = "Used to rewrite a piece of text given a prompt. Takes text as input, and provides text as output." def run(self, tool_input: List[Block], context: AgentContext) -> Union[List[Block], Task[Any]]: pass
For now, tools should return lists of Blocks (opens in a new tab). Async support is coming soon.
namefield is the token that will be used by the ReACT LLM to request the tool.
human_descriptionis used for logging output for human consumption
agent_descriptionis used to tell the LLM how the tool should be used.
Blockobjects instead of
str(as with some other frameworks) in order to support multi-modal output.
That means the tools you write can use it for: