Skip to content

Delete vector store

client.VectorStores.Delete(ctx, vectorStoreID) (*VectorStoreDeleted, error)
DELETE/vector_stores/{vector_store_id}

Delete a vector store.

ParametersExpand Collapse
vectorStoreID string
ReturnsExpand Collapse
type VectorStoreDeleted struct{…}
ID string
Deleted bool
Object VectorStoreDeleted

Delete vector store

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAPIKey("My API Key"),
  )
  vectorStoreDeleted, err := client.VectorStores.Delete(context.TODO(), "vector_store_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", vectorStoreDeleted.ID)
}
{
  "id": "id",
  "deleted": true,
  "object": "vector_store.deleted"
}
Returns Examples
{
  "id": "id",
  "deleted": true,
  "object": "vector_store.deleted"
}