Skip to main content
Version: V1.1.0

list_collections - Get a list of collections

The list_collections() API is used to obtain all collections.

info

This API is supported only when you use a Client. For more information about the Client, see Client.

Prerequisites

  • You have installed pyseekdb. For more information about how to install pyseekdb, see Quick Start.

  • You have connected to the database. For more information about how to connect to the database, see Client.

Request parameters

client.list_collections()

Request example

import pyseekdb

# Create a client
client = pyseekdb.Client()

# List all collections
collections = client.list_collections()
for coll in collections:
print(f"Collection: {coll.name}, Dimension: {coll.dimension}, embedding_function: {coll.embedding_function}, distance: {coll.distance}, metadata: {coll.metadata}")

Response parameters

ParameterTypeRequiredDescriptionExample value
namestringYesThe name of the collection.my_collection
dimensionintNoVector dimension.384
embedding_functionEmbeddingFunctionNoThe embedding function used by the collection.DefaultEmbeddingFunction(model_name='all-MiniLM-L6-v2')
distancestringNoDistance metric.cosine
metadatadictNoReserved; currently unused.

Response example

Collection: my_collection, Dimension: 384, embedding_function: DefaultEmbeddingFunction(model_name='all-MiniLM-L6-v2'), distance: cosine, metadata: {}
Database has 1 collections