Skip to contents

Inserts or updates vectors in an index. If a vector with the same ID exists, it will be overwritten.

Usage

vector_upsert(index, vectors, name_space = "")

Arguments

index

Name of the index

vectors

List of vectors to upsert. Each vector should be a list with: - id: Vector ID (character) - values: Vector values (numeric vector) - metadata: Optional metadata (list)

name_space

Namespace to upsert into (default: "")

Value

List with http response, content (upserted count), and status_code

Examples

if (FALSE) { # \dontrun{
# Upsert a single vector
vector_upsert("my-index", vectors = list(
  list(id = "vec1", values = rep(0.1, 1536), metadata = list(category = "A"))
))

# Upsert multiple vectors
vector_upsert("my-index", vectors = list(
  list(id = "vec1", values = rep(0.1, 1536)),
  list(id = "vec2", values = rep(0.2, 1536))
))
} # }