ws-bom-robot-app 0.0.31__tar.gz → 0.0.33__tar.gz

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.
Files changed (66) hide show
  1. {ws_bom_robot_app-0.0.31/ws_bom_robot_app.egg-info → ws_bom_robot_app-0.0.33}/PKG-INFO +1 -1
  2. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/setup.py +1 -1
  3. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/main.py +7 -7
  4. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/models/api.py +1 -1
  5. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/jira.py +56 -0
  6. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33/ws_bom_robot_app.egg-info}/PKG-INFO +1 -1
  7. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/MANIFEST.in +0 -0
  8. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/README.md +0 -0
  9. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/pyproject.toml +0 -0
  10. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/requirements.txt +0 -0
  11. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/setup.cfg +0 -0
  12. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/__init__.py +0 -0
  13. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/auth.py +0 -0
  14. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/config.py +0 -0
  15. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/cron_manager.py +0 -0
  16. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/__init__.py +0 -0
  17. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/agent_description.py +0 -0
  18. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/agent_handler.py +0 -0
  19. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/agent_lcel.py +0 -0
  20. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/api.py +0 -0
  21. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/defaut_prompt.py +0 -0
  22. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/models/__init__.py +0 -0
  23. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/models/base.py +0 -0
  24. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/models/kb.py +0 -0
  25. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/settings.py +0 -0
  26. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/tools/__init__.py +0 -0
  27. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/tools/models/__init__.py +0 -0
  28. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/tools/models/main.py +0 -0
  29. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/tools/tool_builder.py +0 -0
  30. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/tools/tool_manager.py +0 -0
  31. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/tools/utils.py +0 -0
  32. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/utils/__init__.py +0 -0
  33. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/utils/agent_utils.py +0 -0
  34. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/utils/chunker.py +0 -0
  35. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/utils/download.py +0 -0
  36. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/utils/faiss_helper.py +0 -0
  37. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/utils/kb.py +0 -0
  38. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/utils/print.py +0 -0
  39. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/utils/webhooks.py +0 -0
  40. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/__init__.py +0 -0
  41. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/generator.py +0 -0
  42. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/__init__.py +0 -0
  43. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/azure.py +0 -0
  44. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/base.py +0 -0
  45. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/confluence.py +0 -0
  46. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/dropbox.py +0 -0
  47. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/gcs.py +0 -0
  48. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/github.py +0 -0
  49. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/googledrive.py +0 -0
  50. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/manager.py +0 -0
  51. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/s3.py +0 -0
  52. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/sftp.py +0 -0
  53. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/sharepoint.py +0 -0
  54. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/sitemap.py +0 -0
  55. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/integration/slack.py +0 -0
  56. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/loader/__init__.py +0 -0
  57. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/loader/base.py +0 -0
  58. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/loader/docling.py +0 -0
  59. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/llm/vector_store/loader/json_loader.py +0 -0
  60. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/main.py +0 -0
  61. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/task_manager.py +0 -0
  62. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app/util.py +0 -0
  63. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app.egg-info/SOURCES.txt +0 -0
  64. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app.egg-info/dependency_links.txt +0 -0
  65. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app.egg-info/requires.txt +0 -0
  66. {ws_bom_robot_app-0.0.31 → ws_bom_robot_app-0.0.33}/ws_bom_robot_app.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ws_bom_robot_app
