Hello, I’m using curl (libcurl) with php to talk with gpt4 I’m trying to implement tools, but there’s noting in the api reference about how to reply to tool_calls. I’m able to do it with assistant but not with chat completion api.
Can someone help me ?
Tools are only currently available through Assistants. You will have to use an Assistant if you want to use tool_calls.
You are able to use tool calls in chat completions, it is not required to use the assistants framework to specify tool_call methods via API.
Here’s doing parallel tool calls and returning parallel tool returns in Python. CURL, you can just adapt existing working methods to the new specification needed for function->tool conversion.
I decided to make the mega-demo. Going beyond this I might as well just write a chatbot with classes for handling simulated functions and showing rewriting them to a real API…
# imports and set up the OpenAI client object with a shorter timeout
from openai import OpenAI
client = OpenAI(timeout=30)
# Here we'll make a tool specification, more flexible by adding one at a time
That works perfectly, thank you !
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.