View Source OpenAi.VectorStores (OpenAI REST API Client v0.4.4)

Provides API endpoints related to vector stores

Summary

Functions

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

Create a vector store.

Create a vector store file by attaching a File to a vector store.

Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.

Returns a list of vector store files in a batch.

Returns a list of vector store files.

Returns a list of vector stores.

Functions

Link to this function

cancel_vector_store_file_batch(vector_store_id, batch_id, opts \\ [])

View Source
@spec cancel_vector_store_file_batch(String.t(), String.t(), keyword()) ::
  {:ok, OpenAi.VectorStore.File.Batch.t()} | {:error, OpenAi.Error.error()}

Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.

Link to this function

create_vector_store(body, opts \\ [])

View Source
@spec create_vector_store(
  OpenAi.VectorStore.CreateRequest.t(),
  keyword()
) :: {:ok, OpenAi.VectorStore.t()} | {:error, OpenAi.Error.error()}

Create a vector store.

Link to this function

create_vector_store_file(vector_store_id, body, opts \\ [])

View Source
@spec create_vector_store_file(
  String.t(),
  OpenAi.VectorStore.File.CreateRequest.t(),
  keyword()
) ::
  {:ok, OpenAi.VectorStore.File.t()} | {:error, OpenAi.Error.error()}

Create a vector store file by attaching a File to a vector store.

Link to this function

create_vector_store_file_batch(vector_store_id, body, opts \\ [])

View Source
@spec create_vector_store_file_batch(
  String.t(),
  OpenAi.VectorStore.File.Batch.CreateRequest.t(),
  keyword()
) :: {:ok, OpenAi.VectorStore.File.Batch.t()} | {:error, OpenAi.Error.error()}

Create a vector store file batch.

Link to this function

delete_vector_store(vector_store_id, opts \\ [])

View Source
@spec delete_vector_store(
  String.t(),
  keyword()
) ::
  {:ok, OpenAi.VectorStore.DeleteResponse.t()} | {:error, OpenAi.Error.error()}

Delete a vector store.

Link to this function

delete_vector_store_file(vector_store_id, file_id, opts \\ [])

View Source
@spec delete_vector_store_file(String.t(), String.t(), keyword()) ::
  {:ok, OpenAi.VectorStore.File.DeleteResponse.t()}
  | {:error, OpenAi.Error.error()}

Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the delete file endpoint.

Link to this function

get_vector_store(vector_store_id, opts \\ [])

View Source
@spec get_vector_store(
  String.t(),
  keyword()
) :: {:ok, OpenAi.VectorStore.t()} | {:error, OpenAi.Error.error()}

Retrieves a vector store.

Link to this function

get_vector_store_file(vector_store_id, file_id, opts \\ [])

View Source
@spec get_vector_store_file(String.t(), String.t(), keyword()) ::
  {:ok, OpenAi.VectorStore.File.t()} | {:error, OpenAi.Error.error()}

Retrieves a vector store file.

Link to this function

get_vector_store_file_batch(vector_store_id, batch_id, opts \\ [])

View Source
@spec get_vector_store_file_batch(String.t(), String.t(), keyword()) ::
  {:ok, OpenAi.VectorStore.File.Batch.t()} | {:error, OpenAi.Error.error()}

Retrieves a vector store file batch.

Link to this function

list_files_in_vector_store_batch(vector_store_id, batch_id, opts \\ [])

View Source
@spec list_files_in_vector_store_batch(String.t(), String.t(), keyword()) ::
  {:ok, OpenAi.VectorStore.File.ListResponse.t()}
  | {:error, OpenAi.Error.error()}

Returns a list of vector store files in a batch.

Options

  • limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

  • after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

  • before: A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

  • filter: Filter by file status. One of in_progress, completed, failed, cancelled.

Link to this function

list_vector_store_files(vector_store_id, opts \\ [])

View Source
@spec list_vector_store_files(
  String.t(),
  keyword()
) ::
  {:ok, OpenAi.VectorStore.File.ListResponse.t()}
  | {:error, OpenAi.Error.error()}

Returns a list of vector store files.

Options

  • limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

  • after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

  • before: A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

  • filter: Filter by file status. One of in_progress, completed, failed, cancelled.

Link to this function

list_vector_stores(opts \\ [])

View Source
@spec list_vector_stores(keyword()) ::
  {:ok, OpenAi.VectorStore.ListResponse.t()} | {:error, OpenAi.Error.error()}

Returns a list of vector stores.

Options

  • limit: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

  • order: Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.

  • after: A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

  • before: A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Link to this function

modify_vector_store(vector_store_id, body, opts \\ [])

View Source
@spec modify_vector_store(String.t(), OpenAi.VectorStore.UpdateRequest.t(), keyword()) ::
  {:ok, OpenAi.VectorStore.t()} | {:error, OpenAi.Error.error()}

Modifies a vector store.