#ChatGPT code interpreter + API calls

1 messages · Page 1 of 1 (latest)

jade girder
#

Is it possible to use function tools to provide data to code interpreter?
The examples I see for function tools are just plain text, but I would like to send huge csvs to process, like we can do in advanced data analysis.

patent rivetBOT
#

Hi @jade girder. 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 tools to provide data to the code interpreter in the OpenAI Assistant API. However, the API itself does not execute any function calls. It is up to developers to execute function calls using model outputs. The tools parameter in the Chat Completion API can be used to provide function specifications, and the model can generate function arguments which adhere to these specifications. If a function is used, the output will contain "finish_reason": "tool_calls" in the response, as well as a tool_calls object that has the name of the function and the generated function arguments source (https://cookbook.openai.com/examples/how_to_call_functions_with_chat_models).

As for passing large CSV files, the OpenAI API allows you to attach files to code_interpreter and file_search tools. Each file can be at most 512 MB in size and have a maximum of 5,000,000 tokens. The size of all the files uploaded by your organization cannot exceed 100 GB by default, but you can reach out to OpenAI's support team to increase this limit source (https://platform.openai.com/docs/assistants/how-it-works).

The code interpreter tool can access files you've uploaded and you can ask ChatGPT to analyze data, create charts, edit files, perform math, etc. source (https://help.openai.com/en/articles/6825453-chatgpt-release-notes#h_398fb5df55).

However, the specifics of how to pass a CSV file as tool_submit_outputs from a function tool to the code interpreter are not detailed in the provided sources. For more detailed instructions, you may want to refer to the OpenAI API documentation (https://platform.openai.com/docs/api-reference) or reach out to OpenAI's support team.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@jade girder kapa.ai is still learning and improving, please let us know how it did by reacting below