kolzchut-ragbot 1.7.4__py3-none-any.whl → 1.7.5__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.
kolzchut_ragbot/engine.py CHANGED
@@ -306,7 +306,13 @@ class Engine:
306
306
 
307
307
  # Combine documents
308
308
  top_k_documents_and_additional_document = top_k_documents.copy()
309
+ # Remove documents with the same page_id as the additional_document before appending
309
310
  if additional_document:
311
+ additional_page_id = additional_document.get("page_id")
312
+ top_k_documents_and_additional_document = [
313
+ doc for doc in top_k_documents_and_additional_document
314
+ if doc.get("page_id") != additional_page_id
315
+ ]
310
316
  top_k_documents_and_additional_document.append(additional_document)
311
317
 
312
318
  # Query LLM
@@ -326,14 +332,13 @@ class Engine:
326
332
  }
327
333
 
328
334
  request_params['timers_ms'] = {
329
- "answer_time": int(answer_time*1000),
330
- "retrieval_time": int(retrieval_time*1000),
331
- "llm_time": int(gpt_elapsed*1000)
335
+ "answer_time": int(answer_time * 1000),
336
+ "retrieval_time": int(retrieval_time * 1000),
337
+ "llm_time": int(gpt_elapsed * 1000)
332
338
  }
333
339
 
334
340
  if additional_page_time:
335
- request_params['timers_ms']['additional_page_time'] = int(additional_page_time*1000)
336
-
341
+ request_params['timers_ms']['additional_page_time'] = int(additional_page_time * 1000)
337
342
 
338
343
  return top_k_documents, gpt_answer, stats, all_docs_and_scores, request_params
339
344
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kolzchut-ragbot
3
- Version: 1.7.4
3
+ Version: 1.7.5
4
4
  Summary: A search engine using machine learning models and Elasticsearch for advanced document retrieval.
5
5
  Home-page: https://github.com/shmuelrob/rag-bot
6
6
  Author: Shmuel Robinov
@@ -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=0tkznQd2kCawnCru3nuGUfG66H_iRaPkFOtk0r5kxvg,16015
5
+ kolzchut_ragbot/engine.py,sha256=-qNSnyq4A3rQZz_HU_5Djwc35Su0M4tAqNvqLlDQ_UU,16383
6
6
  kolzchut_ragbot/get_full_documents_utilities.py,sha256=YWljmGWM6h1ghLDCAUnDdhmn-0k6R_t7b1g7wSojzvg,1882
7
7
  kolzchut_ragbot/llm_client.py,sha256=JdDeOn2THpkOM2Mwe2DucTaYXul1fL2agIisBuHFtc8,347
8
8
  kolzchut_ragbot/model.py,sha256=HCi3r4YztPknnbgTOA7I-GVaqxn8CzrTeLFkEg-7fg0,6320
9
- kolzchut_ragbot-1.7.4.dist-info/METADATA,sha256=xviSAqe9g2sy4DbsKT13cVmHN4fEdgkZFv3-i2MjPK4,1999
10
- kolzchut_ragbot-1.7.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
- kolzchut_ragbot-1.7.4.dist-info/top_level.txt,sha256=NTZoY4GGw3v_7jm0MgcdHw8simoZ78PsR7Meqmkgd_Q,16
12
- kolzchut_ragbot-1.7.4.dist-info/RECORD,,
9
+ kolzchut_ragbot-1.7.5.dist-info/METADATA,sha256=9jpBjTYYUzmuNuQ_t5L-fPjOJfKoCfBSEree9DnuazE,1999
10
+ kolzchut_ragbot-1.7.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
11
+ kolzchut_ragbot-1.7.5.dist-info/top_level.txt,sha256=NTZoY4GGw3v_7jm0MgcdHw8simoZ78PsR7Meqmkgd_Q,16
12
+ kolzchut_ragbot-1.7.5.dist-info/RECORD,,