メインコンテンツまでスキップ
バージョン: V1.1.0

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();

レスポンスパラメータ​

パラメータ値の種類必須説明値の例
namestring必須クエリで取得したコレクションの名前。my_collection
dimensionintオプション384
embeddingFunctionEmbeddingFunctionオプションembeddingFunction: DefaultEmbeddingFunction {name: 'default-embed', pipe: null, modelName: 'Xenova/all-MiniLM-L6-v2', revision: undefined, dtype: undefined, cacheDir: undefined, localFilesOnly: undefined, progressCallback: undefined }
distancestringオプションcosine
metadatadictオプション予約フィールドです。現在データはありません。

レスポンス例​

[
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
}
]

関連操作​