Following a comment by @furas, I changed the code to use the attachments keyword instead of file_ids, and now it works. Here's the corrected code:
# Create a new assistant
assistant = client.beta.assistants.create(
name="Seminar HTML to CSV Assistant",
instructions=instructions,
model="gpt-4",
tools=[{"type": "code_interpreter"}],
)
# Create a thread
thread = client.beta.threads.create()
# Create a message with the uploaded file
message = client.beta.threads.messages.create(
thread_id=thread.id,
role="user",
content="Here is the HTML content for the seminar page.",
attachments=[{"file_id": file.id, "tools": [{"type": "code_interpreter"}]}]
)
# Run the assistant
run = client.beta.threads.runs.create(
thread_id=thread.id,
assistant_id=assistant.id
)