versionhq 1.1.9.1__tar.gz → 1.1.9.3__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 (80) hide show
  1. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/.gitignore +3 -1
  2. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/PKG-INFO +5 -2
  3. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/README.md +1 -1
  4. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/pyproject.toml +4 -1
  5. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/requirements.txt +70 -5
  6. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/__init__.py +3 -3
  7. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/_utils/logger.py +12 -19
  8. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/agent/model.py +0 -5
  9. versionhq-1.1.9.3/src/versionhq/clients/customer/__init__.py +5 -0
  10. versionhq-1.1.9.3/src/versionhq/clients/customer/model.py +53 -0
  11. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/clients/product/model.py +9 -8
  12. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/clients/workflow/model.py +16 -23
  13. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/tool/__init__.py +7 -4
  14. versionhq-1.1.9.3/src/versionhq/tool/composio_tool.py +191 -0
  15. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/tool/model.py +35 -24
  16. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/tool/tool_handler.py +10 -10
  17. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq.egg-info/PKG-INFO +5 -2
  18. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq.egg-info/SOURCES.txt +2 -1
  19. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq.egg-info/requires.txt +3 -0
  20. versionhq-1.1.9.3/tests/clients/product_test.py +11 -0
  21. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/tests/clients/workflow_test.py +6 -28
  22. versionhq-1.1.9.3/tests/tool/composio_test.py +37 -0
  23. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/tests/tool/tool_test.py +27 -2
  24. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/uv.lock +358 -32
  25. versionhq-1.1.9.1/src/versionhq/clients/customer/model.py +0 -41
  26. versionhq-1.1.9.1/src/versionhq/tool/composio.py +0 -149
  27. versionhq-1.1.9.1/tests/tool/__init__.py +0 -0
  28. versionhq-1.1.9.1/tests/tool/composio_test.py +0 -19
  29. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/.github/workflows/publish.yml +0 -0
  30. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/.github/workflows/publish_testpypi.yml +0 -0
  31. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/.github/workflows/run_tests.yml +0 -0
  32. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/.github/workflows/security_check.yml +0 -0
  33. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/.pre-commit-config.yaml +0 -0
  34. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/.python-version +0 -0
  35. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/LICENSE +0 -0
  36. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/SECURITY.md +0 -0
  37. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/db/preprocess.py +0 -0
  38. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/requirements-dev.txt +0 -0
  39. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/runtime.txt +0 -0
  40. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/setup.cfg +0 -0
  41. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/_utils/__init__.py +0 -0
  42. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/_utils/cache_handler.py +0 -0
  43. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/_utils/i18n.py +0 -0
  44. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/_utils/process_config.py +0 -0
  45. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/_utils/rpm_controller.py +0 -0
  46. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/_utils/usage_metrics.py +0 -0
  47. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
  48. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
  49. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/agent/__init__.py +0 -0
  50. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/agent/parser.py +0 -0
  51. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/cli/__init__.py +0 -0
  52. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/clients/__init__.py +0 -0
  53. {versionhq-1.1.9.1/src/versionhq/clients/customer → versionhq-1.1.9.3/src/versionhq/clients/product}/__init__.py +0 -0
  54. {versionhq-1.1.9.1/src/versionhq/clients/product → versionhq-1.1.9.3/src/versionhq/clients/workflow}/__init__.py +0 -0
  55. {versionhq-1.1.9.1/src/versionhq/clients/workflow → versionhq-1.1.9.3/src/versionhq/llm}/__init__.py +0 -0
  56. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/llm/llm_vars.py +0 -0
  57. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/llm/model.py +0 -0
  58. {versionhq-1.1.9.1/src/versionhq/llm → versionhq-1.1.9.3/src/versionhq/storage}/__init__.py +0 -0
  59. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/storage/task_output_storage.py +0 -0
  60. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/task/__init__.py +0 -0
  61. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/task/formatter.py +0 -0
  62. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/task/log_handler.py +0 -0
  63. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/task/model.py +0 -0
  64. {versionhq-1.1.9.1/src/versionhq/storage → versionhq-1.1.9.3/src/versionhq/team}/__init__.py +0 -0
  65. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/team/model.py +0 -0
  66. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/team/team_planner.py +0 -0
  67. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq/tool/decorator.py +0 -0
  68. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq.egg-info/dependency_links.txt +0 -0
  69. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/src/versionhq.egg-info/top_level.txt +0 -0
  70. {versionhq-1.1.9.1/src/versionhq/team → versionhq-1.1.9.3/tests}/__init__.py +0 -0
  71. {versionhq-1.1.9.1/tests → versionhq-1.1.9.3/tests/agent}/__init__.py +0 -0
  72. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/tests/agent/agent_test.py +0 -0
  73. {versionhq-1.1.9.1/tests/agent → versionhq-1.1.9.3/tests/cli}/__init__.py +0 -0
  74. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/tests/conftest.py +0 -0
  75. {versionhq-1.1.9.1/tests/cli → versionhq-1.1.9.3/tests/task}/__init__.py +0 -0
  76. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/tests/task/task_test.py +0 -0
  77. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/tests/team/Prompts/Demo_test.py +0 -0
  78. {versionhq-1.1.9.1/tests/task → versionhq-1.1.9.3/tests/team}/__init__.py +0 -0
  79. {versionhq-1.1.9.1 → versionhq-1.1.9.3}/tests/team/team_test.py +0 -0
  80. {versionhq-1.1.9.1/tests/team → versionhq-1.1.9.3/tests/tool}/__init__.py +0 -0
