ws-bom-robot-app 0.0.46__py3-none-any.whl → 0.0.48__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:
@@ -20,6 +20,7 @@ class Sitemap(IntegrationStrategy):
20
20
  data["excludeTag"] (list[str]): default to ["script", "noscript", "style", "head", "header","nav","footer", "iframe"]
21
21
  data["excludeClass"] (list[str]): ["class1", "class2"]
22
22
  data["excludeId"] (list[str]): ["id1", "id2"]
23
+ data["restrictDomain"] (bool): if True, only urls from the same domain will be loaded, default to True
23
24
  """
24
25
  def __init__(self, knowledgebase_path: str, data: dict[str, Any]):
25
26
  super().__init__(knowledgebase_path, data)
@@ -30,6 +31,7 @@ class Sitemap(IntegrationStrategy):
30
31
  self.__exclude_tag: list[str] = self.data.get("excludeTag",[]) # type: ignore
31
32
  self.__exclude_class: list[str] = self.data.get("excludeClass",[]) # type: ignore
32
33
  self.__exclude_id: list[str] = self.data.get("excludeId",[]) # type: ignore
34
+ self.__restrict_to_same_domain: bool = self.data.get("restrictDomain", True) # type: ignore
33
35
  def working_subdirectory(self) -> str:
34
36
  return ""
35
37
  def _extract(self, tag: Tag) -> str:
@@ -75,7 +77,8 @@ class Sitemap(IntegrationStrategy):
75
77
  web_path=self._remap_if_local(self.__sitemap_url),
76
78
  filter_urls=self.__filter_urls,
77
79
  parsing_function=self._parse,
78
- is_local=self._is_local(self.__sitemap_url)
80
+ is_local=self._is_local(self.__sitemap_url),
81
+ restrict_to_same_domain=self.__restrict_to_same_domain
79
82
  )
80
83
  _docs = self._output([document async for document in self.alazy_load(_loader)])
81
84
  if self._is_local(self.__sitemap_url):
@@ -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.48
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
@@ -54,13 +54,13 @@ ws_bom_robot_app/llm/vector_store/integration/manager.py,sha256=5Fl3XML6f1wmgrai
54
54
  ws_bom_robot_app/llm/vector_store/integration/s3.py,sha256=3kh-VmH84IW7DdSLvOk6td1VBJ9aohlVJsk5F3cYj0U,3320
55
55
  ws_bom_robot_app/llm/vector_store/integration/sftp.py,sha256=WNzjjS1EUykgFB-8e7QkecSa1r1jTJqKyGzR25uJCtM,2848
56
56
  ws_bom_robot_app/llm/vector_store/integration/sharepoint.py,sha256=zqqn-6qPrK50Phch4nZHJTgaPyPkGe7W2InGL_Ru6vE,5376
57
- ws_bom_robot_app/llm/vector_store/integration/sitemap.py,sha256=4WYj3C6Y_4vkGs5iUNR59l1YOZEDsQT8MnZ5rIYDL_k,4733
57
+ ws_bom_robot_app/llm/vector_store/integration/sitemap.py,sha256=g0TIRZ2qIpEuVCZ9Bn0MvvxYZtU3wptnTEjoKNZyBAg,5019
58
58
  ws_bom_robot_app/llm/vector_store/integration/slack.py,sha256=FMjESXm2QetFXI6i8epze7Kbbu22fV8CVaxb71AHnJ8,2572
59
59
  ws_bom_robot_app/llm/vector_store/loader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
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.48.dist-info/METADATA,sha256=pzuC_inHOf1_cwPufxB6ntSFPEbERRZ3VStx2cI6xuY,8348
64
+ ws_bom_robot_app-0.0.48.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
65
+ ws_bom_robot_app-0.0.48.dist-info/top_level.txt,sha256=Yl0akyHVbynsBX_N7wx3H3ZTkcMLjYyLJs5zBMDAKcM,17
66
+ ws_bom_robot_app-0.0.48.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.1.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5