3
- Version: 0.0.31
3
+ Version: 0.0.33
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
@@ -4,7 +4,7 @@ _requirements = [line.split('#')[0].strip() for line in open("requirements.txt")
4
4
 
5
5
  setup(
6
6
  name="ws_bom_robot_app",
7
- version="0.0.31",
7
+ version="0.0.33",
8
8
  description="A FastAPI application serving ws bom/robot/llm platform ai.",
9
9
  long_description=open("README.md", encoding='utf-8').read(),
10
10
  long_description_content_type="text/markdown",
@@ -42,7 +42,7 @@ async def __stream(rq: StreamRequest,queue: Queue,formatted: bool = True) -> Non
42
42
  settings.chat_history.append(HumanMessage(content=message.content))
43
43
  elif message.role == "assistant":
44
44
  message_content = ""
45
- if '{\"type\":\"string\"' in message.content:
45
+ if '{\"type\":\"text\"' in message.content:
46
46
  try:
47
47
  json_msg = json.loads('[' + message.content[:-1] + ']')
48
48
  for msg in json_msg:
@@ -75,13 +75,13 @@ async def __stream(rq: StreamRequest,queue: Queue,formatted: bool = True) -> Non
75
75
  )
76
76
  callbacks.append(nebuly_callback)
77
77
 
78
- with warnings.catch_warnings():
79
- warnings.simplefilter("ignore", UserWarning)
78
+ #with warnings.catch_warnings():
79
+ # warnings.simplefilter("ignore", UserWarning)
80
80
 
81
- await processor.executor.ainvoke(
82
- {"input": rq.messages[-1], "chat_history": settings.chat_history},
83
- {"callbacks": callbacks},
84
- )
81
+ await processor.executor.ainvoke(
82
+ {"input": rq.messages[-1], "chat_history": settings.chat_history},
83
+ {"callbacks": callbacks},
84
+ )
85
85
 
86
86
  # Signal the end of streaming
87
87
  await queue.put(None)
@@ -8,7 +8,7 @@ from ws_bom_robot_app.config import Settings, config
8
8
 
9
9
  class LlmMessage(BaseModel):
10
10
  role: str
11
- content: str
11
+ content: Union[str, list]
12
12
 
13
13
  class LlmSearchSettings(BaseModel):
14
14
  search_type: Optional[str] = Field('default', validation_alias=AliasChoices("searchType","search_type"))
@@ -7,6 +7,8 @@ from langchain_core.documents import Document
7
7
  from ws_bom_robot_app.llm.vector_store.loader.base import Loader
8
8
  from pydantic import BaseModel, Field, AliasChoices
9
9
  from typing import Optional, Union
10
+ import requests
11
+ import unstructured_ingest.connector.jira
10
12
 
11
13
  class JiraParams(BaseModel):
12
14
  """
@@ -26,13 +28,18 @@ class JiraParams(BaseModel):
26
28
  projects: list[str]
27
29
  boards: Optional[list[str]] | None = None
28
30
  issues: Optional[list[str]] | None = None
31
+ fieldsMappingUrl: Optional[str] | None = None
32
+
29
33
  class Jira(IntegrationStrategy):
34
+ DEFAULT_C_SEP = " " * 5
35
+ DEFAULT_R_SEP = "\n"
30
36
  def __init__(self, knowledgebase_path: str, data: dict[str, Union[str,int,list]]):
31
37
  super().__init__(knowledgebase_path, data)
32
38
  self.__data = JiraParams.model_validate(self.data)
33
39
  def working_subdirectory(self) -> str:
34
40
  return 'jira'
35
41
  def run(self) -> None:
42
+ unstructured_ingest.connector.jira._get_dropdown_fields_for_issue = self._get_dropdown_fields_for_issue
36
43
  access_config = JiraAccessConfig(
37
44
  api_token=self.__data.access_token
38
45
  )
@@ -56,3 +63,52 @@ class Jira(IntegrationStrategy):
56
63
  await asyncio.to_thread(self.run)
57
64
  await asyncio.sleep(1)
58
65
  return await Loader(self.working_directory).load()
66
+
67
+ def _remap_custom_fields(self, field_list):
68
+ auth = (self.__data.user_email, self.__data.access_token)
69
+ response = requests.get(self.__data.fieldsMappingUrl, auth=auth)
70
+
71
+ if response.status_code == 200:
72
+ mapper: dict = response.json()
73
+ remapped_field_list = {}
74
+ for field_key, field_value in field_list.items():
75
+ new_key = None
76
+ for map_item in mapper:
77
+ if field_key == map_item["id"]:
78
+ # Usa il nome mappato come nuova chiave
79
+ new_key = map_item["name"]
80
+ break
81
+
82
+ if new_key is None:
83
+ new_key = field_key
84
+
85
+ remapped_field_list[new_key] = field_value
86
+
87
+ return remapped_field_list
88
+
89
+ def _get_dropdown_fields_for_issue(self, issue, c_sep=DEFAULT_C_SEP, r_sep=DEFAULT_R_SEP):
90
+ all_fields = {}
91
+ for key, value in issue.items():
92
+ if value is not None:
93
+ if isinstance(value, list) and (len(value) > 0):
94
+ all_fields[key] = value
95
+ else:
96
+ all_fields[key] = value
97
+ mapped_fields = self._remap_custom_fields(all_fields)
98
+ return f"""
99
+ IssueType:{issue["issuetype"]["name"]}
100
+ {r_sep}
101
+ Status:{issue["status"]["name"]}
102
+ {r_sep}
103
+ Priority:{issue["priority"]}
104
+ {r_sep}
105
+ AssigneeID_Name:{issue["assignee"]["accountId"]}{c_sep}{issue["assignee"]["displayName"]}
106
+ {r_sep}
107
+ ReporterAdr_Name:{issue["reporter"]["emailAddress"]}{c_sep}{issue["reporter"]["displayName"]}
108
+ {r_sep}
109
+ Labels:{c_sep.join(issue["labels"])}
110
+ {r_sep}
111
+ Components:{c_sep.join([component["name"] for component in issue["components"]])}
112
+ {r_sep}
113
+ {(r_sep + c_sep ).join([f"{key}:{value}{r_sep}" for key, value in mapped_fields.items()])}
114
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ws_bom_robot_app
3
- Version: 0.0.31
3
+ Version: 0.0.33
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