Assistant API .txt file upload fails

Assistant API refuses to accept certain .txt files. In particular, if the file’s content starts with “Article Title” the upload will fail. Changing it to anything else (i.e. adding “W” to become “WArticle Title”) works and file is uploaded successfully.

Steps to reproduce:

  1. Create any.txt file and write “Article Title” inside.
  2. Upload to Assistant API via POST https://api.openai.com/v1/files
  3. Upload fails with error:
400 Invalid file format. Supported formats: "c", "cpp", "css", "csv", "docx", "gif", "html", "java", "jpeg", "jpg", "js", "json", "md", "pdf", "php", "png", "pptx", "py", "rb", "tar", "tex", "ts", "txt", "webp", "xlsx", "xml", "zip"

Reproducible in playground as well

Screenshot 2024-05-03 224731

Screenshot 2024-05-03 224625

Please tell me I am not insane.

3 Likes

Interesting. Have you failed multiple times uploading “article title.txt” files?

Have you tried just renaming the file?

It fails consistently, probably 100+ times at this point. The file name seems to be irrelevant: it fails no matter what the file is called.

I’ve been testing different content of the .txt file and it fails every time when the content start with Article. Lowercase article works fine. Feel free to see for yourself in the assistant playground

Perhaps its a reserved keyword?

1 Like

The uploader has for a long time not trusted your file extension, instead using some parser to determine file type – and do stupid inspection, like one time failing JSON if NOT containing invalid trailing commas.

You can be tricky and try to fool the typing, (like you’ve already done)

{“initial_document_chunk”: “This is the start of a text file that discusses the birds and the bees”, “plain_text”: "
(your actual document)

1 Like

same here!