(self, query: str, top_k=5)
| 113 | return results |
| 114 | |
| 115 | async def query(self, query: str, top_k=5): |
| 116 | embedding = await self.embedding_func([query]) |
| 117 | embedding = embedding[0] |
| 118 | results = self._client.query( |
| 119 | query=embedding, |
| 120 | top_k=top_k, |
| 121 | better_than_threshold=self.cosine_better_than_threshold, |
| 122 | ) |
| 123 | results = [ |
| 124 | {**dp, "id": dp["__id__"], "distance": dp["__metrics__"]} for dp in results |
| 125 | ] |
| 126 | return results |
| 127 | |
| 128 | @property |
| 129 | def client_storage(self): |
nothing calls this directly
no outgoing calls
no test coverage detected