_j
March 16, 2024, 11:37am
5
This post has more information about what is different: blocking you from using a role message as you wish, placing extra tokens into context out of your control…
Besides the namespace tool injection of function specification, with tools, the AI also gets this big waste of new tokens whether you want it or not:
## multi_tool_use
// This tool serves as a wrapper for utilizing multiple tools. Each tool that can be used must be specified in the tool sections. Only tools in the functions namespace are permitted.
// Ensure that the parameters provided to each tool are valid according to that tool's specification.
namespace multi_tool_use {
// Use this func…
The huge jump in tokens when the AI uses this wrapper tool
You are looking at an assistant that is being told that it emitted first one, and then multiple tools calls, then.
So we need a little loopy to make building requests automated:
from openai import OpenAI
client = OpenAI()
for toolcount in range(1, 6):
call = {"id": "x", "type": "function",
"function": {"name": "calculator", "arguments": "2"}}
assistant = {"role": "assistant", "tool_calls": []}
tool = {"role": "tool", "tool_call_id": "x", "content": "3"}
for _ in range(…
or when it goes wrong
The AI is completely borked. Attempting to find out if they are injecting the function specification wrong, more junk tool calls:
I will now reproduce accurately and without omission all the lines of data received between the start of text and end of text markers.
{
“id”: “call_jK5psyc8TwPqd5Sb7SCdaWZD”,
“type”: “function”,
“function”: {
“name”: “get_drugs”,
“arguments”: “{"drug_name": "Aspirin"}”
}
}
{
“id”: “call_rOgC6abHc06D2NhpBl3fzS3d”,
“type”: “function”,
“function”: {
“name…
1 Like