listCollections - Collectionsリストの取得
listCollections()は、すべてのCollectionを取得するために使用されます。
備考
このインターフェースは、SeekdbClient接続を使用する場合にのみ利用できます。SeekdbClientの詳細については、SeekdbClientを参照してください。
前提条件
-
seekdb-jsがインストール済みであること。seekdb-jsのインストール方法の詳細については、クイックスタートを参照してください。
-
seekdbサーバーモードがインストール済みであること。seekdbサーバーモードのインストール方法の詳細については、yum installによるseekdbのデプロイを参照してください。
-
データベースに接続されていること。接続の詳細な操作については、SeekdbClientを参照してください。
-
取得したCollectionが存在すること。Collectionが存在しない場合、エラーが表示されます。
リクエストパラメータ
listCollections()
リクエスト例
import { SeekdbClient } from "seekdb";
// 1. Connect
const client = new SeekdbClient({
host: "127.0.0.1",
port: 2881,
user: "root",
password: "",
database: "test",
});
const collections = await client.listCollections();
レスポンスパラメータ
| パラメータ | 値の種類 | 必須 | 説明 | 値の例 |
|---|---|---|---|---|
name | string | 必須 | クエリで取得したコレクションの名前。 | my_collection |
dimension | int | オプション | 384 | |
embeddingFunction | EmbeddingFunction | オプション | embeddingFunction: DefaultEmbeddingFunction {name: 'default-embed', pipe: null, modelName: 'Xenova/all-MiniLM-L6-v2', revision: undefined, dtype: undefined, cacheDir: undefined, localFilesOnly: undefined, progressCallback: undefined } | |
distance | string | オプション | cosine | |
metadata | dict | オプション | 予約フィールドです。現在データはありません。 |
レスポンス例
[
Collection {
name: 'my_collection',
dimension: 384,
distance: 'cosine',
embeddingFunction: DefaultEmbeddingFunction {
name: 'default-embed',
pipe: null,
modelName: 'Xenova/all-MiniLM-L6-v2',
revision: undefined,
dtype: undefined,
cacheDir: undefined,
localFilesOnly: undefined,
progressCallback: undefined
},
metadata: undefined
}
]