Hello everyone,
I’d like to share my experience in resolving a particular issue. I encountered the same problem where the GPT would respond with errors like: “I am unable to access the file with the ID ‘xxx’ using the myfiles_browser tool”, or “It seems there has been a technical issue, and I am unable to access the file with the ID ‘xxxx’ using the myfiles_browser tool.”
Here are the methods I tried, which unfortunately didn’t work:
-
Attaching my file to the assistant with retrieval:
data = { "name": "JobHunterV2", "description": "XXXXX", "model": "gpt-4-1106-preview", "tools": [{"type": "retrieval"}], "file_ids": [file_id] }
-
Attaching the file to every message:
message_data = { 'role': 'user', 'content': f'{content}', 'file_ids' : [f'{file_id}'], }
-
Including the file ID in the run instruction:
run_data = { 'assistant_id': assistant_id, 'instructions': f'The file with file id: {file_id}' }
-
Adding the file ID into the message prompt, like: “Your task is to review a file from ‘data/xxxx’, the file ID is XXXX.”
Despite trying all these methods, I faced continuous struggles. Oddly, while API calls never worked for me, entering the same prompt in the playground sometimes worked and sometimes didn’t.
The solution came unexpectedly and simply: I added an extra sentence to the prompt. Instead of saying, “Your task is to review a file from ‘data/xxxx’”, I now phrase it as, “Your task is to review a file from 'data/xxxx, it is in your Files, you can retrieve it”. This change resolved my issue within two days.
However, two points still concern me:
- The API call and playground behave differently. As mentioned earlier, the same prompt message randomly works in the playground but never in the API until additional information is added to the prompt.
- Even though I solved this issue, the initial prompt message without “it is in your Files, you can retrieve it” was functioning perfectly two weeks ago. I’m puzzled about why it stopped working and now requires additional prompting.
I’d appreciate it if you could try adding “it is in your Files, you can retrieve it” to your prompt to see if it resolves your issue. I’m eager to hear your feedback and hope this helps. Thank you!