EmbedInDB
v0.2.1
EMBEDIN เป็นฐานข้อมูลเวกเตอร์โอเพ่นซอร์สและไลบรารีที่มีประสิทธิภาพซึ่งแปลงฐานข้อมูลยอดนิยมได้อย่างราบรื่นเช่น MySQL, PostgreSQL และ MS SQL Server เป็นฐานข้อมูลเวกเตอร์ที่มีความพยายามเป็นศูนย์
EMBEDIN เป็นโซลูชันที่เหมาะสำหรับแอปพลิเคชัน AI เช่นการประมวลผลภาษาธรรมชาติการจดจำภาพและระบบคำแนะนำที่นำเสนอการจัดทำดัชนีและการดึงข้อมูลอย่างรวดเร็ว ภาษา API และแบบสอบถามที่เรียบง่ายช่วยให้มั่นใจได้ว่าการใช้งานง่ายและการรวมที่ไร้รอยต่อ
Python 3.7 หรือสูงกว่า
pip install embedin from embedin import Embedin
client = Embedin ( collection_name = "test_collection" , texts = [ "This is a test" , "Hello world!" ])
result = client . query ( "These are tests" , top_k = 1 ) # Query the most similar text from the collection
print ( result ) from embedin import Embedin
url = 'sqlite:///test.db'
client = Embedin ( collection_name = "test_collection" , texts = [ "This is a test" , "Hello world!" ], url = url )
result = client . query ( "These are tests" , top_k = 1 ) cd docker
docker-compose up embedin-postgresตัวอย่าง
import os
from embedin import Embedin
url = os . getenv ( 'EMBEDIN_POSGRES_URL' , "postgresql+psycopg2://embedin:embedin@localhost/embedin_db" )
client = Embedin ( collection_name = "test_collection" , texts = [ "This is a test" , "Hello world!" ], url = url )
result = client . query ( "These are tests" , top_k = 1 ) cd docker
docker-compose up embedin-mysqlตัวอย่าง
import os
from embedin import Embedin
url = os . getenv ( 'EMBEDIN_MYSQL_URL' , "mysql+pymysql://embedin:embedin@localhost/embedin_db" )
client = Embedin ( collection_name = "test_collection" , texts = [ "This is a test" , "Hello world!" ], url = url )
result = client . query ( "These are tests" , top_k = 1 ) cd docker
docker-compose up embedin-mssqlตัวอย่าง
import os
from embedin import Embedin
url = os . getenv ( 'EMBEDIN_MSSQL_URL' , "mssql+pymssql://sa:StrongPassword123@localhost/tempdb" )
client = Embedin ( collection_name = "test_collection" , url = url )
client . add_data ( texts = [ "This is a test" ], meta_data = [{ "source" : "abc4" }])
result = client . query ( "These are tests" , top_k = 1 )โปรดอ้างอิงคู่มือผู้มีส่วนร่วม