So, seems like I’m a little bit confused by OpenAI documentation and openai package for Python differences, currently I’m in the process of migrating to the latest version of this package which seems to be a ‘1.24.0’, I’m following documentation guidance of how to create vector store to add the files into assistant and they are using the method ‘create_and_poll’ like this ‘client.beta.vector_stores.create_and_poll’, however, I’m receiving an error: AttributeError: ‘VectorStores’ object has no attribute ‘create_and_poll’
I’ve looked inside Python’s SDK and it turned out that VectoreStore doesn’t have the ‘create_and_poll’ method, so maybe some experienced users of the API could explain why this difference between documentation and real SDK exists.
Maybe I could use another library in order to get this function, as I would be very happy to use ‘create_and_poll’ instead of polling by myself…)
assistant = client.beta.assistants.create(
instructions="You are a helpful product support assistant and you answer questions based on the files provided to you.",
model="gpt-4-turbo",
tools=[{"type": "file_search"}],
tool_resources={
"file_search": {
"vector_store_ids": ["vs_1"]
}
}
)
thread = client.beta.threads.create(
messages=[ { "role": "user", "content": "How do I cancel my subscription?"} ],
tool_resources={
"file_search": {
"vector_store_ids": ["vs_2"]
}
}
)