ws-bom-robot-app 0.0.36__py3-none-any.whl → 0.0.38__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.
@@ -1,22 +1,20 @@
1
- from typing import AsyncGenerator
2
-
1
+ from asyncio import Queue
2
+ import asyncio, json, logging, os, traceback
3
3
  from fastapi import Request
4
- from ws_bom_robot_app.llm.agent_lcel import AgentLcel
5
- from ws_bom_robot_app.llm.agent_handler import AgentHandler, RawAgentHandler
4
+ from langchain.callbacks.tracers import LangChainTracer
5
+ from langchain_core.callbacks.base import AsyncCallbackHandler
6
+ from langchain_core.messages import AIMessage, HumanMessage
7
+ from langsmith import Client as LangSmithClient
8
+ from nebuly.providers.langchain import LangChainTrackingHandler
9
+ from typing import AsyncGenerator, List
10
+ from ws_bom_robot_app.config import config
6
11
  from ws_bom_robot_app.llm.agent_description import AgentDescriptor
7
- from langchain_core.messages import HumanMessage, AIMessage
8
- from ws_bom_robot_app.llm.providers.llm_manager import LlmConfig, LlmInterface, LlmManager
9
- from ws_bom_robot_app.llm.tools.tool_builder import get_structured_tools
12
+ from ws_bom_robot_app.llm.agent_handler import AgentHandler, RawAgentHandler
13
+ from ws_bom_robot_app.llm.agent_lcel import AgentLcel
10
14
  from ws_bom_robot_app.llm.models.api import InvokeRequest, StreamRequest
15
+ from ws_bom_robot_app.llm.providers.llm_manager import LlmInterface
16
+ from ws_bom_robot_app.llm.tools.tool_builder import get_structured_tools
11
17
  import ws_bom_robot_app.llm.settings as settings
12
- from nebuly.providers.langchain import LangChainTrackingHandler
13
- from langchain_core.callbacks.base import AsyncCallbackHandler
14
- import warnings, asyncio, os, io, sys, json, logging, traceback
15
- from typing import List
16
- from asyncio import Queue
17
- from langchain.callbacks.tracers import LangChainTracer
18
- from langsmith import Client as LangSmithClient
19
- from starlette.datastructures import Headers
20
18
 
21
19
  async def invoke(rq: InvokeRequest) -> str:
22
20
  await rq.initialize()