@@ -1,7 +1,9 @@
1
+ deploy.py
2
+ destinations.py
3
+
1
4
  knowledge/
2
5
  memory/
3
6
 
4
- # composio.py
5
7
  memo.txt
6
8
 
7
9
  dist/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: versionhq
3
- Version: 1.1.9.1
3
+ Version: 1.1.9.3
4
4
  Summary: LLM orchestration frameworks for model-agnostic AI agents that handle complex outbound workflows
5
5
  Author-email: Kuriko Iwai <kuriko@versi0n.io>
6
6
  License: MIT License
@@ -52,12 +52,15 @@ Requires-Dist: setuptools>=75.6.0
52
52
  Requires-Dist: wheel>=0.45.1
53
53
  Requires-Dist: python-dotenv>=1.0.0
54
54
  Requires-Dist: appdirs>=1.4.4
55
+ Requires-Dist: langchain>=0.3.14
56
+ Requires-Dist: langchain-openai>=0.2.14
57
+ Requires-Dist: composio-langchain>=0.6.12
55
58
 
56
59
  # Overview
57
60
 
58
61
  ![MIT license](https://img.shields.io/badge/License-MIT-green)
59
62
  [![Publisher](https://github.com/versionHQ/multi-agent-system/actions/workflows/publish.yml/badge.svg)](https://github.com/versionHQ/multi-agent-system/actions/workflows/publish.yml)
60
- ![PyPI](https://img.shields.io/badge/PyPI-v1.1.7.9-blue)
63
+ ![PyPI](https://img.shields.io/badge/PyPI-v1.1.9.3-blue)
61
64
  ![python ver](https://img.shields.io/badge/Python-3.12/3.13-purple)
62
65
  ![pyenv ver](https://img.shields.io/badge/pyenv-2.5.0-orange)
63
66
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![MIT license](https://img.shields.io/badge/License-MIT-green)
4
4
  [![Publisher](https://github.com/versionHQ/multi-agent-system/actions/workflows/publish.yml/badge.svg)](https://github.com/versionHQ/multi-agent-system/actions/workflows/publish.yml)
5
- ![PyPI](https://img.shields.io/badge/PyPI-v1.1.7.9-blue)
5
+ ![PyPI](https://img.shields.io/badge/PyPI-v1.1.9.3-blue)
6
6
  ![python ver](https://img.shields.io/badge/Python-3.12/3.13-purple)
7
7
  ![pyenv ver](https://img.shields.io/badge/pyenv-2.5.0-orange)
8
8
 
@@ -15,7 +15,7 @@ exclude = ["test*", "__pycache__"]
15
15
 
16
16
  [project]
17
17
  name = "versionhq"
18
- version = "1.1.9.1"
18
+ version = "1.1.9.3"
19
19
  authors = [{ name = "Kuriko Iwai", email = "kuriko@versi0n.io" }]
20
20
  description = "LLM orchestration frameworks for model-agnostic AI agents that handle complex outbound workflows"
21
21
  readme = "README.md"
@@ -37,6 +37,9 @@ dependencies = [
37
37
  "wheel>=0.45.1",
38
38
  "python-dotenv>=1.0.0",
39
39
  "appdirs>=1.4.4",
40
+ "langchain>=0.3.14",
41
+ "langchain-openai>=0.2.14",
42
+ "composio-langchain>=0.6.12"
40
43
  ]
41
44
  classifiers = [
42
45
  "Programming Language :: Python",
@@ -5,6 +5,7 @@ aiohappyeyeballs==2.4.4
5
5
  aiohttp==3.11.11
6
6
  # via
7
7
  # composio-core
8
+ # langchain
8
9
  # litellm
9
10
  aiosignal==1.3.2
10
11
  # via aiohttp
@@ -43,8 +44,12 @@ click==8.1.8
43
44
  # uvicorn
44
45
  composio==0.1.0
45
46
  # via versionhq (pyproject.toml)
46
- composio-core==0.6.9
47
- # via composio-openai
47
+ composio-core==0.6.11.post1
48
+ # via
49
+ # composio-langchain
50
+ # composio-openai
51
+ composio-langchain==0.6.12
52
+ # via versionhq (pyproject.toml)
48
53
  composio-openai==0.6.9
49
54
  # via versionhq (pyproject.toml)
50
55
  cryptography==44.0.0
@@ -69,6 +74,7 @@ httpcore==1.0.7
69
74
  # via httpx
70
75
  httpx==0.27.2
71
76
  # via
77
+ # langsmith
72
78
  # litellm
73
79
  # openai
74
80
  huggingface-hub==0.27.0
@@ -91,6 +97,10 @@ jiter==0.8.2
91
97
  # via openai
92
98
  json-repair==0.35.0
93
99
  # via versionhq (pyproject.toml)
100
+ jsonpatch==1.33
101
+ # via langchain-core
102
+ jsonpointer==3.0.0
103
+ # via jsonpatch
94
104
  jsonref==1.1.0
95
105
  # via composio-core
96
106
  jsonschema==4.23.0
@@ -99,6 +109,27 @@ jsonschema==4.23.0
99
109
  # litellm
100
110
  jsonschema-specifications==2024.10.1
101
111
  # via jsonschema
112
+ langchain==0.3.14
113
+ # via
114
+ # versionhq (pyproject.toml)
115
+ # composio-langchain
116
+ langchain-core==0.3.29
117
+ # via
118
+ # langchain
119
+ # langchain-openai
120
+ # langchain-text-splitters
121
+ langchain-openai==0.2.14
122
+ # via
123
+ # versionhq (pyproject.toml)
124
+ # composio-langchain
125
+ langchain-text-splitters==0.3.4
126
+ # via langchain
127
+ langchainhub==0.1.21
128
+ # via composio-langchain
129
+ langsmith==0.2.10
130
+ # via
131
+ # langchain
132
+ # langchain-core
102
133
  litellm==1.56.5
103
134
  # via versionhq (pyproject.toml)
104
135
  markdown-it-py==3.0.0
@@ -113,13 +144,21 @@ multidict==6.1.0
113
144
  # via
114
145
  # aiohttp
115
146
  # yarl
147
+ numpy==2.2.1
148
+ # via langchain
116
149
  openai==1.58.1
117
150
  # via
118
151
  # versionhq (pyproject.toml)
119
152
  # composio-openai
153
+ # langchain-openai
120
154
  # litellm
155
+ orjson==3.10.13
156
+ # via langsmith
121
157
  packaging==24.2
122
- # via huggingface-hub
158
+ # via
159
+ # huggingface-hub
160
+ # langchain-core
161
+ # langchainhub
123
162
  paramiko==3.5.0
124
163
  # via composio-core
125
164
  propcache==0.2.1
@@ -132,7 +171,11 @@ pydantic==2.10.4
132
171
  # via
133
172
  # versionhq (pyproject.toml)
134
173
  # composio-core
174
+ # composio-langchain
135
175
  # fastapi
176
+ # langchain
177
+ # langchain-core
178
+ # langsmith
136
179
  # litellm
137
180
  # openai
138
181
  pydantic-core==2.27.2
@@ -150,7 +193,10 @@ python-dotenv==1.0.1
150
193
  # versionhq (pyproject.toml)
151
194
  # litellm
152
195
  pyyaml==6.0.2
153
- # via huggingface-hub
196
+ # via
197
+ # huggingface-hub
198
+ # langchain
199
+ # langchain-core
154
200
  referencing==0.35.1
155
201
  # via
156
202
  # jsonschema
@@ -164,8 +210,14 @@ requests==2.32.3
164
210
  # versionhq (pyproject.toml)
165
211
  # composio-core
166
212
  # huggingface-hub
213
+ # langchain
214
+ # langchainhub
215
+ # langsmith
167
216
  # pysher
217
+ # requests-toolbelt
168
218
  # tiktoken
219
+ requests-toolbelt==1.0.0
220
+ # via langsmith
169
221
  rich==13.9.4
170
222
  # via composio-core
171
223
  rpds-py==0.22.3
@@ -183,29 +235,42 @@ sniffio==1.3.1
183
235
  # anyio
184
236
  # httpx
185
237
  # openai
238
+ sqlalchemy==2.0.36
239
+ # via langchain
186
240
  starlette==0.41.3
187
241
  # via fastapi
242
+ tenacity==9.0.0
243
+ # via
244
+ # langchain
245
+ # langchain-core
188
246
  tiktoken==0.8.0
189
- # via litellm
247
+ # via
248
+ # langchain-openai
249
+ # litellm
190
250
  tokenizers==0.21.0
191
251
  # via litellm
192
252
  tqdm==4.67.1
193
253
  # via
194
254
  # huggingface-hub
195
255
  # openai
256
+ types-requests==2.32.0.20241016
257
+ # via langchainhub
196
258
  typing==3.10.0.0
197
259
  # via versionhq (pyproject.toml)
198
260
  typing-extensions==4.12.2
199
261
  # via
200
262
  # fastapi
201
263
  # huggingface-hub
264
+ # langchain-core
202
265
  # openai
203
266
  # pydantic
204
267
  # pydantic-core
268
+ # sqlalchemy
205
269
  urllib3==2.3.0
206
270
  # via
207
271
  # requests
208
272
  # sentry-sdk
273
+ # types-requests
209
274
  uvicorn==0.34.0
210
275
  # via composio-core
211
276
  websocket-client==1.8.0
@@ -15,10 +15,10 @@ from versionhq.llm.model import LLM
15
15
  from versionhq.task.model import Task, TaskOutput
16
16
  from versionhq.team.model import Team, TeamOutput
17
17
  from versionhq.tool.model import Tool
18
- from versionhq.tool.composio import Composio
18
+ from versionhq.tool.composio_tool import ComposioHandler
19
19
 
20
20
 
21
- __version__ = "1.1.9.1"
21
+ __version__ = "1.1.9.3"
22
22
  __all__ = [
23
23
  "Agent",
24
24
  "Customer",
@@ -34,5 +34,5 @@ __all__ = [
34
34
  "Team",
35
35
  "TeamOutput",
36
36
  "Tool",
37
- "Composio"
37
+ "ComposioHandler"
38
38
  ]
@@ -10,23 +10,21 @@ class Printer:
10
10
  self._print_purple(content)
11
11
  elif color == "red":
12
12
  self._print_red(content)
13
- elif color == "bold_green":
14
- self._print_bold_green(content)
15
- elif color == "bold_purple":
16
- self._print_bold_purple(content)
17
- elif color == "bold_blue":
18
- self._print_bold_blue(content)
13
+ elif color == "green":
14
+ self._print_green(content)
15
+ elif color == "purple":
16
+ self._print_purple(content)
17
+ elif color == "blue":
18
+ self._print_blue(content)
19
19
  elif color == "yellow":
20
20
  self._print_yellow(content)
21
- elif color == "bold_yellow":
22
- self._print_bold_yellow(content)
23
21
  else:
24
22
  print(content)
25
23
 
26
- def _print_bold_purple(self, content):
24
+ def _print_purple(self, content):
27
25
  print("\033[1m\033[95m {}\033[00m".format(content))
28
26
 
29
- def _print_bold_green(self, content):
27
+ def _print_green(self, content):
30
28
  print("\033[1m\033[92m {}\033[00m".format(content))
31
29
 
32
30
  def _print_purple(self, content):
@@ -35,23 +33,18 @@ class Printer:
35
33
  def _print_red(self, content):
36
34
  print("\033[91m {}\033[00m".format(content))
37
35
 
38
- def _print_bold_blue(self, content):
36
+ def _print_blue(self, content):
39
37
  print("\033[1m\033[94m {}\033[00m".format(content))
40
38
 
41
39
  def _print_yellow(self, content):
42
- print("\033[93m {}\033[00m".format(content))
43
-
44
- def _print_bold_yellow(self, content):
45
40
  print("\033[1m\033[93m {}\033[00m".format(content))
46
41
 
47
42
 
48
43
  class Logger(BaseModel):
49
- verbose: bool = Field(default=False)
44
+ verbose: bool = Field(default=True)
50
45
  _printer: Printer = PrivateAttr(default_factory=Printer)
51
46
 
52
- def log(self, level, message, color="bold_yellow"):
47
+ def log(self, level, message, color="yellow"):
53
48
  if self.verbose:
54
49
  timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
55
- self._printer.print(
56
- f"\n[{timestamp}][{level.upper()}]: {message}", color=color
57
- )
50
+ self._printer.print(f"\n[{timestamp}][{level.upper()}]: {message}", color=color)
@@ -6,11 +6,9 @@ from dotenv import load_dotenv
6
6
  from pydantic import UUID4, BaseModel, Field, InstanceOf, PrivateAttr, model_validator, field_validator
7
7
  from pydantic_core import PydanticCustomError
8
8
 
9
- from versionhq._utils.cache_handler import CacheHandler
10
9
  from versionhq._utils.logger import Logger
11
10
  from versionhq._utils.rpm_controller import RPMController
12
11
  from versionhq._utils.usage_metrics import UsageMetrics
13
- from versionhq.agent.parser import AgentAction
14
12
  from versionhq.llm.llm_vars import LLM_VARS
15
13
  from versionhq.llm.model import LLM, DEFAULT_CONTEXT_WINDOW
16
14
  from versionhq.task import TaskOutputFormat
@@ -122,10 +120,7 @@ class Agent(BaseModel):
122
120
 
123
121
  # config, cache, error handling
124
122
  config: Optional[Dict[str, Any]] = Field(default=None, exclude=True, description="Configuration for the agent")
125
- cache: bool = Field(default=True, description="Whether the agent should use a cache for tool usage.")
126
- cache_handler: InstanceOf[CacheHandler] = Field(default=None, description="An instance of the CacheHandler class.")
127
123
  formatting_errors: int = Field(default=0, description="Number of formatting errors.")
128
- verbose: bool = Field(default=True, description="Verbose mode for the Agent Execution")
129
124
  agent_ops_agent_name: str = None
130
125
  agent_ops_agent_id: str = None
131
126
 
@@ -0,0 +1,5 @@
1
+ from enum import Enum
2
+
3
+
4
+ class Status(str, Enum):
5
+ ON_WORKFLOW = "on_workflow"
@@ -0,0 +1,53 @@
1
+ import uuid
2
+ from abc import ABC, abstractmethod
3
+ from typing import Any, Dict, List, Callable, Type, Optional, get_args, get_origin
4
+ from pydantic import UUID4, InstanceOf, BaseModel, ConfigDict, Field, create_model, field_validator, model_validator
5
+ from pydantic_core import PydanticCustomError
6
+
7
+ from versionhq.clients.product.model import Product, ProductProvider
8
+ from versionhq.clients.customer import Status
9
+
10
+
11
+ class BaseCustomer(ABC, BaseModel):
12
+ """
13
+ Abstract base class for the base customer
14
+ """
15
+
16
+ id: UUID4 = Field(default_factory=uuid.uuid4, frozen=True)
17
+ name: Optional[str] = Field(default=None, description="customer's name if any")
18
+ products: Optional[List[Product]] = Field(default=list, description="store products that the customer is associated with")
19
+ analysis: str = Field(default=None, description="store the latest analysis results on the customer")
20
+ status: str = Field(default=Status.ON_WORKFLOW)
21
+
22
+
23
+ @field_validator("id", mode="before")
24
+ @classmethod
25
+ def _deny_user_set_id(cls, v: Optional[UUID4]) -> None:
26
+ if v:
27
+ raise PydanticCustomError("may_not_set_field", "This field is not to be set by the user.", {})
28
+
29
+
30
+ def customer_to(self) -> List[ProductProvider]:
31
+ """
32
+ Return list of ProductProvider if the customer has `product_list`
33
+ """
34
+
35
+ res = []
36
+ if self.products:
37
+ for item in self.products:
38
+ if item.provider not in res:
39
+ res.appned(item.provider)
40
+ return res
41
+
42
+
43
+ @abstractmethod
44
+ def _deploy(self, *args, **kwargs) -> Any:
45
+ """Any method to deploy targeting the customer"""
46
+
47
+
48
+ class Customer(BaseCustomer):
49
+ id: UUID4 = Field(default_factory=uuid.uuid4, frozen=True)
50
+ name: Optional[str] = Field(default=None, description="customer's name if any")
51
+ products: Optional[List[Product]] = Field(default=list, description="store products that the customer is associated with")
52
+ analysis: str = Field(default=None, description="store the latest analysis results on the customer")
53
+ status: str = Field(default=Status.ON_WORKFLOW)
@@ -1,22 +1,23 @@
1
1
  import uuid
2
+ from abc import ABC, abstractmethod
2
3
  from typing import Any, Dict, List, Callable, Type, Optional, get_args, get_origin
4
+
3
5
  from pydantic import UUID4, InstanceOf, BaseModel, ConfigDict, Field, create_model, field_validator, model_validator
4
6
  from pydantic_core import PydanticCustomError
5
7
 
8
+ from versionhq.tool import ComposioAppName
9
+
6
10
 
7
- class ProductProvider(BaseModel):
11
+ class ProductProvider(ABC, BaseModel):
8
12
  """
9
- Store the minimal client information.
10
- `data_pipeline` and `destinations` are for composio plug-in.
11
- (!REFINEME) Create an Enum list for the options.
12
- (!REFINEME) Create an Enum list for regions.
13
+ Abstract class for the product provider entity.
13
14
  """
14
15
 
15
16
  id: UUID4 = Field(default_factory=uuid.uuid4, frozen=True)
16
- name: Optional[str] = Field(default=None, description="client name")
17
+ name: Optional[str] = Field(default=None)
17
18
  region: Optional[str] = Field(default=None, description="region of client's main business operation")
18
- data_pipeline: Optional[List[str]] = Field(default=None, description="store the data pipelines that the client is using")
19
- destinations: Optional[List[str]] = Field(default=None,description="store the destination services that the client is using")
19
+ data_pipelines: Optional[List[ComposioAppName | str]] = Field(default_factory=list)
20
+ destination_services: Optional[List[ComposioAppName | str]] = Field(default=None)
20
21
 
21
22
  @field_validator("id", mode="before")
22
23
  @classmethod
@@ -10,6 +10,7 @@ from versionhq.clients.product.model import Product
10
10
  from versionhq.clients.customer.model import Customer
11
11
  from versionhq.agent.model import Agent
12
12
  from versionhq.team.model import Team
13
+ from versionhq.tool import ComposioAppName
13
14
 
14
15
 
15
16
  class ScoreFormat:
@@ -57,14 +58,12 @@ class Score:
57
58
  class MessagingComponent(ABC, BaseModel):
58
59
  layer_id: int = Field(default=0, description="add id of the layer: 0, 1, 2")
59
60
  message: str = Field(default=None, max_length=1024, description="text message content to be sent")
60
- interval: Optional[str] = Field(
61
- default=None, description="interval to move on to the next layer. if this is the last layer, set as `None`"
62
- )
63
- score: float | InstanceOf[Score] = Field(default=None)
64
- condition: str = Field(default=None, max_length=128, description="condition to execute the next messaging component")
61
+ score: InstanceOf[Score] = Field(default=None)
62
+ condition: str = Field(default=None, max_length=128, description="condition to execute the next component")
63
+ interval: Optional[str] = Field(default=None, description="ideal interval to set to assess the condition")
65
64
 
66
65
 
67
- def store_scoring_result(self, scoring_subject: str, score_raw: int | Score | ScoreFormat = None) -> Self:
66
+ def store_scoring_result(self, subject: str, score_raw: int | Score | ScoreFormat = None) -> Self:
68
67
  """
69
68
  Set up the `score` field
70
69
  """
@@ -74,12 +73,12 @@ class MessagingComponent(ABC, BaseModel):
74
73
 
75
74
  elif isinstance(score_raw, ScoreFormat):
76
75
  score_instance = Score()
77
- setattr(score_instance, scoring_subject, score_raw)
76
+ setattr(score_instance, subject, score_raw)
78
77
  setattr(self, "score", score_instance)
79
78
 
80
79
  elif isinstance(score_raw, int) or isinstance(score_raw, float):
81
80
  score_instance, score_format_instance = Score(), ScoreFormat(rate=score_raw, weight=1)
82
- setattr(score_instance, "kwargs", { scoring_subject: score_format_instance })
81
+ setattr(score_instance, "kwargs", { subject: score_format_instance })
83
82
  setattr(self, "score", score_instance)
84
83
 
85
84
  else:
@@ -100,23 +99,17 @@ class MessagingWorkflow(ABC, BaseModel):
100
99
  model_config = ConfigDict()
101
100
 
102
101
  id: UUID4 = Field(default_factory=uuid.uuid4, frozen=True)
103
- components: List[MessagingComponent] = Field(default_factory=list, description="store messaging components in the workflow")
102
+ messaging_components: List[MessagingComponent] = Field(default_factory=list, description="store messaging components in the workflow")
104
103
 
105
104
  # responsible tean or agents
106
- team: Optional[Team] = Field(default=None, description="store `Team` instance responsibile for autopiloting this workflow")
107
- agents: Optional[List[Agent]] = Field(
108
- default=None, description="store `Agent` instances responsible for autopiloting this workflow. if the team exsits, this field remains as `None`")
105
+ team: Optional[Team] = Field(default=None, description="store a responsibile team to autopilot the workflow")
106
+ agents: Optional[List[Agent]] = Field(default=None, description="store responsible agents. None when the team exists")
109
107
 
110
108
  # metrics
111
- destination: Optional[str | None] = Field(default=None, description="destination service to launch this workflow")
109
+ destination: Optional[ComposioAppName | str] = Field(default=None, description="destination service to launch the workflow")
112
110
  product: InstanceOf[Product] = Field(default=None)
113
111
  customer: InstanceOf[Customer] = Field(default=None)
114
-
115
- metrics: List[Dict[str, Any]] | List[str] = Field(
116
- default=None,
117
- max_length=256,
118
- description="store metrics that used to predict and track the performance of this workflow."
119
- )
112
+ performance_metrics: List[Dict[str, Any]] | List[str] = Field(default=None, max_length=256, description="performance metrics to track")
120
113
 
121
114
  @field_validator("id", mode="before")
122
115
  @classmethod
@@ -132,11 +125,11 @@ class MessagingWorkflow(ABC, BaseModel):
132
125
  Prioritize customer's destination to the product provider's destination list.
133
126
  """
134
127
  if self.destination is None:
135
- if self.customer is not None:
136
- self.destination = self.customer.on
128
+ # if self.customer is not None:
129
+ # self.destination = self.customer.on
137
130
 
138
- elif self.product.provider is not None and self.product.provider.destinations:
139
- self.destination = self.product.provider.destinations[0]
131
+ if self.product.provider is not None and self.product.provider.destination_services:
132
+ self.destination = self.product.provider.destination_services[0]
140
133
 
141
134
  return self
142
135
 
@@ -40,10 +40,11 @@ composio_app_set = [
40
40
  (ComposioAppName.LINKEDIN, ComposioAuthScheme.OAUTH2),
41
41
  ]
42
42
 
43
- class COMPOSIO_STATUS(str, Enum):
44
- INITIATED = "initiated"
45
- ACTIVE = "active"
46
- FAILED = "failed"
43
+ class ComposioStatus(str, Enum):
44
+ INITIATED = "INITIATED"
45
+ ACTIVE = "ACTIVE"
46
+ FAILED = "FAILED"
47
+
47
48
 
48
49
 
49
50
 
@@ -51,3 +52,5 @@ class ComposioAction(str, Enum):
51
52
  """
52
53
  Enum to store composio's action that can be called via `Actions.xxx`
53
54
  """
55
+ # HUBSPOT_INITIATE_DATA_IMPORT_PROCESS = "hubspot_initate_date_import_process"
56
+ HUBSPOT_CREATE_PIPELINE_STAGE = "hubspot_create_pipeline_stage"