openvector_dev 0.1.24__tar.gz → 0.1.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/PKG-INFO +1 -1
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/pyproject.toml +1 -1
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/api/facade.py +1 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/qdrant_adapter.py +15 -8
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/README.md +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/__init__.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/api/__init__.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/bases/__init__.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/bases/embeding_provider_abc.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/bases/memory_manager_abc.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/memory_manager_qdrant.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/memory_manager_ram.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/redis_short_term.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/schemas/__init__.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/schemas/chunk.py +0 -0
- {openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/sentence_transformer.py +0 -0
|
@@ -142,6 +142,7 @@ class Memory:
|
|
|
142
142
|
await self.long.upsert_chunk_with_vector(new_chunk, vector)
|
|
143
143
|
|
|
144
144
|
if curr_no % (block_size * self.merge_n) == 0:
|
|
145
|
+
log.debug(f'Summary requested {bot}:{user_id}')
|
|
145
146
|
merged_text, used_ids = await self.long.merge_old_chunks(
|
|
146
147
|
user_id=user_id, bot=bot, chunk_type="type0", n=self.merge_n
|
|
147
148
|
)
|
|
@@ -139,21 +139,28 @@ class QdrantAdapter:
|
|
|
139
139
|
bot: str,
|
|
140
140
|
chunk_type: str,
|
|
141
141
|
n: int = 5,
|
|
142
|
-
):
|
|
143
|
-
|
|
142
|
+
) -> list[ChunkPayload]:
|
|
143
|
+
flt = Filter(
|
|
144
144
|
must=[
|
|
145
145
|
FieldCondition(key="user_id", match=MatchValue(value=user_id)),
|
|
146
146
|
FieldCondition(key="bot", match=MatchValue(value=bot)),
|
|
147
147
|
FieldCondition(key="chunk_type", match=MatchValue(value=chunk_type)),
|
|
148
148
|
]
|
|
149
149
|
)
|
|
150
|
-
|
|
150
|
+
|
|
151
|
+
# собираем все подходящие точки одной командой
|
|
152
|
+
points, _ = await self.client.scroll(
|
|
151
153
|
collection_name=self.collection,
|
|
152
|
-
|
|
153
|
-
query_filter=q_filter,
|
|
154
|
-
limit=n,
|
|
154
|
+
scroll_filter=flt,
|
|
155
155
|
with_payload=True,
|
|
156
156
|
with_vectors=False,
|
|
157
|
-
|
|
157
|
+
limit=10_00,
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
# сортируем по времени создания
|
|
161
|
+
sorted_points = sorted(
|
|
162
|
+
(ChunkPayload(**p.payload) for p in points),
|
|
163
|
+
key=lambda p: p.created_at,
|
|
158
164
|
)
|
|
159
|
-
|
|
165
|
+
|
|
166
|
+
return sorted_points[:n]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openvector_dev-0.1.24 → openvector_dev-0.1.26}/src/lein_vector/bases/embeding_provider_abc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|