了解如何以客户端-服务器模式运行 Chroma。
chroma run --path /db_path
HttpClient
import chromadb chroma_client = chromadb.HttpClient(host='localhost', port=8000)
client-server
AsyncHttpClient
import asyncio import chromadb async def main(): client = await chromadb.AsyncHttpClient() collection = await client.create_collection(name="my_collection") await collection.add( documents=["hello world"], ids=["id1"] ) asyncio.run(main())
ChromaClient
import { ChromaClient } from "chromadb"; const client = new ChromaClient();
host
port
ssl
import { ChromaClient } from "chromadb"; const client = new ChromaClient({ host: "YOUR-HOST", port: "YOUR-PORT", ssl: true, });
ChromaHttpClient
let options = ChromaHttpClientOptions { endpoint: "https://:8000".parse()?, ..Default::default() }; let client = ChromaHttpClient::new(options);
此页面是否有帮助?