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

Function ann_vector

tests/load-test.py:174–185  ·  view source on GitHub ↗
(idd, vector_db_name, vector)

Source from the content-addressed store, hash-verified

172
173
174def ann_vector(idd, vector_db_name, vector):
175 url = f"{base_url}/collections/{vector_db_name}/search/dense"
176 data = {"query_vector": vector, "top_k": 5} # Corrected body
177 response = requests.post(
178 url, headers=generate_headers(), data=json.dumps(data), verify=False
179 )
180 if response.status_code != 200:
181 print(f"Error response: {response.text}")
182 raise Exception(f"Failed to search vector: {response.status_code}")
183 result = response.json()
184
185 return (idd, result)
186
187
188# Function to generate a random vector with given constraints

Callers 2

search_dataset_vectorsFunction · 0.90
searchFunction · 0.85

Calls 1

generate_headersFunction · 0.70

Tested by

no test coverage detected