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

Method similarity_search

embedding/embeddingHelper.py:564–570  ·  view source on GitHub ↗
(self, query: str, fileID: str, topK: int = 4)

Source from the content-addressed store, hash-verified

562 self.dbMap[dbId] = db
563
564 def similarity_search(self, query: str, fileID: str, topK: int = 4) -> list[str]:
565 db = self.dbMap[fileID]
566 docs = db.similarity_search(query, k=topK)
567 texts = []
568 for doc in docs:
569 texts.append(doc.page_content)
570 return texts
571
572
573@singleton

Callers

nothing calls this directly

Calls 1

similarity_searchMethod · 0.45

Tested by

no test coverage detected