ws-bom-robot-app 0.0.70__tar.gz → 0.0.72__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 (81) hide show
  1. {ws_bom_robot_app-0.0.70/ws_bom_robot_app.egg-info → ws_bom_robot_app-0.0.72}/PKG-INFO +2 -1
  2. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/requirements.txt +1 -0
  3. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/setup.py +1 -1
  4. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/agent_lcel.py +8 -3
  5. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/models/api.py +1 -1
  6. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/utils/cms.py +34 -29
  7. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72/ws_bom_robot_app.egg-info}/PKG-INFO +2 -1
  8. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app.egg-info/requires.txt +1 -0
  9. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/MANIFEST.in +0 -0
  10. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/README.md +0 -0
  11. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/pyproject.toml +0 -0
  12. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/setup.cfg +0 -0
  13. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/__init__.py +0 -0
  14. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/auth.py +0 -0
  15. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/config.py +0 -0
  16. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/cron_manager.py +0 -0
  17. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/__init__.py +0 -0
  18. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/agent_context.py +0 -0
  19. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/agent_description.py +0 -0
  20. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/agent_handler.py +0 -0
  21. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/api.py +0 -0
  22. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/defaut_prompt.py +0 -0
  23. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/feedbacks/__init__.py +0 -0
  24. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/feedbacks/feedback_manager.py +0 -0
  25. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/main.py +0 -0
  26. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/models/__init__.py +0 -0
  27. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/models/base.py +0 -0
  28. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/models/feedback.py +0 -0
  29. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/models/kb.py +0 -0
  30. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/nebuly_handler.py +0 -0
  31. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/providers/__init__.py +0 -0
  32. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/providers/llm_manager.py +0 -0
  33. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/settings.py +0 -0
  34. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/tools/__init__.py +0 -0
  35. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/tools/models/__init__.py +0 -0
  36. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/tools/models/main.py +0 -0
  37. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/tools/tool_builder.py +0 -0
  38. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/tools/tool_manager.py +0 -0
  39. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/tools/utils.py +0 -0
  40. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/utils/__init__.py +0 -0
  41. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/utils/agent.py +0 -0
  42. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/utils/chunker.py +0 -0
  43. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/utils/download.py +0 -0
  44. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/utils/kb.py +0 -0
  45. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/utils/print.py +0 -0
  46. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/utils/secrets.py +0 -0
  47. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/utils/webhooks.py +0 -0
  48. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/__init__.py +0 -0
  49. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/db/__init__.py +0 -0
  50. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/db/base.py +0 -0
  51. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/db/chroma.py +0 -0
  52. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/db/faiss.py +0 -0
  53. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/db/manager.py +0 -0
  54. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/db/qdrant.py +0 -0
  55. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/generator.py +0 -0
  56. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/__init__.py +0 -0
  57. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/azure.py +0 -0
  58. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/base.py +0 -0
  59. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/confluence.py +0 -0
  60. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/dropbox.py +0 -0
  61. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/gcs.py +0 -0
  62. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/github.py +0 -0
  63. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/googledrive.py +0 -0
  64. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/jira.py +0 -0
  65. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/manager.py +0 -0
  66. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/s3.py +0 -0
  67. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/sftp.py +0 -0
  68. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/sharepoint.py +0 -0
  69. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/sitemap.py +0 -0
  70. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/slack.py +0 -0
  71. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/integration/thron.py +0 -0
  72. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/loader/__init__.py +0 -0
  73. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/loader/base.py +0 -0
  74. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/loader/docling.py +0 -0
  75. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/llm/vector_store/loader/json_loader.py +0 -0
  76. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/main.py +0 -0
  77. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/task_manager.py +0 -0
  78. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app/util.py +0 -0
  79. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app.egg-info/SOURCES.txt +0 -0
  80. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/ws_bom_robot_app.egg-info/dependency_links.txt +0 -0
  81. {ws_bom_robot_app-0.0.70 → ws_bom_robot_app-0.0.72}/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.70
3
+ Version: 0.0.72
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
@@ -32,6 +32,7 @@ Requires-Dist: chromadb==1.0.13
32
32
  Requires-Dist: langchain_chroma==0.2.4
33
33
  Requires-Dist: fastembed==0.7.1
34
34
  Requires-Dist: langchain-qdrant==0.2.0
35
+ Requires-Dist: qdrant-client==1.15.0
35
36
  Requires-Dist: lark==1.2.2
36
37
  Requires-Dist: unstructured==0.16.21
