ws-bom-robot-app 0.0.94__tar.gz → 0.0.96__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 (83) hide show
  1. {ws_bom_robot_app-0.0.94/ws_bom_robot_app.egg-info → ws_bom_robot_app-0.0.96}/PKG-INFO +1 -1
  2. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/setup.py +1 -1
  3. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/googledrive.py +45 -16
  4. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/shopify.py +9 -9
  5. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96/ws_bom_robot_app.egg-info}/PKG-INFO +1 -1
  6. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/MANIFEST.in +0 -0
  7. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/README.md +0 -0
  8. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/pyproject.toml +0 -0
  9. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/requirements.txt +0 -0
  10. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/setup.cfg +0 -0
  11. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/__init__.py +0 -0
  12. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/auth.py +0 -0
  13. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/config.py +0 -0
  14. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/cron_manager.py +0 -0
  15. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/__init__.py +0 -0
  16. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/agent_context.py +0 -0
  17. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/agent_description.py +0 -0
  18. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/agent_handler.py +0 -0
  19. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/agent_lcel.py +0 -0
  20. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/api.py +0 -0
  21. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/defaut_prompt.py +0 -0
  22. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/evaluator.py +0 -0
  23. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/feedbacks/__init__.py +0 -0
  24. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/feedbacks/feedback_manager.py +0 -0
  25. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/main.py +0 -0
  26. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/models/__init__.py +0 -0
  27. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/models/api.py +0 -0
  28. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/models/base.py +0 -0
  29. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/models/feedback.py +0 -0
  30. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/models/kb.py +0 -0
  31. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/nebuly_handler.py +0 -0
  32. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/providers/__init__.py +0 -0
  33. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/providers/llm_manager.py +0 -0
  34. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/tools/__init__.py +0 -0
  35. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/tools/models/__init__.py +0 -0
  36. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/tools/models/main.py +0 -0
  37. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/tools/tool_builder.py +0 -0
  38. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/tools/tool_manager.py +0 -0
  39. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/tools/utils.py +0 -0
  40. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/utils/__init__.py +0 -0
  41. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/utils/agent.py +0 -0
  42. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/utils/chunker.py +0 -0
  43. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/utils/cleanup.py +0 -0
  44. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/utils/cms.py +0 -0
  45. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/utils/download.py +0 -0
  46. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/utils/print.py +0 -0
  47. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/utils/secrets.py +0 -0
  48. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/utils/webhooks.py +0 -0
  49. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/__init__.py +0 -0
  50. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/db/__init__.py +0 -0
  51. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/db/base.py +0 -0
  52. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/db/chroma.py +0 -0
  53. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/db/faiss.py +0 -0
  54. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/db/manager.py +0 -0
  55. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/db/qdrant.py +0 -0
  56. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/generator.py +0 -0
  57. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/__init__.py +0 -0
  58. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/azure.py +0 -0
  59. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/base.py +0 -0
  60. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/confluence.py +0 -0
  61. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/dropbox.py +0 -0
  62. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/gcs.py +0 -0
  63. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/github.py +0 -0
  64. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/jira.py +0 -0
  65. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/manager.py +0 -0
  66. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/s3.py +0 -0
  67. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/sftp.py +0 -0
  68. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/sharepoint.py +0 -0
  69. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/sitemap.py +0 -0
  70. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/slack.py +0 -0
  71. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/integration/thron.py +0 -0
  72. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/loader/__init__.py +0 -0
  73. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/loader/base.py +0 -0
  74. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/loader/docling.py +0 -0
  75. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/llm/vector_store/loader/json_loader.py +0 -0
  76. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/main.py +0 -0
  77. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/subprocess_runner.py +0 -0
  78. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/task_manager.py +0 -0
  79. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app/util.py +0 -0
  80. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app.egg-info/SOURCES.txt +0 -0
  81. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app.egg-info/dependency_links.txt +0 -0
  82. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app.egg-info/requires.txt +0 -0
  83. {ws_bom_robot_app-0.0.94 → ws_bom_robot_app-0.0.96}/ws_bom_robot_app.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ws_bom_robot_app
3
- Version: 0.0.94
3
+ Version: 0.0.96
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.94",
7
+ version="0.0.96",
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",
@@ -1,10 +1,38 @@
1
1
  import asyncio
2
+ import json
3
+ from pathlib import Path
2
4
  from ws_bom_robot_app.llm.vector_store.integration.base import IntegrationStrategy, UnstructuredIngest
3
5
  from unstructured_ingest.processes.connectors.google_drive import GoogleDriveConnectionConfig, GoogleDriveDownloaderConfig, GoogleDriveIndexerConfig, GoogleDriveAccessConfig
6
+ from unstructured_ingest.data_types.file_data import FileData as OriginalFileData, BatchFileData as OriginalBatchFileData
4
7
  from langchain_core.documents import Document
5
8
  from ws_bom_robot_app.llm.vector_store.loader.base import Loader
6
9
  from typing import Union
7
10
  from pydantic import BaseModel, Field, AliasChoices
