Skip to main content
Best answer

How to automatically Delete files uploaded via Conversation with ChatGPT Assistants?

  • 31 December 2023
  • 1 reply
  • 1124 views

Hi,

 

I have Open AI Assistants that I call via the Conversation with Assistants action in Zapier. In these workflows, users upload files. Obviously, after a while, the files section of my Open AI developer account gets really cluttered with an endless list of files.

As I understand it, these files do not get removed automatically and incur charges if they sit there taking up storage.

I believe there is API documentation for removing the files, but I don’t quite have the technical know-how to add it into my Zap. I’d ideally like to have it so after the workflow is finished, right at the end, maybe after a delay step, have the files deleted automatically.

  1. Is there a default ChatGPT step for deleting files that I can add to my zap? This would be ideal.
  2. If not, how can I add this step myself using the documentation? Here is it, taken from here:


file_deletion_status = client.beta.assistants.files.delete(
  assistant_id=assistant.id,
  file_id=file.id
)

 

Thanks in advance.

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +11

Hi @J_M, happy new year! 🎉

There isn’t a “delete file” action currently for the ChatGPT app on Zapier so I’d suggest contacting our Support team to request that a new feature request be created on your behalf for that. You can get in touch with them here: https://zapier.com/app/get-help

In the meantime, since OpenAI’s API has the ability to delete a file you could try using the ChatGPT API Request (Beta) action for this. It’s a bit more advanced to set up since you’d need to reference OpenAI’s API documentation to create the request, but we have a Set up an API Request action guide that you may find helpful in getting you started.

If you run into any errors when setting that up just let us know!