Skip to contents

qdrant_upsert_points establishes a connection with a qdrant instance and insert points (vector) in a collection. '

Usage

qdrant_upsert_points(
  conn,
  points = list(),
  collection_name,
  generate_id = TRUE
)

Arguments

conn

a connection object created by get_qdrant_connection()

points

a list containing vector embeddings. A very specific format is expected. Here is the format that is expected (example of a vector of size 3): list(points=list(list(id=1, payload=list(text="hi there"), vector=list(0.1,0.5,0.6)))) Note that 'payload' can contain a lot more data than 'text'. You can add more variables if needed within the payload list.

collection_name

the name of the collection you want to use. Defaults to NA.

generate_id

boolean, defaults to TRUE. If TRUE, will automatically create a unique UUID for your vector, as it is needed by qdrant. If you don't use this, you have to provide an id by yourself.

Details

Inserts vector entries into an existing collection.

Examples

conn <- get_qdrant_connection()
#> → Connection to Qdrant confirmed
qdrant_create_new_collection(conn, collection_name="test_db",
vectors=list(size=3,distance="Cosine"))
#> → Collection test_db was just created on the qdrant instance.
new_vectors <- list(points=list(list(payload=list(text="hi there"),
                      vector=list(0.1,0.5,0.6))))
qdrant_upsert_points(conn, points=new_vectors,
collection_name="test_db",generate_id=TRUE)
#> → Vectors were added in the test_db collection on the qdrant instance.
qdrant_delete_collection(conn, "test_db")
#> → Collection test_db was just deleted on the qdrant instance.