Assistant file upload error handling

Hello,

I am a newbie here and I am building a custom chatbot using assistant APIs and Streamlit. What I would like to do is show users a success/failure message when the user uploads a file via this custom app.

I am trying to process the response object to see if the file was uploaded successfully or not and not able to make this work. Below is the code that I am trying with. Any pointers to resolve this would be great help.

Hi there! The raw response contains the information you need- the status field has four states, and I’m guessing you want to show the message when the status is Available (see details here: Upload file to assistant - Pinecone Docs)

You should still be able to access that property even without serializing it to a JSON string– or were you hitting an error that way?

Thanks for the response Bear.

I’m not sure how to access that property without converting it to JSON and when I try to convert, I get error as shown in the screenshot.

Thanks.

I figured it out and now I am able to validate the status.

1 Like