@@ -91,6 +89,9 @@ async def __stream(rq: StreamRequest, ctx: Request, queue: Queue,formatted: bool
91
89
  except Exception as e:
92
90
  _error = f"Agent invoke ex: {e}"
93
91
  logging.warning(_error)
92
+ if config.runtime_options().debug:
93
+ _error += f" | {traceback.format_exc()}"
94
+ await queue.put(_error)
94
95
  await queue.put(None)
95
96
 
96
97
  # Signal the end of streaming
@@ -3,7 +3,7 @@ from ws_bom_robot_app.llm.vector_store.integration.base import IntegrationStrate
3
3
  from unstructured_ingest.v2.processes.connectors.confluence import ConfluenceIndexerConfig, ConfluenceDownloaderConfig, ConfluenceConnectionConfig, ConfluenceAccessConfig
4
4
  from langchain_core.documents import Document
5
5
  from ws_bom_robot_app.llm.vector_store.loader.base import Loader
6
- from typing import Union
6
+ from typing import Optional, Union
7
7
  from pydantic import BaseModel, Field, AliasChoices
8
8
 
9
9
  class ConfluenceParams(BaseModel):
@@ -12,14 +12,16 @@ class ConfluenceParams(BaseModel):
12
12
 
13
13
  Attributes:
14
14
  url (str): The URL of the Confluence instance, e.g., 'https://example.atlassian.net'.
15
- access_token (str): The access token for authenticating with Confluence, e.g., 'AT....'
16
- user_email (str): The email address of the Confluence user
15
+ username (str): The email address or username of the Confluence user
16
+ password: Confluence password or Cloud API token, if filled, set the access_token to None and vice versa.
17
+ access_token (str): The personal access token for authenticating with Confluence, e.g., 'AT....'
17
18
  spaces (list[str]): A list of Confluence spaces to interact with, e.g., ['SPACE1', 'SPACE2'].
18
19
  extension (list[str], optional): A list of file extensions to filter by. Defaults to None, e.g., ['.pdf', '.docx'].
19
20
  """
20
21
  url: str
21
- access_token: str = Field(validation_alias=AliasChoices("accessToken","access_token"))
22
- user_email: str = Field(validation_alias=AliasChoices("userEmail","user_email"))
22
+ username: str = Field(validation_alias=AliasChoices("userName","userEmail","username"))
23
+ password: Optional[str] = None
24
+ access_token: Optional[str] = Field(None, validation_alias=AliasChoices("accessToken","access_token"))
23
25
  spaces: list[str] = []
24
26
  extension: list[str] = Field(default=None)
25
27
  class Confluence(IntegrationStrategy):
@@ -37,9 +39,9 @@ class Confluence(IntegrationStrategy):
37
39
  download_dir=self.working_directory
38
40
  )
39
41
  connection_config = ConfluenceConnectionConfig(
40
- access_config=ConfluenceAccessConfig(api_token=self.__data.access_token),
42
+ access_config=ConfluenceAccessConfig(password=self.__data.password, token=self.__data.access_token),
41
43
  url=self.__data.url,
42
- user_email=self.__data.user_email
44
+ username=self.__data.username
43
45
  )
44
46
  self.__unstructured_ingest.pipeline(
45
47
  indexer_config,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ws_bom_robot_app
3
- Version: 0.0.36
3
+ Version: 0.0.38
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
@@ -31,9 +31,9 @@ Requires-Dist: langchain_chroma==0.2.1
31
31
  Requires-Dist: fastembed==0.5.1
32
32
  Requires-Dist: langchain-qdrant==0.2.0
33
33
  Requires-Dist: lark==1.2.2
34
- Requires-Dist: unstructured==0.16.17
34
+ Requires-Dist: unstructured==0.16.21
35
35
  Requires-Dist: unstructured[image]
36
- Requires-Dist: unstructured-ingest==0.4.6
36
+ Requires-Dist: unstructured-ingest==0.5.4
37
37
  Requires-Dist: unstructured-ingest[azure]
38
38
  Requires-Dist: unstructured-ingest[confluence]
39
39
  Requires-Dist: unstructured-ingest[dropbox]
@@ -11,7 +11,7 @@ ws_bom_robot_app/llm/agent_handler.py,sha256=4zdpSf5iVLxMZ90c_vUl_k-O9SF6u_h7GOB
11
11
  ws_bom_robot_app/llm/agent_lcel.py,sha256=BUfGVUcw6s_YAu5aPMkqqjsStYNHUXKh31t_Ybx11-A,2395
12
12
  ws_bom_robot_app/llm/api.py,sha256=UaD1oJyAOe7ASoXxPNJcth3kDuWcjk1xqUNEjuPWbR4,3759
13
13
  ws_bom_robot_app/llm/defaut_prompt.py,sha256=LlCd_nSMkMmHESfiiiQYfnJyB6Pp-LSs4CEKdYW4vFk,1106
14
- ws_bom_robot_app/llm/main.py,sha256=Qw4SbZtstXo31bWFLRQmm_t8BEKlqvgXmtYbxM2F6_Y,4138
14
+ ws_bom_robot_app/llm/main.py,sha256=fVXyS9TOu22ZC7M8o2mRCya9vTmMFf5jRgs9V0K_4cw,4189
15
15
  ws_bom_robot_app/llm/settings.py,sha256=EkFGCppORenStH9W4e6_dYvQ-5p6xiEMpmUHBqNqG9M,117
16
16
  ws_bom_robot_app/llm/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  ws_bom_robot_app/llm/models/api.py,sha256=mLbPG7jHh1EjgQG-xpBhEgiTIHpK35HZ51obgqQSfq4,8890
@@ -38,7 +38,7 @@ ws_bom_robot_app/llm/vector_store/generator.py,sha256=9_xdtCKJhmt1OP0GXDjvFERXMP
38
38
  ws_bom_robot_app/llm/vector_store/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  ws_bom_robot_app/llm/vector_store/integration/azure.py,sha256=R37TaPQP-HJJJiaKE9rmMc9kpeXeRvdebbTY_982om0,3392
40
40
  ws_bom_robot_app/llm/vector_store/integration/base.py,sha256=8r6XO_XM8PcDXhsKst6q_Xw-P48rCiEtowmkBEDVd08,1957
41
- ws_bom_robot_app/llm/vector_store/integration/confluence.py,sha256=4fiRHB3J-SHZZxNGHwVkCrT-xSPbc91z4WrDE9fy6xU,2505
41
+ ws_bom_robot_app/llm/vector_store/integration/confluence.py,sha256=YCljHIzAt15LI-iAAROimqndVl9y3for72e2D5ByZ74,2725
42
42
  ws_bom_robot_app/llm/vector_store/integration/dropbox.py,sha256=yhGvHTN0TEpUfhdvvV7RX5MxBwTUyddAX95Fgqp3mCg,2629
43
43
  ws_bom_robot_app/llm/vector_store/integration/gcs.py,sha256=fFDVDUR6eNB7FVTzDSEpMHFEWMgG16GLnpSf_mqGDdE,3184
44
44
  ws_bom_robot_app/llm/vector_store/integration/github.py,sha256=18PO30AZcgTn6PHhid3MwImVAdmKBNkr0kmAPgOetGw,2663
@@ -54,7 +54,7 @@ ws_bom_robot_app/llm/vector_store/loader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
54
54
  ws_bom_robot_app/llm/vector_store/loader/base.py,sha256=L_ugekNuAq0N9O-24wtlHSNHkqSeD-KsJrfGt_FX9Oc,5340
55
55
  ws_bom_robot_app/llm/vector_store/loader/docling.py,sha256=yP0zgXLeFAlByaYuj-6cYariuknckrFds0dxdRcnVz8,3456
56
56
  ws_bom_robot_app/llm/vector_store/loader/json_loader.py,sha256=qo9ejRZyKv_k6jnGgXnu1W5uqsMMtgqK_uvPpZQ0p74,833
57
- ws_bom_robot_app-0.0.36.dist-info/METADATA,sha256=ROer_6Ot24hgee3HuoWzfzQPRzr1JX1XZArffWzZAW0,8348
58
- ws_bom_robot_app-0.0.36.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
59
- ws_bom_robot_app-0.0.36.dist-info/top_level.txt,sha256=Yl0akyHVbynsBX_N7wx3H3ZTkcMLjYyLJs5zBMDAKcM,17
60
- ws_bom_robot_app-0.0.36.dist-info/RECORD,,
57
+ ws_bom_robot_app-0.0.38.dist-info/METADATA,sha256=_J5jN1CY2FZIQqwVJDFE963HaRVzUznJ163_zCX0ybk,8348
58
+ ws_bom_robot_app-0.0.38.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
59
+ ws_bom_robot_app-0.0.38.dist-info/top_level.txt,sha256=Yl0akyHVbynsBX_N7wx3H3ZTkcMLjYyLJs5zBMDAKcM,17
60
+ ws_bom_robot_app-0.0.38.dist-info/RECORD,,