kolzchut-ragbot 1.6.0__py3-none-any.whl → 1.6.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.
Potentially problematic release.
This version of kolzchut-ragbot might be problematic. Click here for more details.
- kolzchut_ragbot/engine.py +0 -36
- kolzchut_ragbot/llm_client.py +1 -1
- {kolzchut_ragbot-1.6.0.dist-info → kolzchut_ragbot-1.6.1.dist-info}/METADATA +1 -1
- {kolzchut_ragbot-1.6.0.dist-info → kolzchut_ragbot-1.6.1.dist-info}/RECORD +6 -6
- {kolzchut_ragbot-1.6.0.dist-info → kolzchut_ragbot-1.6.1.dist-info}/WHEEL +0 -0
- {kolzchut_ragbot-1.6.0.dist-info → kolzchut_ragbot-1.6.1.dist-info}/top_level.txt +0 -0
kolzchut_ragbot/engine.py
CHANGED
|
@@ -286,42 +286,6 @@ class Engine:
|
|
|
286
286
|
full_document = unite_docs_to_single_instance(parts_of_documents)
|
|
287
287
|
return full_document
|
|
288
288
|
|
|
289
|
-
def transform_document_to_full_page(self, document: dict) -> dict:
|
|
290
|
-
"""
|
|
291
|
-
Adds the full page content to the document by retrieving it from Elasticsearch.
|
|
292
|
-
|
|
293
|
-
Args:
|
|
294
|
-
document (dict): The document to which the full page content will be added.
|
|
295
|
-
|
|
296
|
-
Returns:
|
|
297
|
-
dict: The updated document with the full page content added.
|
|
298
|
-
"""
|
|
299
|
-
if not document.get("page_id"):
|
|
300
|
-
return document
|
|
301
|
-
full_document = self.get_full_document_by_page_id(document["page_id"])
|
|
302
|
-
if full_document and full_document.get("content"):
|
|
303
|
-
document["content"] = full_document["content"]
|
|
304
|
-
return document
|
|
305
|
-
|
|
306
|
-
def get_full_document_by_page_id(self, page_id: int) -> dict | None:
|
|
307
|
-
"""
|
|
308
|
-
Retrieves a unified document instance for a given page_id by searching all indices in Elasticsearch.
|
|
309
|
-
|
|
310
|
-
Args:
|
|
311
|
-
page_id (int): The page ID to search for.
|
|
312
|
-
|
|
313
|
-
Returns:
|
|
314
|
-
dict | None: A single dict representing the united document (with metadata and concatenated content),
|
|
315
|
-
or None if no documents are found.
|
|
316
|
-
"""
|
|
317
|
-
es_client = self.elastic_model.es_client
|
|
318
|
-
indices = es_client.indices.get_alias(index="*").keys()
|
|
319
|
-
parts_of_documents = find_page_id_in_all_indices(page_id=page_id, es_client=es_client, indices=indices)
|
|
320
|
-
if not parts_of_documents:
|
|
321
|
-
return None
|
|
322
|
-
full_document = unite_docs_to_single_instance(parts_of_documents)
|
|
323
|
-
return full_document
|
|
324
|
-
|
|
325
289
|
|
|
326
290
|
engine = None
|
|
327
291
|
|
kolzchut_ragbot/llm_client.py
CHANGED
|
@@ -7,5 +7,5 @@ class LLMClient(ABC):
|
|
|
7
7
|
def __init__(self):
|
|
8
8
|
self.field_for_answer = definitions.field_for_llm
|
|
9
9
|
@abstractmethod
|
|
10
|
-
def answer(self, _question, _top_k_docs) -> tuple[str, float, int]:
|
|
10
|
+
def answer(self, _question, _top_k_docs) -> tuple[str, float, int, dict]:
|
|
11
11
|
raise NotImplementedError
|
|
@@ -2,11 +2,11 @@ kolzchut_ragbot/Document.py,sha256=5OyBBTZyAJFM_1Pjs3SUC-_s5zEJ5U6wjhw12_FFkdE,3
|
|
|
2
2
|
kolzchut_ragbot/IntegrateService.py,sha256=rcwUY2RkclCY3l8BGAmNbstdxhxwhLO9oA8BofqLyts,96
|
|
3
3
|
kolzchut_ragbot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
kolzchut_ragbot/config.py,sha256=uILFvgn9W92-NRaKXYtaoQXpn3KOWKK8SZYRsIAa5Yw,133
|
|
5
|
-
kolzchut_ragbot/engine.py,sha256=
|
|
5
|
+
kolzchut_ragbot/engine.py,sha256=XYjRRZqpilDKLXEgl_uCtmRx9VQAk9NOkXRhcI_QEio,12327
|
|
6
6
|
kolzchut_ragbot/get_full_documents_utilities.py,sha256=YWljmGWM6h1ghLDCAUnDdhmn-0k6R_t7b1g7wSojzvg,1882
|
|
7
|
-
kolzchut_ragbot/llm_client.py,sha256=
|
|
7
|
+
kolzchut_ragbot/llm_client.py,sha256=JdDeOn2THpkOM2Mwe2DucTaYXul1fL2agIisBuHFtc8,347
|
|
8
8
|
kolzchut_ragbot/model.py,sha256=HCi3r4YztPknnbgTOA7I-GVaqxn8CzrTeLFkEg-7fg0,6320
|
|
9
|
-
kolzchut_ragbot-1.6.
|
|
10
|
-
kolzchut_ragbot-1.6.
|
|
11
|
-
kolzchut_ragbot-1.6.
|
|
12
|
-
kolzchut_ragbot-1.6.
|
|
9
|
+
kolzchut_ragbot-1.6.1.dist-info/METADATA,sha256=A_3mNTQVAfjrpV1R3P7jQ4fFEzxdjL3vlqyNGoUCDdY,1999
|
|
10
|
+
kolzchut_ragbot-1.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
kolzchut_ragbot-1.6.1.dist-info/top_level.txt,sha256=NTZoY4GGw3v_7jm0MgcdHw8simoZ78PsR7Meqmkgd_Q,16
|
|
12
|
+
kolzchut_ragbot-1.6.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|