OpenAI | Prompt on File Content

Describe the problem/error/question

I’m trying to prompt OpenAI with regards to a document I have.

I’ve tried the following:

  • Uploading the file in OpenAI and trying to create an assistant with knowledge retrieval. Using the ‘Fixed’-option and manually selecting the file works, but it doesn’t seem to work when using the ‘Expression’-option to dynamically insert the file.

  • Trying to create an assistant with knowledge retrieval and directly adding the file, without first uploading it to OpenAI.

What is the error message (if any)?

The workflow triggers when a Slack bot is mentioned with a URL. It should then provide a document with feedback on that document, based on ChatGPT output. For this to work I should be able to prompt, based on a specific file.

Please share your workflow

Share the output returned by the last node

The resource you are requesting could not be found [item 0]
Files [filename] were not found

Also, I’m not sure if this Assistant-way is the most efficient to reach my goal.

Information on your n8n setup

  • n8n version: V1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): website
  • Operating system: Windows / Chrome

Hey @Fingerspitz,

Which node are you seeing the error message in?

Hi Jon,

Thanks for your reply! It’s within the creation of the OpenAI Assistant.

I want it to use the file that I’ve just uploaded, but I can’t use it dynamically from the past nodes.

If in node ‘Create Assistant’ I use ‘{{ $(‘Upload File’).item.json.id’ it returns the right ID, but I get this error message:

“Bad request - please check your parameters
Files with extensions [none] are not supported for retrieval. See https://platform.openai.com/docs/assistants/tools/file-search/supported-files

After some testing I found out that my files must be named with the right extension ‘.docx’ for example within their name. Even though the file is in the right format, the name of the file matters.

Thought maybe good for other people to know.

Kind regards,
Gust de Backer