What kind of format does Attachments parameter require?

I want to create thread message but I dont know what type I should pass tp the “attachments” object.

The file_id is the value returned by uploading a file to your account’s file storage.

The "tools" array takes a {“type”:“file_search”} object to add to a thread vector store automatically, and/or {“type”:"code_interpreter} to instantiate or continue a code interpreter session with that file available. Not a string ‘assistants’.

An example direct from documents:

# Create a thread and attach the file to the message
thread = client.beta.threads.create(
  messages=[
    {
      "role": "user",
      "content": "How many bananas purchased in 2023?",
      # Attach the new file to the message.
      "attachments": [
        { "file_id": message_file.id, "tools": [{"type": "file_search"}] }
      ],
    }
  ]
)

The AI is unlikely to infer the need to search for an answer about bananas without some more user prompt talking about what the user attached, or system instruction enhancing the need to call myfiles_browser tool before answering.

The files types themselves are limited to those supported for document extraction when you upload with purpose:assistants.

The attachments are not the entire document for the AI to read, but only the results of doing a similarity search of chunks across all connected vector store documents.