Invalid file format for TSX after renaming to TS, JS, TXT

I can’t seem to upload this file to the files endpoint even after renaming the file to TXT or TS and I keep getting

Error code: 400 - {'error': {'message': "Invalid file format. Supported formats: ['c', 'cpp', 'csv', 'docx', 'html', 'java', 'json', 'md', 'pdf', 'php', 'pptx', 'py', 'rb', 'tex', 'txt', 'css', 'jpeg', 'jpg', 'js', 'gif', 'png', 'tar', 'ts', 'xlsx', 'xml', 'zip']", 'type': 'invalid_request_error', 'param': None, 'code': None}}

I’m uploading the following file:

import { cn } from "@/lib/utils";

const Border = ({ children, className, ...props }: any) => {
  return (
      className={cn("border rounded-xl border-zinc-700 mb-4 p-6", className)}

export default Border;

Is the language auto-inferred based on the contents? This is frustrating since we’re building an app for AI code modification.

I tested your file and it does trigger an error when uploading in Assistants API file for retrieval. But looking at the Supported files table, TS is supported for Code Intrepreter but not for Retrieval.

I’m using this for just code interpreter. I also tried changing the file extension, but still it doesn’t upload.

I ran into something that is possibly related?

When assistants were first released I used scripts in the knowledge to extend their functionality and it was great. Really great.

At some point (after a week or two?) gpts started complaining about ‘external scripts’ when trying to run scripts from the knowledge.

At around the same time querying the python environment went from basically being at the terminal with an AI driving (mind blowing) to ‘I’m sorry dave, I’m afraid I can’t do that’. I experimented with what had changed and workarounds, but it all got to be too much hassle to make it worthwhile. Fair enough, I was very surprised at how much control I had over their system. Hopefully when the dust settles we’ll get a happy medium. May be unrelated, just wanted to share my observations as the more I hear about other peoples experiences, the more some things that were difficult to understand are making some sense. Hopefully this sheds a little light on something for someone.