|
6 | 6 | "source": [
|
7 | 7 | "# Tool Calling 101:\n",
|
8 | 8 | "\n",
|
9 |
| - "Note: If you are looking for `3.2` Featherlight Model (1B and 3B) instructions, please see the respective notebook, this one covers 3.1 models\n", |
| 9 | + "Note: If you are looking for `3.2` Featherlight Model (1B and 3B) instructions, please see the respective notebook, this one covers 3.1 models.\n", |
| 10 | + "\n", |
| 11 | + "We are briefly introduction the `3.2` models at the end. \n", |
| 12 | + "\n", |
| 13 | + "Note: The new vision models behave same as `3.1` models when you are talking to the models without an image\n", |
10 | 14 | "\n",
|
11 | 15 | "This is part (1/2) in the tool calling series, this notebook will cover the basics of what tool calling is and how to perform it with `Llama 3.1 models`\n",
|
12 | 16 | "\n",
|
|
127 | 131 | " \n",
|
128 | 132 | " chat_history.append({\"role\": \"user\", \"content\": user_input})\n",
|
129 | 133 | " \n",
|
130 |
| - " #print(chat_history)\n", |
131 |
| - " \n", |
132 |
| - " #print(\"User: \", user_input)\n", |
133 |
| - " \n", |
134 | 134 | " response = client.chat.completions.create(model=\"llama-3.1-70b-versatile\",\n",
|
135 | 135 | " messages=chat_history,\n",
|
136 | 136 | " max_tokens=max_tokens,\n",
|
|
653 | 653 | "cell_type": "markdown",
|
654 | 654 | "metadata": {},
|
655 | 655 | "source": [
|
656 |
| - "### 3.2 Models Prompt Format" |
| 656 | + "### 3.2 Models Custom Tool Prompt Format" |
657 | 657 | ]
|
658 | 658 | },
|
659 | 659 | {
|
|
735 | 735 | " \n",
|
736 | 736 | " chat_history.append({\"role\": \"user\", \"content\": user_input})\n",
|
737 | 737 | " \n",
|
738 |
| - " #print(chat_history)\n", |
739 |
| - " \n", |
740 |
| - " #print(\"User: \", user_input)\n", |
741 |
| - " \n", |
742 | 738 | " response = client.chat.completions.create(model=\"llama-3.2-3b-preview\",\n",
|
743 | 739 | " messages=chat_history,\n",
|
744 | 740 | " max_tokens=max_tokens,\n",
|
|
755 | 751 | " return response.choices[0].message.content"
|
756 | 752 | ]
|
757 | 753 | },
|
| 754 | + { |
| 755 | + "cell_type": "markdown", |
| 756 | + "metadata": {}, |
| 757 | + "source": [ |
| 758 | + "Note: We are assuming a structure for dataset here:\n", |
| 759 | + "\n", |
| 760 | + "- Name\n", |
| 761 | + "- Email\n", |
| 762 | + "- Age \n", |
| 763 | + "- Color request" |
| 764 | + ] |
| 765 | + }, |
758 | 766 | {
|
759 | 767 | "cell_type": "code",
|
760 | 768 | "execution_count": 6,
|
|
0 commit comments