ws-bom-robot-app 0.0.27__tar.gz → 0.0.28__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 (65) hide show
  1. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/PKG-INFO +9 -1
  2. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/README.md +8 -0
  3. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/setup.py +1 -1
  4. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/main.py +14 -4
  5. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/models/api.py +0 -9
  6. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/loader/base.py +14 -7
  7. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app.egg-info/PKG-INFO +9 -1
  8. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/pyproject.toml +0 -0
  9. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/setup.cfg +0 -0
  10. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/__init__.py +0 -0
  11. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/auth.py +0 -0
  12. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/config.py +0 -0
  13. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/cron_manager.py +0 -0
  14. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/__init__.py +0 -0
  15. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/agent_description.py +0 -0
  16. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/agent_handler.py +0 -0
  17. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/agent_lcel.py +0 -0
  18. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/api.py +0 -0
  19. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/defaut_prompt.py +0 -0
  20. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/models/__init__.py +0 -0
  21. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/models/base.py +0 -0
  22. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/models/kb.py +0 -0
  23. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/settings.py +0 -0
  24. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/tools/__init__.py +0 -0
  25. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/tools/models/__init__.py +0 -0
  26. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/tools/models/main.py +0 -0
  27. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/tools/tool_builder.py +0 -0
  28. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/tools/tool_manager.py +0 -0
  29. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/tools/utils.py +0 -0
  30. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/utils/__init__.py +0 -0
  31. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/utils/agent_utils.py +0 -0
  32. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/utils/chunker.py +0 -0
  33. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/utils/download.py +0 -0
  34. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/utils/faiss_helper.py +0 -0
  35. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/utils/kb.py +0 -0
  36. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/utils/print.py +0 -0
  37. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/utils/webhooks.py +0 -0
  38. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/__init__.py +0 -0
  39. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/generator.py +0 -0
  40. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/__init__.py +0 -0
  41. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/azure.py +0 -0
  42. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/base.py +0 -0
  43. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/confluence.py +0 -0
  44. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/dropbox.py +0 -0
  45. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/gcs.py +0 -0
  46. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/github.py +0 -0
  47. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/googledrive.py +0 -0
  48. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/jira.py +0 -0
  49. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/manager.py +0 -0
  50. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/s3.py +0 -0
  51. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/sftp.py +0 -0
  52. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/sharepoint.py +0 -0
  53. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/sitemap.py +0 -0
  54. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/integration/slack.py +0 -0
  55. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/loader/__init__.py +0 -0
  56. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/loader/docling.py +0 -0
  57. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/llm/vector_store/loader/json_loader.py +0 -0
  58. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/main.py +0 -0
  59. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/requirements.txt +0 -0
  60. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/task_manager.py +0 -0
  61. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app/util.py +0 -0
  62. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app.egg-info/SOURCES.txt +0 -0
  63. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app.egg-info/dependency_links.txt +0 -0
  64. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app.egg-info/requires.txt +0 -0
  65. {ws_bom_robot_app-0.0.27 → ws_bom_robot_app-0.0.28}/ws_bom_robot_app.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ws_bom_robot_app
3
- Version: 0.0.27
3
+ Version: 0.0.28
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
@@ -118,6 +118,14 @@ robot_cms_files_folder=llmKbFile
118
118
  }
119
119
  ```
120
120
 
121
+ #### docling
122
+
123
+ Set the following environment variables
124
+
125
+ ```pwsh
126
+ KMP_DUPLICATE_LIB_OK=TRUE
127
+ ```
128
+
121
129
  #### libreoffice (optional: for robot_env set to development/production)
122
130
 
123
131
  [Install libreoffice](https://www.libreoffice.org/download/download-libreoffice/)
@@ -77,6 +77,14 @@ robot_cms_files_folder=llmKbFile
77
77
  }
78
78
  ```
79
79
 
80
+ #### docling
81
+
82
+ Set the following environment variables
83
+
84
+ ```pwsh
85
+ KMP_DUPLICATE_LIB_OK=TRUE
86
+ ```
87
+
80
88
  #### libreoffice (optional: for robot_env set to development/production)
81
89
 
