openai.beta.vectorStores.createAndPoll does not exist

Hi,

I previously raised an issue about the node.js docs being wrong and mentioning
openai.vectorStores.createAndPoll instead of openai.beta.vectorStores.createAndPoll. That has now been fixed (sort of… see below), abd the topic closed.

Three things:

  • in the node.js client v4.38.3 the method openai.beta.vectorStores.createAndPoll does not exist. I mentioned this in my previous post but it might not have been clear. How are we supposed to use it?
  • I have another post called docx files uploaded via assistants end up with image png mime type (I can’t link…). That bug still exists.
  • All the docs in API Reference -> Assistants -> Vector Stores and Vector Stores Files sections incorrectly refer to openai.vectorStores (the API Reference -> Assistants -> Vector Stores Files -> Create vector store file doc is updated but nothing else)
3 Likes

ok I just understood what’s wrong, if you go to the vector-store.ts file you can see that createAndPoll doesn’t exist but create and update exists,

create(body: VectorStoreCreateParams, options?: Core.RequestOptions): Core.APIPromise<VectorStore> {
    return this._client.post('/vector_stores', {
      body,
      ...options,
      headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
    });
  }

  /**
   * Retrieves a vector store.
   */
  retrieve(vectorStoreId: string, options?: Core.RequestOptions): Core.APIPromise<VectorStore> {
    return this._client.get(`/vector_stores/${vectorStoreId}`, {
      ...options,
      headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
    });
  }

  /**
   * Modifies a vector store.
   */
  update(
    vectorStoreId: string,
    body: VectorStoreUpdateParams,
    options?: Core.RequestOptions,
  ): Core.APIPromise<VectorStore> {
    return this._client.post(`/vector_stores/${vectorStoreId}`, {
      body,
      ...options,
      headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
    });
  }

so if you want to modify or create you can do like that

const vectorStore = await openai.beta.vectorStores.create({
      name: "name ",
      file_ids: [file.id],
});     

Are we ever going to receive update for this? Documentation misdirects which leads to waste of time. “When interacting with the API some actions such as starting a Run and adding files to vector stores are asynchronous and take time to complete. The SDK includes helper functions which will poll the status until it reaches a terminal state and then return the resulting object. If an API method results in an action which could benefit from polling there will be a corresponding version of the method ending in ‘AndPoll’.”

However, openai.beta.vectorStores.createAndPoll does not exists. We fixed it by polling manually.