Skip to content

Commit

Permalink
PR feedback, rename
Browse files Browse the repository at this point in the history
  • Loading branch information
dloman118 committed Aug 20, 2024
1 parent b590659 commit 473924a
Showing 1 changed file with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"id": "626a645c",
"metadata": {},
"source": [
"[Toolhouse](https://app.toolhouse.ai/) is the first marketplace of AI tools, featuring tools like Code Interpreter, Web search and an Email tool. Rat . In this short demo we'll show how to use Toolhouse with Groq API, in particular Groq's finetuned for tool use `llama3-groq-70b-8192-tool-use-preview` model, for effective and fast tool calling."
"[Toolhouse](https://app.toolhouse.ai/) is the first marketplace of AI tools, featuring Code Interpreter, Web Search, and Email tools, among others. In this short demo, we'll show how to use Toolhouse with Groq API, in particular the Groq `llama3-groq-70b-8192-tool-use-preview` Large Language Model (LLM) that is fine-tuned for tool use, for effective and fast tool calling."
]
},
{
Expand Down Expand Up @@ -41,7 +41,12 @@
"id": "458ace84",
"metadata": {},
"source": [
"To use Groq and Toolhouse, set GROQ_API_KEY and TOOLHOUSE_API_KEY as environment variables:"
"To integrate Groq and Toolhouse, you'll need to set up two environment variables: `GROQ_API_KEY` and `TOOLHOUSE_API_KEY`. Follow these steps to obtain your API keys:\n",
"\n",
"* **Groq API Key**: Create a free Groq API key by visiting the [Groq Console](https://console.groq.com/keys).\n",
"* **Toolhouse API Key**: Sign up for Toolhouse using [this link](https://join.toolhouse.ai) to receive $150 in credits. Then, navigate to the [Toolhouse API Keys page](https://app.toolhouse.ai/settings/api-keys) to generate your API key.\n",
"\n",
"Once you have both API keys, set them as environment variables to start using Groq and Toolhouse."
]
},
{
Expand All @@ -60,7 +65,7 @@
"id": "32220c3f",
"metadata": {},
"source": [
"We will use the Groq custom finetuned [Llama3 70B Tool Use model](https://wow.groq.com/introducing-llama-3-groq-tool-use-models/). This model has been specifically finetuned off of Meta Llama3 70B for tool use and function calling, and achieves state-of-the-art performance on the Berkeley Function Calling Leaderboard:"
"We will use Groq's custom fine-tuned [Llama3 70B Tool Use model](https://wow.groq.com/introducing-llama-3-groq-tool-use-models/). This model is based on the Meta Llama3 70B model and was fine-tuned for tool use and function calling, achieving state-of-the-art performance on the Berkeley Function Calling Leaderboard:"
]
},
{
Expand Down Expand Up @@ -119,7 +124,7 @@
"id": "b5b2b413",
"metadata": {},
"source": [
"For this demo, we only have one tool available: `code_interpretor`. This tool takes in the `code_str` parameter, which it identifies from the user message, and runs the code. "
"For this demo, we will be using the [code_interpreter](https://app.toolhouse.ai/store/code_interpreter) tool. This tool takes in the `code_str` parameter, which it identifies from the user message, and runs the code. "
]
},
{
Expand Down Expand Up @@ -162,7 +167,7 @@
"id": "396cabd1",
"metadata": {},
"source": [
"We'll send this to our LLM via the Groq API. Note that this works just like a typical [Tool Use example in Groq](https://github.com/groq/groq-api-cookbook/blob/main/function-calling-101-ecommerce/Function-Calling-101-Ecommerce.ipynb), but instead of defining the tools ourselves we are using our existing tools in Toolhouse:"
"We'll send this to our LLM via Groq API. Note that this works just like a typical [Tool Use example in Groq](https://github.com/groq/groq-api-cookbook/blob/main/function-calling-101-ecommerce/Function-Calling-101-Ecommerce.ipynb), but instead of defining the tools ourselves we are using our existing tools in Toolhouse:"
]
},
{
Expand All @@ -186,7 +191,7 @@
"id": "f279224f",
"metadata": {},
"source": [
"As you can see, the LLM properly identified that we'd like to invoke the code_interpreter tool, and properly passed our code to it via the `code_str` parameter:"
"As you can see, the LLM properly identified that we'd like to invoke the `code_interpretor` tool, and properly passed our code to it via the `code_str` parameter:"
]
},
{
Expand All @@ -199,7 +204,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"ID: call_2s9a\n",
"ID: call_d47c\n",
"Type: function\n",
"Function: Function(arguments='{\"code_str\": \"a = 409830948\\\\nprint(a / 9834294824)\"}', name='code_interpreter')\n",
"\n",
Expand Down Expand Up @@ -245,12 +250,12 @@
"output_type": "stream",
"text": [
"Role: assistant\n",
"Tool Calls: [{'id': 'call_2s9a', 'function': {'arguments': '{\"code_str\": \"a = 409830948\\\\nprint(a / 9834294824)\"}', 'name': 'code_interpreter'}, 'type': 'function'}]\n",
"Tool Calls: [{'id': 'call_d47c', 'function': {'arguments': '{\"code_str\": \"a = 409830948\\\\nprint(a / 9834294824)\"}', 'name': 'code_interpreter'}, 'type': 'function'}]\n",
"Content: None\n",
"\n",
"\n",
"Role: tool\n",
"Tool Call ID: call_2s9a\n",
"Tool Call ID: call_d47c\n",
"Content: 0.04167364872973225\n",
"\n",
"\n",
Expand All @@ -277,7 +282,7 @@
"id": "84ceb341",
"metadata": {},
"source": [
"We can compare the tool call result to the actual result by running the python code:"
"We can compare the tool call result to the actual result by running the Python code:"
]
},
{
Expand Down Expand Up @@ -317,7 +322,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"LLM RESPONSE: The result of the division is 0.04167364872973225.\n"
"LLM RESPONSE: The result of the division is approximately 0.04167364872973225.\n"
]
}
],
Expand Down Expand Up @@ -348,7 +353,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.3"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 473924a

Please sign in to comment.