Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Recipe] Example featuring built-in tool calling capabilities - Wolfram Alpha, Interpreter, Brave Search #618

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/scripts/spellcheck_conf/wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1451,3 +1451,8 @@ openhathi
sarvam
subtask
acc
CrowdStrike
builtins
cybersecurity
wordlwide
builtins
35 changes: 35 additions & 0 deletions recipes/3p_integrations/octoai/builtins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Using Llama3.1 built in tools
Meta's latest Llama3.1 models offer unique function calling capabilities. In particular they offer built-in tool calling capabilities for the following 3 external tools:
* Brave Search: internet search
* Code Interpreter: Python code interpreter
* Wolfram Alpha: mathematical and scientific knowledge tool

To sell the benefits of the built in tools, let's look at what one would get back from an LLM with or without tool calling capabilities. In particular:

### Code Interpreter
User Query: `I just got a 25 year mortgage of 400k at a fixed rate of 5.14% and paid 20% down. How much will I pay in interest?`
* Answer without tool calls (wrong): `Total paid interest: $184,471`
* Answer with tool calls (correct): `you will pay a total of $249,064.70 in interest`

### Brave Search
User Query: `What caused a wordlwide outage in the airlines industry in July of 2024?`
* Answer without tool calls: `I'm not aware of anything that would have caused a worldwide outage in the airlines industry.`
* Answer with tool calls: `The global technology outage was caused by a faulty software update that affected Windows programs running cybersecurity technology from CrowdStrike. The outage disrupted flights, media outlets, hospitals, small businesses, and government offices, highlighting the vulnerability of the world's interconnected systems.`

### Wolfram Alpha
User Query: `Derive the prime factorization of 892041`
* Answer without tool calls (wrong): `The prime factorization of 892041 is:\n\n2 × 2 × 2 × 3 × 3 × 3 × 5 × 13 × 17 × 17`
* Answer with tool calls (correct): `The prime factorization of 892041 is 3 × 17 × 17491.`

## What you will build
You will learn how to make use of these built in capabilities to address some of the notorious weaknesses of LLMs:
* Limited ability to reason about complex mathematical notions
* Limited ability to answer questions about current events (or data that wasn't included in the model's training set)

## What you will use
You'll learn to invoke Llama3.1 models hosted on OctoAI, and make use of the model's built in tool calling capabilities via a standardized OpenAI-compatible chat completions API.

## Instructions
Make sure you have Jupyter Notebook installed in your environment before launching the notebook in the `recipes/use_cases/tool_calling/builtins` directory.

The rest of the instructions are described in the notebook itself.
Loading
Loading