openvector_dev 0.1__py3-none-any.whl → 0.1.1__py3-none-any.whl

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.
lein_vector/api/facade.py CHANGED
@@ -1,8 +1,9 @@
1
+ from typing import Sequence, Union
1
2
  from uuid import uuid4
2
3
  from datetime import datetime, UTC
3
4
 
4
5
  from src.lein_vector import ShortTermMemory, QdrantAdapter, MemoryManagerQdrant
5
- from src.lein_vector.schemas.chunk import Chunk
6
+ from src.lein_vector.schemas.chunk import Chunk, ChunkPayload
6
7
  from src.lein_vector.sentence_transformer import EmbeddingProviderGemini
7
8
 
8
9
 
@@ -72,6 +73,7 @@ class MemoryFacade:
72
73
  """
73
74
  data = await self.step_user(user_id, user_msg, topk=topk, history_n=history_n)
74
75
  data["short_term"] = self._to_openai(data["short_term"])
76
+ data["long_term"] = self._chunk_texts(data["long_term"])
75
77
  return data
76
78
 
77
79
  @staticmethod
@@ -134,3 +136,8 @@ class MemoryFacade:
134
136
 
135
137
  async def add_to_long(self, user_id: int, chunk: Chunk) -> None:
136
138
  await self.long.upsert_chunk(user_id, chunk)
139
+
140
+ @staticmethod
141
+ def _chunk_texts(chunks: Sequence[Union[Chunk, ChunkPayload]]) -> list[str]:
142
+ """Вернуть список текстов из любых Chunk/ChunkPayload."""
143
+ return [c.text for c in chunks]
@@ -36,4 +36,3 @@ class ChunkPayload(BaseModel):
36
36
 
37
37
  def to_chunk(self, last_hit: datetime = None, hit_count: int = 0) -> Chunk:
38
38
  return Chunk(**self.model_dump(), last_hit=last_hit or datetime.now(UTC), hit_count=hit_count)
39
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openvector_dev
3
- Version: 0.1
3
+ Version: 0.1.1
4
4
  Summary:
5
5
  Author: p00ler
6
6
  Author-email: liveitspain@gmail.com
@@ -1,6 +1,6 @@
1
1
  lein_vector/__init__.py,sha256=wQVJu6E6SYyBD1B59WlpTBy0qZuo9aj3sVTnpGYtiIk,411
2
2
  lein_vector/api/__init__.py,sha256=hJoi39B0YxguI9YpjJRmz4IPIMgIA8ryn93ORrMB7S4,41
3
- lein_vector/api/facade.py,sha256=FAYTl4IRDc2-A7SPaP0IyY4qBoAViuX6OHzKva8zTmk,5377
3
+ lein_vector/api/facade.py,sha256=7UJ6m24mIwwVikYJjtJA6kTphl5h1HUuS16TJ6_NOpg,5731
4
4
  lein_vector/bases/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  lein_vector/bases/embeding_provider_abc.py,sha256=eWdyxto-5uhSU61pR28537UGZ6oeJ7Y5wol3abLg828,304
6
6
  lein_vector/bases/memory_manager_abc.py,sha256=uJS4F_UUUjhpHpsVt8JYcU6cLaEB68ELuJCn7DNoNzw,1568
@@ -8,9 +8,9 @@ lein_vector/memory_manager_qdrant.py,sha256=iM7enNUC0ZjOBcujI0J23cEf-J8svPittpKe
8
8
  lein_vector/memory_manager_ram.py,sha256=h6IDjm8J4XsU8nnLoUDF9x6NPKfH2dhj6-0OxrUNqa0,6041
9
9
  lein_vector/qdrant_adapter.py,sha256=ZhdnD7SR-aR0Ifk7qv7NcZtQ_G0Tt4no3a69PRm8DUM,3916
10
10
  lein_vector/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- lein_vector/schemas/chunk.py,sha256=UglfvFbfKPhHl8cJ3hmVBqbnadTcb3H9RKM6W1evBTc,1200
11
+ lein_vector/schemas/chunk.py,sha256=yt2Lb9zL9IJypQTJACVDlHkkS9_3clDoPpvn_5NBTi8,1198
12
12
  lein_vector/sentence_transformer.py,sha256=0styRoPg5Iq8mVtFWBnZKcQzGh-Tw1iV3r0_KC32JS4,2477
13
13
  lein_vector/short_term.py,sha256=bLfOFn7Yqd_tZURtQHOkXG5HEnOzmiCPs7Nk-RDjxWc,1913
14
- openvector_dev-0.1.dist-info/METADATA,sha256=0HsdBQ1ognZ4TCZIu5cOiRhtaMg8M07Q72THyoFApI0,3127
15
- openvector_dev-0.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
16
- openvector_dev-0.1.dist-info/RECORD,,
14
+ openvector_dev-0.1.1.dist-info/METADATA,sha256=yxYx01ONEDuPTvzmKcuxtXupTKCqq4CsFAR7TX29Jc8,3129
15
+ openvector_dev-0.1.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
16
+ openvector_dev-0.1.1.dist-info/RECORD,,