82
90
  [Install libreoffice](https://www.libreoffice.org/download/download-libreoffice/)
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="ws_bom_robot_app",
5
- version="0.0.27",
5
+ version="0.0.28",
6
6
  description="A FastAPI application serving ws bom/robot/llm platform ai.",
7
7
  long_description=open("README.md", encoding='utf-8').read(),
8
8
  long_description_content_type="text/markdown",
@@ -11,6 +11,8 @@ from langchain_core.callbacks.base import AsyncCallbackHandler
11
11
  import warnings, asyncio, os, io, sys, json
12
12
  from typing import List
13
13
  from asyncio import Queue
14
+ from langchain.callbacks.tracers import LangChainTracer
15
+ from langsmith import Client as LangSmithClient
14
16
 
15
17
  async def invoke(rq: InvokeRequest) -> str:
16
18
  await rq.initialize()
@@ -52,22 +54,30 @@ async def __stream(rq: StreamRequest,queue: Queue,formatted: bool = True) -> Non
52
54
  message_content = message.content
53
55
  settings.chat_history.append(AIMessage(content=message_content))
54
56
 
57
+ if rq.lang_chain_tracing:
58
+ client = LangSmithClient(
59
+ api_key= rq.secrets.get("langChainApiKey", "")
60
+ )
61
+ trace = LangChainTracer(project_name=rq.lang_chain_project,client=client)
62
+ callbacks.append(trace)
63
+
55
64
  processor = AgentLcel(
56
65
  openai_config={"api_key": rq.secrets["openAIApiKey"], "openai_model": rq.model, "temperature": rq.temperature},
57
66
  sys_message=rq.system_message,
58
- tools=get_structured_tools(tools=rq.app_tools, api_key=rq.secrets["openAIApiKey"], callbacks=[callbacks[0]], queue=queue),
67
+ tools=get_structured_tools(tools=rq.app_tools, api_key=rq.secrets["openAIApiKey"], callbacks=[callbacks], queue=queue),
59
68
  rules=rq.rules
60
69
  )
61
-
62
- if "NEBULY_API_KEY" in os.environ:
70
+ if rq.secrets.get("nebulyApiKey","") != "":
63
71
  nebuly_callback = LangChainTrackingHandler(
64
- api_key= os.environ["NEBULY_API_KEY"],
72
+ api_key= rq.secrets.get("nebulyApiKey"),
65
73
  user_id=rq.thread_id,
74
+ nebuly_tags={"project": rq.lang_chain_project},
66
75
  )
67
76
  callbacks.append(nebuly_callback)
68
77
 
69
78
  with warnings.catch_warnings():
70
79
  warnings.simplefilter("ignore", UserWarning)
80
+
71
81
  await processor.executor.ainvoke(
72
82
  {"input": rq.messages[-1], "chat_history": settings.chat_history},
73
83
  {"callbacks": callbacks},
@@ -90,14 +90,6 @@ class LlmApp(BaseModel):
90
90
  self.__decompress_zip(db_destination_file, db_folder)
91
91
  else:
92
92
  os.removedirs(db_folder)
93
- def __update_envs(self) -> None:
94
- _envs = {
95
- "LANGCHAIN_API_KEY": self.secrets.get("langChainApiKey", ""),
96
- "LANGCHAIN_PROJECT": self.lang_chain_project or "",
97
- "LANGCHAIN_TRACING_V2": str(self.lang_chain_tracing).lower(),
98
- "NEBULY_API_KEY": self.secrets.get("nebulyApiKey", "")
99
- }
100
- os.environ.update({k: v for k, v in _envs.items() if v})
101
93
  def __normalize_vector_db_path(self) -> None:
102
94
  _vector_db_folder = self.__vector_db_folder()
103
95
  self.vector_db = os.path.join(_vector_db_folder, os.path.splitext(os.path.basename(self.vector_db))[0]) if self.vector_db else None
@@ -106,7 +98,6 @@ class LlmApp(BaseModel):
106
98
  for tool in self.app_tools or []:
107
99
  tool.vector_db = os.path.join(_vector_db_folder, os.path.splitext(os.path.basename(tool.vector_db))[0]) if tool.vector_db else None
108
100
  async def initialize(self) -> None:
109
- self.__update_envs()
110
101
  await self.__extract_db()
111
102
  self.__normalize_vector_db_path()
112
103
 
@@ -8,8 +8,15 @@ from pydantic import BaseModel
8
8
  from ws_bom_robot_app.config import config
9
9
  from ws_bom_robot_app.llm.vector_store.loader.json_loader import JsonLoader
10
10
  from ws_bom_robot_app.llm.vector_store.loader.docling import DoclingLoader
11
- from langchain_community.document_loaders import CSVLoader, UnstructuredPowerPointLoader, UnstructuredEmailLoader, UnstructuredXMLLoader, TextLoader, UnstructuredHTMLLoader
12
-
11
+ from langchain_community.document_loaders import (
12
+ BSHTMLLoader,
13
+ CSVLoader,
14
+ UnstructuredEmailLoader,
15
+ UnstructuredImageLoader,
16
+ UnstructuredXMLLoader,
17
+ UnstructuredPowerPointLoader,
18
+ TextLoader
19
+ )
13
20
  class LoaderConfig(BaseModel):
14
21
  loader: type[BaseLoader]
15
22
  kwargs: Optional[dict[str, Any]] = {}
@@ -39,12 +46,12 @@ class Loader():
39
46
  '.tsv': None,
40
47
  '.text': None,
41
48
  '.log': None,
42
- '.htm': LoaderConfig(loader=UnstructuredHTMLLoader,kwargs={"strategy":"auto"}),
43
- '.html': LoaderConfig(loader=UnstructuredHTMLLoader,kwargs={"strategy":"auto"}),
49
+ '.htm': LoaderConfig(loader=BSHTMLLoader),
50
+ '.html': LoaderConfig(loader=BSHTMLLoader),
44
51
  ".pdf": LoaderConfig(loader=DoclingLoader),
45
- '.png': LoaderConfig(loader=DoclingLoader),
46
- '.jpg': LoaderConfig(loader=DoclingLoader),
47
- '.jpeg': LoaderConfig(loader=DoclingLoader),
52
+ '.png': LoaderConfig(loader=UnstructuredImageLoader,kwargs={"strategy":"auto","mode":"single"}),
53
+ '.jpg': LoaderConfig(loader=UnstructuredImageLoader,kwargs={"strategy":"auto","mode":"single"}),
54
+ '.jpeg': LoaderConfig(loader=UnstructuredImageLoader,kwargs={"strategy":"auto","mode":"single"}),
48
55
  '.gif': None,
49
56
  ".emf": None,
50
57
  ".wmf": None,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ws_bom_robot_app
3
- Version: 0.0.27
3
+ Version: 0.0.28
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
@@ -118,6 +118,14 @@ robot_cms_files_folder=llmKbFile
118
118
  }
119
119
  ```
120
120
 
121
+ #### docling
122
+
123
+ Set the following environment variables
124
+
125
+ ```pwsh
126
+ KMP_DUPLICATE_LIB_OK=TRUE
127
+ ```
128
+
121
129
  #### libreoffice (optional: for robot_env set to development/production)
122
130
 
123
131
  [Install libreoffice](https://www.libreoffice.org/download/download-libreoffice/)