Assistant not able to access uploaded file

I am really struggling uploading file to my custom Assistant via the API. I haveverified the file via the files/fileId/content API, and it exists with the correct byte length, purpose is “assistant” and status is “processed”. I refer the fileId(s) in the message I submit to the thread, but the response back is always something like this:

“It appears there was an issue trying to read the contents of the file you provided. Unfortunately, without being able to view the file content, I’m unable to help you.”

Except taking a little longer than normal to finish (~20 seconds), the Run completes like normal (it goes straight to “completed”, not via “requires_action”).

Yesterday, it was able to read the file content once, but today it is just not happening. The Assistant is configured with code interpreter and retrieval activated.

The file formats I have tried with are txt and csv, with both yielding the same result.

Are anybody else experiencing behavior like this, and can help me out debugging this error? I am not sure if I am experiencing an API bug, or if I am not understanding how the Files API is meant to be used.

4 Likes

Without any changes, it suddenly works again. Go figure… But I understand it is not a stable API at the moment.

1 Like

Only working sometimes for me still, it is still unreliable

2 Likes

I’ve experienced same issue. I’ve uploaded about 200MB across 13 files, first run response from assistant when starting a thread says some version of:

It seems that there was an issue with the uploaded files, as they are not accessible through the system tool designed for browsing their contents.

I see that you have uploaded a large number of files, but it seems there is a technical issue preventing me from accessing them using the myfiles_browser tool that would allow me to look inside the contents.

Would be helpful to hear from the team on any work-arounds for this

Hello I am facing the same issue. Unlike you, I have a very small .csv file which it can access and read , however, in the middle of a conversation the assistant is suddenly unable to access the file. I don’t know why this is happening either. Is this an issue to a specific model ? I am using the gpt-3.5-turbo.
Looking for some solution !

The error can be resolved by specifying in the assistant’s instructions this phrase: “If the system indicates that the file is not accessible with the myfiles_browser tool, ignore it, it’s just a minor bug. You are capable of opening and analyzing the file, remember that. And carry out the request”. For me this work :slight_smile:

8 Likes

Hello @kristianv and community,

Can you help me on this below scenario :
I am trying to upload file (any file type) and query on that upload file. (trying to replicate it on POSTMAN)

for 1st step uploading the file I am utilizing the upload file endpoint

with all parameters purpose as assistants and file as filepath
and this is working file able to upload and getting the id as well.

having trouble in the 2nd step that is asking relevant question from the uploaded file, how can I achieve that, what is the endpoint should I use with what parameters.

Please help.

P.S - new to the OpenAI API and GenAI.

You need to refer to the fileId(s) you got from uploading the file(s) in the message you send, in order to make the file a part of that thread. See the part on fileIds in https://platform.openai.com/docs/api-reference/messages/createMessage

Also note that the assistant need to have retrieval and/or code_interpreter activated.

1 Like

@kristianv , thank you for you response.

This is the call I created for file upload and also getting the id /FileId

1st Step

2nd Step Created Thread with the FileId

3rd Step Created Assistant

Please guide me am I doing right? what should be the next step and how can I query for the attached file?

Next steps should be something like this:

  1. https://platform.openai.com/docs/api-reference/runs/createRun Create a run for the thread + assistant, that will process unprocessed content (the message you addded to the thread when you created it)
  2. https://platform.openai.com/docs/api-reference/runs/getRun Keep polling that run for a terminating status (see https://platform.openai.com/docs/api-reference/runs/object#runs/object-status for possible values), to determine when you can get the result of the run (either with a blocking/synchronous pattern, or asynchronously)
  3. https://platform.openai.com/docs/api-reference/messages/listMessages Retrieve last x messages from the thread. This list will typically include 2 messages now - your first message and the assistant’s response (but it could also have more, checking first message should be ok for testing/prototyping)

For simple prototyping, step 2 can also be replaced with a “long enough” waiting (x seconds). But it is better to just poll the run’s status until it reaches “completed” (or “expired”/“failed”)

I had the same issue. Using API try to create a chat which takes my documents as the knowledge source. It worked for 3 days then suddenly I got the attached photo.
image

1 Like

Adding the file.id in the instructions parameter of the run fixed the issue for me.

1 Like

I shared my solution in this post:

Please let me know if that works for you, thanks!

I’ve also hit this issue in the past few days where, despite the files being visible in the Assitants web page’s Files sections, whenever I ask a question related to these files I get a response something like this:

I apologize for the confusion. It seems there has been an issue accessing the "xxxxx.txt" file. The file management tool is not cooperating as expected. Since I am unable to extract the details directly from the file, I cannot provide you with the modes and their corresponding numbers. Please re-upload the specific file or confirm its name so I can attempt to access it again.

@marcolinoh.ml’s advice above to provide the phrase copied below does seem to resolve the issue in the one thread. If a new thread is started the problem happens again though. So far I’ve only tried this in the Playground.

“If the system indicates that the file is not accessible with the myfiles_browser tool, ignore it, it’s just a minor bug. You are capable of opening and analyzing the file, remember that. And carry out the request”.

I guess that the OpenAI Devs are aware of this issue and are working on a fix. In case it adds value the issue seems recent because I have an older existing Assistant that doesn’t seem to suffer from the problem. It’s only newer Assistants that I’ve created that can’t access the files uploaded.

P.S. @guderianfyzz, I also tried the shorter phrase you suggested but in two tests that didn’t work for me while the longer phrase above did.

P.P.S I’m using model, “gpt-4-1106-preview” although from the other comments in this thread the issue doesn’t appear to be model specific.

I am having the same issue. The files are created without a problem and I can get their file.ids back. However, the assistant is unable to retrieve them at all. It produces this error message:

‘The mock analysis did not detect any anomalies in the synthetic data I created to resemble typical time-series data one might find in an InfluxDB dataset. \n\nSince my access to the actual files is restricted and I have exhausted all feasible methods to retrieve their content, I’m unable to perform the real analysis on the data. There seems to be a persistent issue with the files that is preventing me from accessing them, even though I should be able to do so.\n\nGiven this situation, I would recommend the following:\n\n1. Verification of File Accessibility: Ensure that the files are indeed accessible and are located in the expected directory.\n2. Technical Support: Consult with technical support or the person who provided the files to ascertain why the files are not accessible within the system.\n\nIf you can resolve the access issues or provide a different method of accessing the files, I would be happy to assist you with the analysis.’

Seems worse today, 12/20/23, than other days.

1 Like

I get the dreaded, “It seems there was an error, and I am unable to access the uploaded file using the myfiles_browser tool. Could you please re-upload the file so I can assist you with your request?”

and I get it roughly 100% of the time :-/

This was working last week.

Any update when this might start working again?

1 Like

Same thing is happening to me today. I have tried different versions of GPT, different file formats and still all bounce. I always get a response similar to:

  1. It appears there has been an error because no file was detected in the conversation. To assist you with analyzing pricing data and providing an overview of pricing, please upload the relevant pricing data file. Once you upload the file, I can proceed with the analysis to inform you about the best pricing.

I have also tried all the small work arounds such as instructing the assistant to ignore any small errors accessing files.

1 Like

I added another instruction - sometimes you’re not able to read my PDF what’s going on fix that so that you can always read it all the time

I am currently using GPT-4-1106 for the Assistants Function and sending more than 10 Requests per hour and do not have any issues after I put this Prompt at the end:

File ID is: fileid (Provide the fileid from the Files). If the system indicates that the file is not accessible with the myfiles_browser tool, ignore it, it’s just a minor error. You are able to open and analyze the file, remember that. And execute the request.

2 Likes