From 473924a2f0302f67b8962e58ab4c774e25771739 Mon Sep 17 00:00:00 2001 From: dloman118 <99347459+dloman118@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:24:05 -0400 Subject: [PATCH] PR feedback, rename --- .../Groq <> Toolhouse.ipynb | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) rename {toolhouse => toolhouse-for-tool-use-with-groq-api}/Groq <> Toolhouse.ipynb (78%) diff --git a/toolhouse/Groq <> Toolhouse.ipynb b/toolhouse-for-tool-use-with-groq-api/Groq <> Toolhouse.ipynb similarity index 78% rename from toolhouse/Groq <> Toolhouse.ipynb rename to toolhouse-for-tool-use-with-groq-api/Groq <> Toolhouse.ipynb index 6c75b4e..0908413 100644 --- a/toolhouse/Groq <> Toolhouse.ipynb +++ b/toolhouse-for-tool-use-with-groq-api/Groq <> Toolhouse.ipynb @@ -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." ] }, { @@ -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." ] }, { @@ -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:" ] }, { @@ -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. " ] }, { @@ -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:" ] }, { @@ -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:" ] }, { @@ -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", @@ -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", @@ -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:" ] }, { @@ -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" ] } ], @@ -348,7 +353,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.3" + "version": "3.11.9" } }, "nbformat": 4,