Tool use with the Claude 3 model family

Anthropic · Beginner ·✍️ Prompt Engineering ·2y ago

Key Takeaways

The Claude 3 model family now supports tool use, also known as function calling, which enables the model to interact with external tools and execute a set of actions by generating structured input. The Anthropic Messages API provides access to this feature in beta.

Full Transcript

one of the newest exciting features of the cloud 3 Model family is tool use also known as function calling tools that cloud can use are represented by a Json schema that tells the model about the capabilities of the tool and the arguments it accepts during generation the model can make a call to any of its tools which the client can then dispatch and return the results for example this Hau model which is our fastest and most affordable model has access to a fetch webpage tool and a stand boxed python reppel tool so it can retrieve information from the internet and run code we're going to use it to retrieve an implementation of quick sort one of the most popular sorting algorithms and check how fast it runs on a sample input now because Haiku is pretty fast I've actually slowed down this demo by 5x so that we can see the tokens being generated you can see that Haiku is able to link together several different tools to accomplish a task now things get even more interesting when models can call other models as tools for example let's say I want to find the fastest implementation of quicksort online here I'm asking Opus our most advanced model to find 100 permissively licensed quick sort implementations on GitHub then 100 houp models write tests to determine how fast each implementation is and then we'll be able to determine which is the quickest quick sort while we let this run here's how it works under the hood we've given Opus A dispatch sub agents tool to parallelize this work where it can write a prompt template and provide a list of arguments the Haiku sub agents each get the template filled in with their respective argument then all of the answers get return to Opus which Returns the fastest implementation and here we see that the fastest result is available here and it has some additional optimizations that some of the other implement don't have tool use with sub agents is a great way to combine the intelligence of Opus and the speed and affordability of haiku to take action on large amounts of information at scale hope you try it out soon

Original Description

Tool use, which enables the Claude 3 model family to interact with external tools, is now available in beta to all customers in the Anthropic Messages API. Tool use, or function calling, is a frontier AI capability that allows Claude to reason, plan and execute a set of actions by generating structured outputs via API calls. Read our developer documentation: https://docs.anthropic.com/claude/docs/tool-use Try out tool use: https://www.anthropic.com/api Learn more: https://www.anthropic.com/claude
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Playlist UUrDwWp7EBBv4NwvScIpBDOA · Anthropic · 12 of 60

