อินเทอร์เฟซบรรทัดคำสั่งที่ทรงพลังสำหรับการจัดการและโต้ตอบกับฐานข้อมูลเวกเตอร์ทอผ้าโดยตรงจากเทอร์มินัลของคุณ
ติดตั้งโดยใช้ 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 " Weaviate 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 "
}
} สิ่งสำคัญคือต้องทราบว่าต้องตั้งค่าคีย์ "ประเภท" เป็น "ผู้ใช้" และผู้ใช้จะต้องระบุในส่วน Auth เมื่อใช้คำสั่ง weaviate-cli คุณสามารถระบุผู้ใช้เพื่อใช้สำหรับการดำเนินการโดยใช้ตัวเลือก --user ใช้ ตัวอย่างเช่น:
weaviate-cli --user user1 create collection --collection movies --vectorizer transformers
weaviate-cli --user user2 get collection --collection moviesเอกสารรายละเอียดจะถูกเพิ่มในไม่ช้า
weaviateเรายินดีต้อนรับผลงาน! โปรดดูแนวทางการสนับสนุนของเราสำหรับรายละเอียด
ใบอนุญาต BSD-3-Clause