Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
只需更改 Base URL,即可在 Conare 上运行你的 turbopuffer 代码和 SDK:支持的写入、查询和命名空间调用,以及速率和大小限制。
https://api.conare.ai/tpuf
curl https://api.conare.ai/tpuf/v2/namespaces/products/query \ -H "Authorization: Bearer $CONARE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"rank_by": ["vector", "ANN", [0.1, 0.2, 0.3, 0.4]], "top_k": 10}'
import os import turbopuffer tpuf = turbopuffer.Turbopuffer( api_key=os.environ["CONARE_API_KEY"], region="gcp-us-central1", # any value: Conare ignores it base_url="https://api.conare.ai/tpuf/{region}", ) ns = tpuf.namespace("products") ns.write( upsert_rows=[{"id": 1, "vector": [0.1, 0.2, 0.3, 0.4], "title": "refunds"}], distance_metric="cosine_distance", ) result = ns.query(rank_by=("vector", "ANN", [0.1, 0.2, 0.3, 0.4]), top_k=10)
{ "billing": { "billable_logical_bytes_queried": 0, "billable_logical_bytes_returned": 0 }, "performance": { "cache_hit_ratio": 1.0, "cache_temperature": "hot", "query_execution_ms": 0, "server_total_ms": 0 }, "rows": [{ "$dist": 0.0, "id": 1 }] }
Count
cosine_distance
euclidean_squared
top_k
group_by
400
此页面对您有帮助吗?