I'm using openai-python@v1.1.0 SDK to upload files and create a retrieval assistant like this:
client = OpenAI()
# file creation works
client.files.create(file=Path("schema.csv"), purpose="assistants")
# error is thrown when creating an assistant
assistant = client.beta.assistants.create(
name="SQL Assistant",
model="gpt-4-1106-preview",
tools=[{"type": "retrieval"}],
file_ids=[file.id],
instructions="You're a general purpose SQL assistant.",
)
I get this error when passing in a CSV file:
openai.BadRequestError: Error code: 400 - {'error': {'message': 'Failed to index file: Unsupported file file-v4z09tCj72aswCfxmUJB9Ggq type: application/csv', 'type': 'invalid_request_error', 'param': None, 'code': None}}
...and this error when passing in a JSON file:
openai.BadRequestError: 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}}
... even though csv and json file types are listed as supported.
The files in question are well-formed, short, and simple (they describe a table schema with three columns).
I've followed instructions here closely: https://platform.openai.com/docs/assistants/how-it-works/agents
Am I doing something obviously wrong? Or is the assistant API broken?