I 'm able to use the code interpreter tool with the Assistant API:
all_tools = [
{ “type”: “code_interpreter” },
{ “type”: “function”, “function”: my_function},
]
assistant = client.beta.assistants.create(
name = assistant_name,
instructions=prompt,
model=model,
tools=[{ “type”: “code_interpreter” },
{ “type”: “function”, “function”: my_function},
],
)
How can I pass the code interpreter tool to the completions API? Something like this generates an error:
data = { “model”: model, “messages”: history, “tools”: all_tools }
requests.post(openai_url, json=data, headers=headers)
Error: Missing required parameter: tools[0].function