Returns canned hits; records calls for assertions.
| 65 | |
| 66 | |
| 67 | class FakeVectorStore: |
| 68 | """Returns canned hits; records calls for assertions.""" |
| 69 | |
| 70 | def __init__(self, hits: list[VectorHit] | None = None): |
| 71 | self.hits = hits if hits is not None else list(SAMPLE_HITS) |
| 72 | self.last_query_args: dict | None = None |
| 73 | |
| 74 | def query(self, vector, vector_filter, top_k): |
| 75 | self.last_query_args = { |
| 76 | "vector": vector, |
| 77 | "vector_filter": vector_filter, |
| 78 | "top_k": top_k, |
| 79 | } |
| 80 | return self.hits[:top_k] |
| 81 | |
| 82 | # Stubs for VectorStorePort mutations (not exercised in match tests) |
| 83 | def ensure_collection(self, dimension): ... |
| 84 | def delete_collection(self): ... |
| 85 | def collection_info(self): ... |
| 86 | def upsert_batch(self, ads_with_embeddings): ... |
| 87 | def delete_ad(self, ad_id): ... |
| 88 | def get_ad(self, ad_id): ... |
| 89 | |
| 90 | |
| 91 | # --------------------------------------------------------------------------- |
no outgoing calls