TypeError: Messages.create() got an unexpected keyword argument 'file_ids'

After uploading some files and storing their ids in an array called files_id, I’m creating a message with the files_id.


message = client.beta.threads.messages.create(thread_id=my_thread.id,
                                                    role="user",
                                                    content=user_message,
                                                  file_ids=files_id
      )

Getting TypeError: Messages.create() got an unexpected keyword argument ‘file_ids’.

1 Like

You have to use attachments to attach files and tools:

      "attachments": [
        { "file_id": message_file.id, "tools": [{"type": "file_search"}] }
      ],
2 Likes