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许可证