11
+
12
+ # UTF-8 safe FileData classes
13
+ class FileData(OriginalFileData):
14
+ @classmethod
15
+ def from_file(cls, path: str):
16
+ path = Path(path).resolve()
17
+ if not path.exists() or not path.is_file():
18
+ raise ValueError(f"file path not valid: {path}")
19
+ for encoding in ['utf-8', 'cp1252', 'iso-8859-1', 'latin-1']:
20
+ try:
21
+ with open(str(path), "r", encoding=encoding) as f:
22
+ return cls.model_validate(json.load(f))
23
+ except (UnicodeDecodeError, UnicodeError):
24
+ continue
25
+ raise ValueError(f"Could not decode file {path} with any supported encoding")
26
+
27
+ def to_file(self, path: str) -> None:
28
+ path = Path(path).resolve()
29
+ path.parent.mkdir(parents=True, exist_ok=True)
30
+ with open(str(path), "w", encoding="utf-8") as f:
31
+ json.dump(self.model_dump(), f, indent=2, ensure_ascii=False)
32
+
33
+ class BatchFileData(OriginalBatchFileData, FileData):
34
+ pass
35
+
8
36
  class GoogleDriveParams(BaseModel):
9
37
  """
10
38
  GoogleDriveParams is a model that holds parameters for Google Drive integration.
@@ -42,26 +70,27 @@ class GoogleDrive(IntegrationStrategy):
42
70
  super().__init__(knowledgebase_path, data)
43
71
  self.__data = GoogleDriveParams.model_validate(self.data)
44
72
  self.__unstructured_ingest = UnstructuredIngest(self.working_directory)
73
+ self._apply_encoding_fix()
74
+
75
+ def _apply_encoding_fix(self):
76
+ """Replace FileData classes with UTF-8 safe versions"""
77
+ import unstructured_ingest.data_types.file_data as fd
78
+ fd.FileData = FileData
79
+ fd.BatchFileData = BatchFileData
80
+ fd.file_data_from_file = lambda path: BatchFileData.from_file(path) if path else FileData.from_file(path)
81
+
45
82
  def working_subdirectory(self) -> str:
46
83
  return 'googledrive'
84
+
47
85
  def run(self) -> None:
48
- indexer_config = GoogleDriveIndexerConfig(
49
- extensions=self.__data.extensions,
50
- recursive=self.__data.recursive
51
- )
52
- downloader_config = GoogleDriveDownloaderConfig(
53
- download_dir=self.working_directory
54
- )
55
- connection_config = GoogleDriveConnectionConfig(
56
- access_config=GoogleDriveAccessConfig(
57
- service_account_key=self.__data.service_account_key
58
- ),
59
- drive_id=self.__data.drive_id
60
- )
61
86
  self.__unstructured_ingest.pipeline(
62
- indexer_config,
63
- downloader_config,
64
- connection_config).run()
87
+ GoogleDriveIndexerConfig(extensions=self.__data.extensions, recursive=self.__data.recursive),
88
+ GoogleDriveDownloaderConfig(download_dir=self.working_directory),
89
+ GoogleDriveConnectionConfig(
90
+ access_config=GoogleDriveAccessConfig(service_account_key=self.__data.service_account_key),
91
+ drive_id=self.__data.drive_id
92
+ )
93
+ ).run()
65
94
  async def load(self) -> list[Document]:
66
95
  await asyncio.to_thread(self.run)
67
96
  await asyncio.sleep(1)
@@ -57,7 +57,7 @@ class Shopify(IntegrationStrategy):
57
57
  "Content-Type": "application/json"
58
58
  }
59
59
 
60
- all_products: List[dict] = []
60
+ all_data: List[dict] = []
61
61
  has_next_page = True
62
62
  cursor = None
63
63
  retry_count = 0
@@ -111,19 +111,19 @@ class Shopify(IntegrationStrategy):
111
111
  retry_count = 0
112
112
 
113
113
  # Estrae i dati
114
- products_data = data["data"]["products"]
115
- edges = products_data["edges"]
116
- page_info = products_data["pageInfo"]
114
+ _data = list(data["data"].values())[0]
115
+ edges = _data["edges"]
116
+ page_info = _data["pageInfo"]
117
117
 
118
- # Aggiungi i prodotti alla lista
118
+ # Aggiungi i dati alla lista
119
119
  for edge in edges:
120
- all_products.append(edge["node"])
120
+ all_data.append(edge["node"])
121
121
 
122
122
  # Aggiorna il cursore e il flag per la paginazione
123
123
  has_next_page = page_info["hasNextPage"]
124
124
  cursor = page_info["endCursor"]
125
125
 
126
- print(f"Recuperati {len(edges)} prodotti. Totale: {len(all_products)}")
126
+ print(f"Recuperati {len(edges)} prodotti. Totale: {len(all_data)}")
127
127
 
128
128
  # Piccola pausa per evitare di saturare l'API
129
129
  await asyncio.sleep(0.1)
@@ -139,5 +139,5 @@ class Shopify(IntegrationStrategy):
139
139
  else:
140
140
  raise Exception("Too many network errors. Stopping execution.")
141
141
 
142
- logging.info(f"Data retrieval completed! Total products: {len(all_products)}")
143
- return all_products
142
+ logging.info(f"Data retrieval completed! Total data: {len(all_data)}")
143
+ return all_data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ws_bom_robot_app
3
- Version: 0.0.94
3
+ Version: 0.0.96
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