ws-bom-robot-app 0.0.46__py3-none-any.whl → 0.0.47__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.
@@ -5,11 +5,16 @@ from ws_bom_robot_app.llm.utils.print import HiddenPrints
5
5
  from ws_bom_robot_app.llm.vector_store.db.manager import VectorDbManager
6
6
  import warnings
7
7
 
8
- async def get_rules(embeddings: Embeddings, rules: LlmRules, input: str) -> str:
8
+ async def get_rules(embeddings: Embeddings, rules: LlmRules, input: str | list) -> str:
9
9
  with warnings.catch_warnings():
10
10
  warnings.simplefilter("ignore", category=Warning)
11
+ # check if the input is multimodal and convert it to text
12
+ if isinstance(input, list):
13
+ input = " ".join(obj.get("text", "") for obj in input)
14
+ # check if the input is empty or the rules are not provided
11
15
  if any([input=="",rules is None,rules and rules.vector_db == "",rules and not os.path.exists(rules.vector_db)]):
12
16
  return ""
17
+ # get the rules from the vector db and return prompt with rules
13
18
  rules_prompt = ""
14
19
  rules_doc = await VectorDbManager.get_strategy(rules.vector_type).invoke(embeddings, rules.vector_db,input,search_type="similarity_score_threshold", search_kwargs={"score_threshold": rules.threshold}) #type: ignore
15
20
  if len(rules_doc) > 0:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: ws_bom_robot_app
3
- Version: 0.0.46
3
+ Version: 0.0.47
4
4
  Summary: A FastAPI application serving ws bom/robot/llm platform ai.
5
5
  Home-page: https://github.com/websolutespa/bom
6
6
  Author: Websolute Spa
@@ -26,7 +26,7 @@ ws_bom_robot_app/llm/tools/utils.py,sha256=LEId1UolLvJsMYbl-awm7h-gJ9Up9DrrnH6HT
26
26
  ws_bom_robot_app/llm/tools/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  ws_bom_robot_app/llm/tools/models/main.py,sha256=o3Rwbn5nsugKOgLG0FUIuvtPPHYhfVpqG4E3BQB2nWM,388
28
28
  ws_bom_robot_app/llm/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- ws_bom_robot_app/llm/utils/agent.py,sha256=Tc89ZExE1aJ8cV1_3b9lfICCxgjKHHPPADs0fWi3NOo,1023
29
+ ws_bom_robot_app/llm/utils/agent.py,sha256=_GdD8kfEzR-xNCkXv8gtFzjeVsHtuSi6_QO9vsePiNE,1322
30
30
  ws_bom_robot_app/llm/utils/chunker.py,sha256=N7570xBYlObneg-fsvDhPAJ-Pv8C8OaYZOBK6q7LmMI,607
31
31
  ws_bom_robot_app/llm/utils/download.py,sha256=GaRypPgkx16HfYRj-upX9kvmjfAdFFb5TP4P97scWeA,3273
32
32
  ws_bom_robot_app/llm/utils/kb.py,sha256=jja45WCbNI7SGEgqDS99nErlwB5eY8Ga7BMnhdMHZ90,1279
@@ -60,7 +60,7 @@ ws_bom_robot_app/llm/vector_store/loader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
60
60
  ws_bom_robot_app/llm/vector_store/loader/base.py,sha256=L_ugekNuAq0N9O-24wtlHSNHkqSeD-KsJrfGt_FX9Oc,5340
61
61
  ws_bom_robot_app/llm/vector_store/loader/docling.py,sha256=yP0zgXLeFAlByaYuj-6cYariuknckrFds0dxdRcnVz8,3456
62
62
  ws_bom_robot_app/llm/vector_store/loader/json_loader.py,sha256=LDppW0ZATo4_1hh-KlsAM3TLawBvwBxva_a7k5Oz1sc,858
63
- ws_bom_robot_app-0.0.46.dist-info/METADATA,sha256=bpE8xHYYEMkLlx7_ZQKMXJ3UuOdKyI-1EZpUY-wisT4,8348
64
- ws_bom_robot_app-0.0.46.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
65
- ws_bom_robot_app-0.0.46.dist-info/top_level.txt,sha256=Yl0akyHVbynsBX_N7wx3H3ZTkcMLjYyLJs5zBMDAKcM,17
66
- ws_bom_robot_app-0.0.46.dist-info/RECORD,,
63
+ ws_bom_robot_app-0.0.47.dist-info/METADATA,sha256=qAE4WJjYXevHh1uAdIrTs-gfDDaHIvSGw8k8DFnqABY,8348
64
+ ws_bom_robot_app-0.0.47.dist-info/WHEEL,sha256=tTnHoFhvKQHCh4jz3yCn0WPTYIy7wXx3CJtJ7SJGV7c,91
65
+ ws_bom_robot_app-0.0.47.dist-info/top_level.txt,sha256=Yl0akyHVbynsBX_N7wx3H3ZTkcMLjYyLJs5zBMDAKcM,17
66
+ ws_bom_robot_app-0.0.47.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.1.0)
2
+ Generator: setuptools (77.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5