Question

How to capture OpenAI Assistant's "returned content"?

  • 15 December 2023
  • 3 replies
  • 125 views

Dear Zapier Community,

I have a question. I have in mind the following Zap (as a conceptual example):

Slack (message from user) → ChatGPT (Conversation with OpenAI Assistant) → Slack (message from bot).

Now, the user story would be a user, on a specific Slack channel, could for example type/ask on the channel to create a CSV file with numbers from 1 to 100 (on rows); from here ChatGPT Action picks it up and communicate with the OpenAI Assistant I’ve created on the OpenAI platform (the Assistant has Code Interpreter enabled to create the CSV file). The response is then returned to Slack with supposedly the CSV file (with the option for the end user to download it) which Code Interpreter created in the OpenAI sandbox.

Now, my issue is: I know how to handle the back and forth conversation, but I don’t know how to grab the CSV file from the OpenAI sandbox and “publish/upload” it on Slack.

Anybody has any idea?

Many thanks in advance,

Alex


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

3 replies

Hi Everyone, 

just wanted to revive this topic a bit, as unfortunately I’m still blocked at it 😫

If you solved the issue, your help would be much appreciated.

All the very best, and Merry Xmas to all!😁

Alex

Userlevel 1
Badge

This post has been edited by a moderator to remove personal information. Please remember that this is a public forum and to remove any sensitive information prior to posting.

Dear @Xperim0660,

 

For your integration of Slack, ChatGPT, and OpenAI Assistant to facilitate CSV file transfer, consider these streamlined steps:

 

- Slack Webhooks: Set up a `webhook` in your Slack workspace for file transfers.

 

- File Handling in OpenAI Assistant: Configure your Assistant to create and store CSV files temporarily in an accessible location.

 

- Server or Cloud Function: Use a server or a cloud function like AWS Lambda to interface between OpenAI's API and Slack's API. This function will handle the CSV file from OpenAI and upload it to Slack.

 

- Slack API for File Uploads: Use Slack's `files.upload` method for uploading the CSV file to the designated Slack channel.

 

- Testing and Debugging: Thoroughly test the integration in a controlled environment.

 

Additionally, Postman is an invaluable tool for debugging your API interactions. It allows you to test API queries easily and provides auto-generated scripts in various languages and platforms, which can be extremely helpful for setting up and troubleshooting your integration.

 

Best Regards,

Dillon Breytenbach

Userlevel 7
Badge +11

Hi there @Xperim0660! 👋

Did you manage to get this up and running following @DashSquared Dillon’s suggestions here? 

If not, can you confirm whether the ChatGPT action you’re using outputs a field containing the file it generated? If it doesn’t then is it possible to get the assistant to return a publicly-accessible link to download the CSV file in it’s response? In which case, you could then have the Zap pass that link along to the Slack action that sends the message.

Also, are you using the Zap to send a DM to the Slack user, or a message back to a channel? If it’s the latter, I know the Send Channel Message (Slack) action has a File field where you can select a file object, or publicly-accessible file download link, from a previous step which would attach it to the message.

faed3f586fedec40f74e0128b1333633.png

Looking forward to hearing from you on this!