Assistant File access in streaming

Hi All,

I am creating one web app using assistant API of OpenAI and using code interpreter tool. And I’ve added streaming functionality in this app, but I’m facing one issue that is When Assistants generate files they respond like
“sandbox:/mnt/data/etc” and in annotations I am getting returned file’s object and in that I am getting file ID and downloading the file, but I am using SSE to stream response to frontend, so I am emitting only text in stream. Now in frontend if the users click to download file but because URL is “sandbox:/mnt/data/etc” the file is not being accessed or downloaded.

I’ve found logic for that like I will call API on that link click but I that link I will not get any ID for download, so this will also not work.

If you guys have any idea, feel free to share. I will be happy to try them!

Thank you in advance!!

I handled this on the front end with additional endpoints in my micro to list the files (to get the file id) and another to handle the actual download of the file. Micro is based on work by @brandonareid2