weaviate cli
v3.1.0
直接從您的終端管理和與編織矢量數據庫進行管理和交互的強大命令行接口。
使用PIP安裝:
pip install weaviate-cli在Mac上,使用Homebrew安裝:
brew install weaviate-cli # Show available commands
weaviate-cli --help
# Create a collection
weaviate-cli create collection --collection movies --vectorizer transformers
# Import test data
weaviate-cli create data --collection movies --limit 1000
# Query data
weaviate-cli query data --collection movies --search-type hybrid --query " action movies " 編織CLI允許您通過配置文件配置群集端點和參數。默認情況下,CLI在~/.config/weaviate/config.json上尋找配置文件。如果此文件不存在,將使用以下默認值創建它:
{
"host" : " localhost " ,
"http_port" : " 8080 " ,
"grpc_port" : " 50051 "
}您還可以使用--config-file選項指定自己的配置文件:
weaviate-cli --config-file /path/to/your/config.json配置文件應為具有以下結構的JSON文件:
{
"host" : " your-weaviate-host " ,
"http_port" : " your-http-port " ,
"grpc_port" : " your-grpc-port " ,
"auth" : {
"type" : " api_key " ,
"api_key" : " your-api-key "
}
}如果您使用的是遠程編織實例,則可以使用weaviate-cli命令使用Weaviate實例進行身份驗證。在這裡,您可以看到一個有關配置文件的示例,如果您要連接到WCD群集:
{
"host" : " thisisaninventedcluster.url.s3.us-west3.prov.weaviate.cloud " ,
"auth" : {
"type" : " api_key " ,
"api_key" : " jfeRFsdfRfSasgsDoNOtTrYToUsErRQwqqdZfghasd "
},
"headers" :{
"X-OpenAI-Api-Key" : " OPEN_AI_KEY " ,
"X-Cohere-Api-Key" : " Cohere_AI_KEY " ,
"X-JinaAI-Api-Key" : " JINA_AI_KEY "
}
}如果要允許在集群中使用不同的用戶對不同的操作,則可以在配置文件中指定不同的用戶,並使用--user選項指定用於特定操作的用戶。配置文件的外觀示例如下:
{
"host" : " your-weaviate-host " ,
"auth" : {
"type" : " user " ,
"user1" : " your-api-key-for-user1 " ,
"user2" : " your-api-key-for-user2 "
}
}重要的是要注意,必須將“類型”鍵設置為“用戶”,並且必須在“身份”部分中指定用戶。使用weaviate-cli命令時,您可以使用--user選項指定用戶用於操作。例如:
weaviate-cli --user user1 create collection --collection movies --vectorizer transformers
weaviate-cli --user user2 get collection --collection movies詳細的文檔將很快添加。
weaviate標籤搜索我們歡迎捐款!有關詳細信息,請參閱我們的貢獻指南。
BSD-3-CAREASE許可證