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
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
name | string | Yes | The name of the queried collection. | my_collection |
dimension | int | No | 384 | |
embedding_function | EmbeddingFunction | No | DefaultEmbeddingFunction(model_name='all-MiniLM-L6-v2') | |
distance | string | No | cosine | |
metadata | dict | No | Reserved field. No data is returned. |
Response example
Collection: my_collection, Dimension: 384, embedding_function: DefaultEmbeddingFunction(model_name='all-MiniLM-L6-v2'), distance: cosine, metadata: {}
Database has 1 collections