Skip to content

Commit 8027dc3

Browse files
committed
feat: removing GC from few shots
1 parent 9ca5ca9 commit 8027dc3

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/store/few_shots_store.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def __init__(self, memory_client: QdrantClient, vector_model: StaticModel):
1919
vector_model,
2020
'few_shots',
2121
"identifier",
22-
"identifier"
22+
"identifier",
23+
time_to_live=None,
2324
)
2425
self._load_models_from_json()
2526

src/store/vector_store.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(
2222
collection_name: str,
2323
payload_identifier: str,
2424
group_identifier: str,
25-
time_to_live: int = 60 * 5
25+
time_to_live: int | None = 60 * 5
2626

2727
):
2828
self.client = client
@@ -34,7 +34,8 @@ def __init__(
3434
self._id_counter = 0
3535
self._scheduler = None
3636
self._setup_collection()
37-
self._start_garbage_collector()
37+
if self.time_to_live is not None:
38+
self._start_garbage_collector()
3839

3940
def _setup_collection(self):
4041
if not self.client.collection_exists(collection_name=self.collection_name):
@@ -83,6 +84,9 @@ def _garbage_collect_all(self):
8384
log.error(f"[GC] Error in collection '{self.collection_name}': {e}")
8485

8586
def _reset_time_to_live(self, group_identifier: str):
87+
if self.time_to_live is None:
88+
return
89+
8690
items = self.get_all(group_identifier)
8791
current_time = time.time()
8892

0 commit comments

Comments
 (0)