Retrieval tool file_ids keyword not found

I am trying to create an assistant using the “type”:“retrieval” tool but it’s throwing the below error.

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

Below is the code I am using:

client.beta.assistants.create(name='reader ai', instructions='You are a file reader who helps with files', tools=[{"type": "retrieval"}], model=model, file_ids=[])

I could not find the reference in the api for file_ids. Is this deprecated or replaced with something else?

The ID is the ID number of a file once it has been uploaded to the file storage of your organization.

The python sdk now uses beta v2 assistants as the header. No more retrieve. This means you:

  • upload files with purpose assistants
  • create a vector store
  • add file ids to vector store
  • specify vector store to the assistant during .create():

to create a file search instead of retrieve.

You can see a second method for reducing the number of calls. but the path I describe lets you ensure that you capture and administer all the IDs you need for future operations in a straightforward (ahem) manner.

1 Like