Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Bugfix for reasoning-function-call notebook #1800

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

Merged
merged 8 commits into from
Apr 30, 2025
20 changes: 13 additions & 7 deletions examples/reasoning_function_calls.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,21 @@
" arguments = json.loads(response_item.arguments)\n",
" print(f\"Invoking tool: {response_item.name}({arguments})\")\n",
" tool_output = target_tool(**arguments)\n",
" intermediate_messages.append({\n",
" \"type\": \"function_call_output\",\n",
" \"call_id\": response_item.call_id,\n",
" \"output\": tool_output\n",
" })\n",
" except Exception as e:\n",
" tool_output = f\"Error executing function call: {function_call.name}: {e}\"\n",
" msg = f\"Error executing function call: {response_item.name}: {e}\"\n",
" tool_output = msg\n",
" print(msg)\n",
" else:\n",
" print(f\"ERROR - No tool registered for function call: {function_call.name}\")\n",
" msg = f\"ERROR - No tool registered for function call: {response_item.name}\"\n",
" tool_output = msg\n",
" print(msg)\n",
" intermediate_messages.append({\n",
" \"type\": \"function_call_output\",\n",
" \"call_id\": response_item.call_id,\n",
" \"output\": tool_output\n",
" })\n",
" elif response_item.type == 'reasoning':\n",
" print(f'Reasoning step: {response_item.summary}')\n",
" return intermediate_messages"
]
},
Expand Down