MCPcopy Create free account
hub / github.com/CL-lau/SQL-GPT / batchQueryByEmbedding

Method batchQueryByEmbedding

embedding/embeddingHelper.py:197–224  ·  view source on GitHub ↗
(self, embeddings, topK=5, where=None, where_document=None)

Source from the content-addressed store, hash-verified

195 return result[0]
196
197 def batchQueryByEmbedding(self, embeddings, topK=5, where=None, where_document=None):
198 if where is None:
199 if where_document is None:
200 result = self.collection.query(
201 query_embeddings=embeddings,
202 n_results=topK
203 )
204 else:
205 result = self.collection.query(
206 query_embeddings=embeddings,
207 n_results=topK,
208 )
209 else:
210 if where_document is None:
211 result = self.collection.query(
212 query_embeddings=embeddings,
213 n_results=topK,
214 where=where
215 )
216 else:
217 result = self.collection.query(
218 query_embeddings=embeddings,
219 n_results=topK,
220 where=where
221 )
222
223 result = self.processResult(result=result)
224 return result
225
226 def saveFile(self, fileName, filePath, chunk_size=500, chunk_overlap=0, text_splitter=None, autoSpliter=False,
227 csv_delimiter=",",

Callers

nothing calls this directly

Calls 2

processResultMethod · 0.95
queryMethod · 0.80

Tested by

no test coverage detected