1 Quick tips for Claude: Long context file uploads
Quick tips for Claude: Long context file uploads
Anthropic
2 Inside our first Anthropic Hackathon, San Francisco
Inside our first Anthropic Hackathon, San Francisco
Anthropic
3 Long inputs, multi-step output with Claude
Long inputs, multi-step output with Claude
Anthropic
4 Coding with Claude
Coding with Claude
Anthropic
5 Behind the prompt: Prompting tips for Claude.ai
Behind the prompt: Prompting tips for Claude.ai
Anthropic
6 Robin AI, powered by Claude
Robin AI, powered by Claude
Anthropic
7 Claude 3 Opus as an economic analyst
Claude 3 Opus as an economic analyst
Anthropic
8 Claude 3 Sonnet as a language learning partner
Claude 3 Sonnet as a language learning partner
Anthropic
9 Claude 3 Haiku turns thousands of physical documents into structured data
Claude 3 Haiku turns thousands of physical documents into structured data
Anthropic
10 Claude 3 Haiku for instant customer service
Claude 3 Haiku for instant customer service
Anthropic
11 Claude 3 Haiku for fast document analysis
Claude 3 Haiku for fast document analysis
Anthropic
Tool use with the Claude 3 model family
Tool use with the Claude 3 model family
Anthropic
13 Coming soon to the Team plan on Claude.ai
Coming soon to the Team plan on Claude.ai
Anthropic
14 Introducing the Claude iOS app
Introducing the Claude iOS app
Anthropic
15 Claude is now available in Europe
Claude is now available in Europe
Anthropic
16 What is interpretability?
What is interpretability?
Anthropic
17 What should an AI's personality be?
What should an AI's personality be?
Anthropic
18 Scaling interpretability
Scaling interpretability
Anthropic
19 Claude 3.5 Sonnet for sparking creativity
Claude 3.5 Sonnet for sparking creativity
Anthropic
20 Claude 3.5 Sonnet for vision
Claude 3.5 Sonnet for vision
Anthropic
21 Claude 3.5 Sonnet as a writing partner
Claude 3.5 Sonnet as a writing partner
Anthropic
22 Claude 3.5 Sonnet for agentic coding
Claude 3.5 Sonnet for agentic coding
Anthropic
23 Shareable Projects in Claude
Shareable Projects in Claude
Anthropic
24 Evaluate prompts in the Anthropic Console
Evaluate prompts in the Anthropic Console
Anthropic
25 Shareable Artifacts in Claude
Shareable Artifacts in Claude
Anthropic
26 How we built Artifacts with Claude
How we built Artifacts with Claude
Anthropic
27 Wedia advances digital asset management with Claude
Wedia advances digital asset management with Claude
Anthropic
28 AI prompt engineering: A deep dive
AI prompt engineering: A deep dive
Anthropic
29 AI Prompt Engineering 101: Explained
AI Prompt Engineering 101: Explained
Anthropic
30 Ancient Wisdom, Modern AI?
Ancient Wisdom, Modern AI?
Anthropic
31 AI's Greatest Challenge: You?
AI's Greatest Challenge: You?
Anthropic
32 AI Prompts That Drive Growth
AI Prompts That Drive Growth
Anthropic
33 Tips For Better Results With AI
Tips For Better Results With AI
Anthropic
34 AI, policy, and the weird sci-fi future with Anthropic’s Jack Clark
AI, policy, and the weird sci-fi future with Anthropic’s Jack Clark
Anthropic
35 European Parliament expands access to their archives with Claude in Amazon Bedrock
European Parliament expands access to their archives with Claude in Amazon Bedrock
Anthropic
36 Claude | Computer use for automating operations
Claude | Computer use for automating operations
Anthropic
37 Claude | Computer use for orchestrating tasks
Claude | Computer use for orchestrating tasks
Anthropic
38 Claude | Computer use for coding
Claude | Computer use for coding
Anthropic
39 Asana supercharges work management with Claude
Asana supercharges work management with Claude
Anthropic
40 What do people use AI models for?
What do people use AI models for?
Anthropic
41 Alignment faking in large language models
Alignment faking in large language models
Anthropic
42 Building Anthropic | A conversation with our co-founders
Building Anthropic | A conversation with our co-founders
Anthropic
43 How difficult is AI alignment? | Anthropic Research Salon
How difficult is AI alignment? | Anthropic Research Salon
Anthropic
44 Tips for building AI agents
Tips for building AI agents
Anthropic
45 Claude 3.7 Sonnet with extended thinking
Claude 3.7 Sonnet with extended thinking
Anthropic
46 Introducing Claude Code
Introducing Claude Code
Anthropic
47 Advice For Building AI Agents
Advice For Building AI Agents
Anthropic
48 The Two Most Useful Applications of AI Agents
The Two Most Useful Applications of AI Agents
Anthropic
49 Defending against AI jailbreaks
Defending against AI jailbreaks
Anthropic
50 The Most Common Mistake People Make When Building AI Agents
The Most Common Mistake People Make When Building AI Agents
Anthropic
51 Controlling powerful AI
Controlling powerful AI
Anthropic
52 How Intercom is redefining customer support with Claude
How Intercom is redefining customer support with Claude
Anthropic
53 Tracing the thoughts of a large language model
Tracing the thoughts of a large language model
Anthropic
54 Introducing Claude for Education
Introducing Claude for Education
Anthropic
55 Could AI models be conscious?
Could AI models be conscious?
Anthropic
56 Lessons on AI agents from Claude Plays Pokemon
Lessons on AI agents from Claude Plays Pokemon
Anthropic
57 The Societal Impacts of AI
The Societal Impacts of AI
Anthropic
58 What Does AI Mean for the Future of Work?
What Does AI Mean for the Future of Work?
Anthropic
59 Understanding AI Agents...Through Pokémon
Understanding AI Agents...Through Pokémon
Anthropic
60 What Pokémon Teaches Us About Building With AI
What Pokémon Teaches Us About Building With AI
Anthropic

The Claude 3 model family supports tool use, which enables the model to interact with external tools and execute a set of actions. This feature is available in beta through the Anthropic Messages API. Tool use allows models to reason, plan, and execute actions by generating structured input.

Key Takeaways
  1. Define a Json schema to represent the capabilities of the tool and the arguments it accepts
  2. Use the Haiku model to retrieve information from the internet using the fetch webpage tool
  3. Use the Haiku model to run code using the stand boxed python reppel tool
  4. Use the Opus model to find the fastest implementation of quicksort online
  5. Use sub agents to parallelize work and determine the fastest implementation
💡 Tool use with sub agents is a great way to combine the intelligence of Opus and the speed and affordability of Haiku to take action on large amounts of information at scale.

Related AI Lessons

Up next
I Built an AI Agent in 6 Minutes (No Code, No Developer)
HubSpot Marketing
Watch →