|
@@ -6,7 +6,7 @@
|
|
"source": [
|
|
"source": [
|
|
"# Tool Calling 101:\n",
|
|
"# Tool Calling 101:\n",
|
|
"\n",
|
|
"\n",
|
|
- "Note: If you are looking for `3.2` Featherlight Model (1B and 3B) instructions, please scroll to the bottom\n",
|
|
|
|
|
|
+ "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",
|
|
"\n",
|
|
"\n",
|
|
"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",
|
|
"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",
|
|
"\n",
|
|
"\n",
|
|
@@ -544,10 +544,10 @@
|
|
"fn_name = re.search(r'<\\|python_tag\\|>(\\w+)\\.', output).group(1)\n",
|
|
"fn_name = re.search(r'<\\|python_tag\\|>(\\w+)\\.', output).group(1)\n",
|
|
"\n",
|
|
"\n",
|
|
"# Extract the method\n",
|
|
"# Extract the method\n",
|
|
- "fn_call_method = re.search(r'\\.(\\w+)\\(', string).group(1)\n",
|
|
|
|
|
|
+ "fn_call_method = re.search(r'\\.(\\w+)\\(', output).group(1)\n",
|
|
"\n",
|
|
"\n",
|
|
"# Extract the arguments\n",
|
|
"# Extract the arguments\n",
|
|
- "fn_call_args = re.search(r'=\\s*([^)]+)', string).group(1)\n",
|
|
|
|
|
|
+ "fn_call_args = re.search(r'=\\s*([^)]+)', output).group(1)\n",
|
|
"\n",
|
|
"\n",
|
|
"print(f\"Function name: {fn_name}\")\n",
|
|
"print(f\"Function name: {fn_name}\")\n",
|
|
"print(f\"Method: {fn_call_method}\")\n",
|
|
"print(f\"Method: {fn_call_method}\")\n",
|