GPT building: Reference data from GPT-actions in Code Interpreter

Hello!

I’ve noticed an issue while building a custom GPT.
When the GPT retrieves data through an action that delivers the data in JSON format, it seems that the code interpreter cannot directly access these data. Is there a way for the code interpreter to directly reference the data returned by an action?

For example, suppose I have an action/function that returns a list of 200 values, and I want the code interpreter to graphically represent these values. Currently, GPT-4 manually inputs these values when generating the “live code,” which is time-consuming and likely not resource-efficient. A better approach would be for me to return, say, a .csv file with the action/function, and this .csv file would be directly referenced in the Python code by the code interpreter. This way, GPT-4 would have much less work during interactive code generation, and the user would see results faster.

Is there any way to achieve this?

3 Likes

The values have to be placed into the prompt no matter what, so there is no way around that step.

Facing the exact same problem. The code interpreter truncates and comments our the data if the data set is large, making gpt practically useless. Is there a way that the retrieved data from API can be stored temporarily in the sandbox environment and can be referenced in code interpreter?

I had a similar issue. My preference would be to allow for an action to directly store a response as a file that the code intepreter can then reference. Ideally it should be as if the user “uploaded” the downloaded file/response to the code interpreter. You can upload files for the code interpreter already, and those files can be quite large, without needing the tokens to flow through GPT itself.

1 Like

Hi, I had the same idea to circumvent problems with large data from tools output. Have you found a way to send the file as tool_output?