#Is it possible to use function calls return on code interpreter?
1 messages · Page 1 of 1 (latest)
Hi @tight tulip. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Yes, it is possible to use function calls in combination with the code interpreter in OpenAI's API. However, the function call and the code interpreter are different types of tools and are used for different purposes.
The function call tool is used when you want the assistant to call a specific function. The function name must be set if the type of the tool is function. The function tool is an object with properties, one of which is the name of the function to call. This is required for the function tool to work.
On the other hand, the code interpreter tool is used when you want the assistant to interpret and execute a piece of code. The code interpreter can output one or more items, including text (logs) or images (image). Each of these are represented by a different object type.
When using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request.
Please note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.