MCPcopy Create free account
hub / github.com/cosdata/cosdata / create_explicit_index

Function create_explicit_index

tests/load-test.py:68–92  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

66
67
68def create_explicit_index(name):
69 data = {
70 "name": name,
71 "distance_metric_type": "cosine",
72 "quantization": {"type": "auto", "properties": {"sample_threshold": 100}},
73 "index": {
74 "type": "hnsw",
75 "properties": {
76 "num_layers": 7,
77 "max_cache_size": 1000,
78 "ef_construction": 512,
79 "ef_search": 256,
80 "neighbors_count": 32,
81 "level_0_neighbors_count": 64,
82 },
83 },
84 }
85 response = requests.post(
86 f"{base_url}/collections/{name}/indexes/dense",
87 headers=generate_headers(),
88 data=json.dumps(data),
89 verify=False,
90 )
91
92 return response.json()
93
94
95# Function to create database (collection)

Callers 1

load-test.pyFile · 0.70

Calls 1

generate_headersFunction · 0.70

Tested by

no test coverage detected