37
38
  Requires-Dist: unstructured[image]
@@ -25,6 +25,7 @@ chromadb==1.0.13
25
25
  langchain_chroma==0.2.4
26
26
  fastembed==0.7.1 #qdrant sparse embedding
27
27
  langchain-qdrant==0.2.0
28
+ qdrant-client==1.15.0
28
29
  lark==1.2.2 #self-query retriever
29
30
 
30
31
  #loaders
@@ -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.70",
7
+ version="0.0.72",
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",
@@ -23,14 +23,19 @@ class AgentLcel:
23
23
  self.executor = self.__create_agent()
24
24
 
25
25
  async def __create_prompt(self, input: dict) -> ChatPromptTemplate:
26
+ from langchain_core.messages import SystemMessage
26
27
  message : LlmMessage = input[self.memory_key][-1]
27
28
  rules_prompt = await get_rules(self.embeddings, self.rules, message.content) if self.rules else ""
28
29
  system = default_prompt + (tool_prompt(render_text_description(self.__tools)) if len(self.__tools)>0 else "") + self.sys_message + rules_prompt
29
- return ChatPromptTemplate([
30
- ("system", system),
30
+ prompt = ChatPromptTemplate(
31
+ messages=[
32
+ SystemMessage(content=system), #from ("system",system) to avoid improper f-string substitutions
31
33
  MessagesPlaceholder(variable_name=self.memory_key),
32
34
  MessagesPlaceholder(variable_name="agent_scratchpad"),
33
- ])
35
+ ],
36
+ template_format=None,
37
+ )
38
+ return prompt
34
39
 
35
40
  def __create_agent(self) -> AgentExecutor:
36
41
  agent: Any = (
@@ -154,7 +154,7 @@ class LlmApp(BaseModel):
154
154
  for tool in self.app_tools or []:
155
155
  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
156
156
  def api_key(self):
157
- return self.secrets.get("openAIApiKey", self.secrets.get("apiKey", ""))
157
+ return self.secrets.get("apiKey", "")
158
158
  def get_llm(self) -> LlmInterface:
159
159
  return LlmManager._list[self.provider](LlmConfig(
160
160
  api_key=self.api_key(),
@@ -50,35 +50,40 @@ async def get_apps() -> list[CmsApp]:
50
50
  for cms_app in cms_apps:
51
51
  if __attr(cms_app,"isActive",default=True) == True:
52
52
  _cms_app_dict = DictObject.from_dict(cms_app)
53
- _app: CmsApp = CmsApp(
54
- id=_cms_app_dict.id,
55
- name=_cms_app_dict.name,
56
- mode=_cms_app_dict.mode,
57
- prompt_samples=[__attr(sample,'sampleInputText') or f"{sample.__dict__}" for sample in _cms_app_dict.contents.sampleInputTexts],
58
- credentials=CmsAppCredential(app_key=_cms_app_dict.settings.credentials.appKey,api_key=_cms_app_dict.settings.credentials.apiKey),
59
- rq=StreamRequest(
60
- #thread_id=str(uuid.uuid1()),
61
- messages=[],
62
- secrets={
63
- "apiKey": __attr(_cms_app_dict.settings,'llmConfig','secrets','openAIApiKey', default=''),
64
- "langChainApiKey": __attr(_cms_app_dict.settings,'llmConfig','secrets','langChainApiKey', default=''),
65
- "nebulyApiKey": __attr(_cms_app_dict.settings,'llmConfig','secrets','nebulyApiKey', default=''),
66
- },
67
- system_message=__attr(_cms_app_dict.settings,'llmConfig','prompt','prompt','systemMessage') if __attr(_cms_app_dict.settings,'llmConfig','prompt','prompt','systemMessage') else __attr(_cms_app_dict.settings,'llmConfig','prompt','systemMessage'),
68
- provider= __attr(_cms_app_dict.settings,'llmConfig','provider') or 'openai',
69
- model= __attr(_cms_app_dict.settings,'llmConfig','model') or 'gpt-4o',
70
- temperature=_cms_app_dict.settings.llmConfig.temperature or 0,
71
- app_tools=[LlmAppTool(**tool) for tool in cms_app.get('settings').get('appTools',[])],
72
- rules=LlmRules(
73
- vector_type=__attr(_cms_app_dict.settings,'rules','vectorDbType', default='faiss'),
74
- vector_db=__attr(_cms_app_dict.settings,'rules','vectorDbFile','filename'),
75
- threshold=__attr(_cms_app_dict.settings,'rules','threshold', default=0.7)
76
- ) if __attr(_cms_app_dict.settings,'rules','vectorDbFile','filename') else None,
77
- #fine_tuned_model=__attr(_cms_app_dict.settings,'llmConfig','fineTunedModel'),
78
- lang_chain_tracing= __attr(_cms_app_dict.settings,'llmConfig','langChainTracing', default=False),
79
- lang_chain_project= __attr(_cms_app_dict.settings,'llmConfig','langChainProject', default='')
80
- )
81
- )
53
+ try:
54
+ _app: CmsApp = CmsApp(
55
+ id=_cms_app_dict.id,
56
+ name=_cms_app_dict.name,
57
+ mode=_cms_app_dict.mode,
58
+ prompt_samples=[__attr(sample,'sampleInputText') or f"{sample.__dict__}" for sample in _cms_app_dict.contents.sampleInputTexts],
59
+ credentials=CmsAppCredential(app_key=_cms_app_dict.settings.credentials.appKey,api_key=_cms_app_dict.settings.credentials.apiKey),
60
+ rq=StreamRequest(
61
+ #thread_id=str(uuid.uuid1()),
62
+ messages=[],
63
+ secrets={
64
+ "apiKey": __attr(_cms_app_dict.settings,'llmConfig','secrets','apiKey', default=''),
65
+ "langChainApiKey": __attr(_cms_app_dict.settings,'llmConfig','secrets','langChainApiKey', default=''),
66
+ "nebulyApiKey": __attr(_cms_app_dict.settings,'llmConfig','secrets','nebulyApiKey', default=''),
67
+ },
68
+ system_message=__attr(_cms_app_dict.settings,'llmConfig','prompt','prompt','systemMessage') if __attr(_cms_app_dict.settings,'llmConfig','prompt','prompt','systemMessage') else __attr(_cms_app_dict.settings,'llmConfig','prompt','systemMessage'),
69
+ provider= __attr(_cms_app_dict.settings,'llmConfig','provider') or 'openai',
70
+ model= __attr(_cms_app_dict.settings,'llmConfig','model') or 'gpt-4o',
71
+ temperature=_cms_app_dict.settings.llmConfig.temperature or 0,
72
+ app_tools=[LlmAppTool(**tool) for tool in cms_app.get('settings').get('appTools',[])],
73
+ rules=LlmRules(
74
+ vector_type=__attr(_cms_app_dict.settings,'rules','vectorDbType', default='faiss'),
75
+ vector_db=__attr(_cms_app_dict.settings,'rules','vectorDbFile','filename'),
76
+ threshold=__attr(_cms_app_dict.settings,'rules','threshold', default=0.7)
77
+ ) if __attr(_cms_app_dict.settings,'rules','vectorDbFile','filename') else None,
78
+ #fine_tuned_model=__attr(_cms_app_dict.settings,'llmConfig','fineTunedModel'),
79
+ lang_chain_tracing= __attr(_cms_app_dict.settings,'llmConfig','langChainTracing', default=False),
80
+ lang_chain_project= __attr(_cms_app_dict.settings,'llmConfig','langChainProject', default='')
81
+ ))
82
+ except Exception as e:
83
+ import traceback
84
+ ex = traceback.format_exc()
85
+ logging.error(f"Error creating CmsApp {_cms_app_dict.name} from dict: {e}\n{ex}")
86
+ continue
82
87
  if _app.rq.app_tools:
83
88
  for tool in _app.rq.app_tools:
84
89
  _knowledgeBase = tool.knowledgeBase
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ws_bom_robot_app
3
- Version: 0.0.70
3
+ Version: 0.0.72
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
@@ -32,6 +32,7 @@ Requires-Dist: chromadb==1.0.13
32
32
  Requires-Dist: langchain_chroma==0.2.4
33
33
  Requires-Dist: fastembed==0.7.1
34
34
  Requires-Dist: langchain-qdrant==0.2.0
35
+ Requires-Dist: qdrant-client==1.15.0
35
36
  Requires-Dist: lark==1.2.2
36
37
  Requires-Dist: unstructured==0.16.21
37
38
  Requires-Dist: unstructured[image]
@@ -20,6 +20,7 @@ chromadb==1.0.13
20
20
  langchain_chroma==0.2.4
21
21
  fastembed==0.7.1
22
22
  langchain-qdrant==0.2.0
23
+ qdrant-client==1.15.0
23
24
  lark==1.2.2
24
25
  unstructured==0.16.21
25
26
  unstructured[image]