versionhq 1.2.1.0__tar.gz → 1.2.1.2__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.
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/.gitignore +1 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/PKG-INFO +74 -64
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/README.md +73 -63
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/core/task.md +1 -1
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/index.md +5 -5
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/quickstart.md +33 -27
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/pyproject.toml +1 -1
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/requirements.txt +2 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/__init__.py +9 -9
- versionhq-1.2.1.2/src/versionhq/_utils/logger.py +97 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/agent/inhouse_agents.py +7 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/agent/model.py +2 -2
- {versionhq-1.2.1.0/src/versionhq/team → versionhq-1.2.1.2/src/versionhq/agent_network}/model.py +88 -68
- {versionhq-1.2.1.0/src/versionhq/graph → versionhq-1.2.1.2/src/versionhq/clients/workflow}/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/clients/workflow/model.py +10 -10
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/knowledge/source.py +2 -2
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/knowledge/source_docling.py +1 -1
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/memory/model.py +1 -1
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/task/formation.py +10 -10
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/task/model.py +9 -8
- {versionhq-1.2.1.0/src/versionhq/team → versionhq-1.2.1.2/src/versionhq/task_graph}/__init__.py +0 -0
- {versionhq-1.2.1.0/src/versionhq/graph → versionhq-1.2.1.2/src/versionhq/task_graph}/model.py +1 -21
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq.egg-info/PKG-INFO +74 -64
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq.egg-info/SOURCES.txt +10 -11
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/agent/agent_test.py +0 -1
- versionhq-1.2.1.0/tests/team/team_test.py → versionhq-1.2.1.2/tests/agent_network/agent_network_test.py +55 -55
- {versionhq-1.2.1.0/tests/graph → versionhq-1.2.1.2/tests/cli}/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/doc_test.py +31 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/formation_test.py +2 -7
- {versionhq-1.2.1.0/tests/team → versionhq-1.2.1.2/tests/task_graph}/__init__.py +0 -0
- versionhq-1.2.1.0/tests/tool/__init__.py → versionhq-1.2.1.2/tests/task_graph/task_graph_test.py +0 -0
- versionhq-1.2.1.2/tests/tool/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/usecase_test.py +1 -1
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/uv.lock +28 -28
- versionhq-1.2.1.0/src/versionhq/_utils/logger.py +0 -50
- versionhq-1.2.1.0/src/versionhq/team/team_planner.py +0 -92
- versionhq-1.2.1.0/tests/graph/graph_test.py +0 -6
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/.github/workflows/publish.yml +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/.github/workflows/run_tests.yml +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/.pre-commit-config.yaml +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/.python-version +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/LICENSE +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/SECURITY.md +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/db/preprocess.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/CNAME +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/_logos/favicon.ico +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/_logos/logo192.png +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/core/Agent.md +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/core/task/response-field.md +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/core/task/task-output.md +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/core/task-graph.md +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/core/tool.md +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/docs/stylesheets/main.css +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/mkdocs.yml +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/requirements-dev.txt +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/runtime.txt +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/setup.cfg +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.2.1.0/src/versionhq/cli → versionhq-1.2.1.2/src/versionhq/agent_network}/__init__.py +0 -0
- {versionhq-1.2.1.0/src/versionhq/clients → versionhq-1.2.1.2/src/versionhq/cli}/__init__.py +0 -0
- {versionhq-1.2.1.0/src/versionhq/clients/product → versionhq-1.2.1.2/src/versionhq/clients}/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.2.1.0/src/versionhq/clients/workflow → versionhq-1.2.1.2/src/versionhq/clients/product}/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/llm/llm_vars.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/llm/model.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/storage/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/task/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/task/evaluate.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/task/log_handler.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/task/structured_response.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/tool/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq.egg-info/requires.txt +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/agent/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/agent/doc_test.py +0 -0
- {versionhq-1.2.1.0/tests/team → versionhq-1.2.1.2/tests/agent_network}/Prompts/Demo_test.py +0 -0
- {versionhq-1.2.1.0/tests/cli → versionhq-1.2.1.2/tests/agent_network}/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/clients/customer_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/clients/product_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/conftest.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/knowledge/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/llm/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/llm/llm_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/memory/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/memory/memory_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/task/__init__.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/task/doc_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/task/llm_connection_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/task/task_test.py +0 -0
- {versionhq-1.2.1.0/tests/graph → versionhq-1.2.1.2/tests/task_graph}/doc_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/tool/composio_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/tool/doc_test.py +0 -0
- {versionhq-1.2.1.0 → versionhq-1.2.1.2}/tests/tool/tool_test.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.2.1.
|
3
|
+
Version: 1.2.1.2
|
4
4
|
Summary: An agentic orchestration framework for building agent networks that handle task automation.
|
5
5
|
Author-email: Kuriko Iwai <kuriko@versi0n.io>
|
6
6
|
License: MIT License
|
@@ -117,10 +117,10 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
117
117
|
- [Supervising](#supervising)
|
118
118
|
- [Technologies Used](#technologies-used)
|
119
119
|
- [Project Structure](#project-structure)
|
120
|
-
- [Setting Up
|
121
|
-
- [
|
122
|
-
- [
|
123
|
-
- [
|
120
|
+
- [Setting Up Your Project](#setting-up-your-project)
|
121
|
+
- [Installing package manager](#installing-package-manager)
|
122
|
+
- [Installing dependencies](#installing-dependencies)
|
123
|
+
- [Adding env secrets to .env file](#adding-env-secrets-to-env-file)
|
124
124
|
- [Contributing](#contributing)
|
125
125
|
- [Steps](#steps)
|
126
126
|
- [Package Management with uv](#package-management-with-uv)
|
@@ -256,7 +256,7 @@ agent.update(
|
|
256
256
|
res = network.launch()
|
257
257
|
```
|
258
258
|
|
259
|
-
|
259
|
+
This will form a network with multiple agents on `Formation` and return `TaskOutput` object with output in JSON, plane text, Pydantic model format with evaluation.
|
260
260
|
|
261
261
|
|
262
262
|
### Executing tasks
|
@@ -266,81 +266,87 @@ You can simply build an agent using `Agent` model and execute the task using `Ta
|
|
266
266
|
By default, agents prioritize JSON over plane text outputs.
|
267
267
|
|
268
268
|
|
269
|
-
|
270
|
-
|
271
|
-
|
269
|
+
```python
|
270
|
+
import versionhq as vhq
|
271
|
+
from pydantic import BaseModel
|
272
272
|
|
273
|
-
|
274
|
-
|
275
|
-
|
273
|
+
class CustomOutput(BaseModel):
|
274
|
+
test1: str
|
275
|
+
test2: list[str]
|
276
276
|
|
277
|
-
|
278
|
-
|
277
|
+
def dummy_func(message: str, test1: str, test2: list[str]) -> str:
|
278
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
279
279
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
280
|
+
task = vhq.Task(
|
281
|
+
description="Amazing task",
|
282
|
+
pydantic_output=CustomOutput,
|
283
|
+
callback=dummy_func,
|
284
|
+
callback_kwargs=dict(message="Hi! Here is the result: ")
|
285
|
+
)
|
286
286
|
|
287
|
-
|
288
|
-
|
289
|
-
|
287
|
+
res = task.execute(context="amazing context to consider.")
|
288
|
+
print(res)
|
289
|
+
```
|
290
290
|
|
291
291
|
|
292
292
|
This will return a `TaskOutput` object that stores response in plane text, JSON, and Pydantic model: `CustomOutput` formats with a callback result, tool output (if given), and evaluation results (if given).
|
293
293
|
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
294
|
+
```python
|
295
|
+
res == TaskOutput(
|
296
|
+
task_id=UUID('<TASK UUID>'),
|
297
|
+
raw='{\"test1\":\"random str\", \"test2\":[\"str item 1\", \"str item 2\", \"str item 3\"]}',
|
298
|
+
json_dict={'test1': 'random str', 'test2': ['str item 1', 'str item 2', 'str item 3']},
|
299
|
+
pydantic=<class '__main__.CustomOutput'>,
|
300
|
+
tool_output=None,
|
301
|
+
callback_output='Hi! Here is the result: random str, str item 1, str item 2, str item 3', # returned a plain text summary
|
302
|
+
evaluation=None
|
303
|
+
)
|
304
|
+
```
|
305
305
|
|
306
306
|
### Supervising
|
307
307
|
|
308
|
-
|
309
|
-
import versionhq as vhq
|
308
|
+
To create an agent network with one or more manager agents, designate members using the `is_manager` tag.
|
310
309
|
|
311
|
-
|
312
|
-
|
310
|
+
```python
|
311
|
+
import versionhq as vhq
|
313
312
|
|
314
|
-
|
315
|
-
|
316
|
-
response_fields=[vhq.ResponseField(title="test1", data_type=str, required=True),],
|
317
|
-
allow_delegation=True
|
318
|
-
)
|
313
|
+
agent_a = vhq.Agent(role="agent a", goal="My amazing goals", llm="llm-of-your-choice")
|
314
|
+
agent_b = vhq.Agent(role="agent b", goal="My amazing goals", llm="llm-of-your-choice")
|
319
315
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
316
|
+
task_1 = vhq.Task(
|
317
|
+
description="Analyze the client's business model.",
|
318
|
+
response_fields=[vhq.ResponseField(title="test1", data_type=str, required=True),],
|
319
|
+
allow_delegation=True
|
320
|
+
)
|
325
321
|
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
322
|
+
task_2 = vhq.Task(
|
323
|
+
description="Define a cohort.",
|
324
|
+
response_fields=[vhq.ResponseField(title="test1", data_type=int, required=True),],
|
325
|
+
allow_delegation=False
|
326
|
+
)
|
327
|
+
|
328
|
+
network =vhq.AgentNetwork(
|
329
|
+
members=[
|
330
|
+
vhq.Member(agent=agent_a, is_manager=False, tasks=[task_1]),
|
331
|
+
vhq.Member(agent=agent_b, is_manager=True, tasks=[task_2]), # Agent B as a manager
|
332
|
+
],
|
333
|
+
)
|
334
|
+
res = network.launch()
|
335
|
+
|
336
|
+
assert isinstance(res, vhq.NetworkOutput)
|
337
|
+
assert not [item for item in task_1.processed_agents if "vhq-Delegated-Agent" == item]
|
338
|
+
assert [item for item in task_1.processed_agents if "agent b" == item]
|
339
|
+
```
|
334
340
|
|
335
341
|
This will return a list with dictionaries with keys defined in the `ResponseField` of each task.
|
336
342
|
|
337
|
-
Tasks can be delegated to a
|
343
|
+
Tasks can be delegated to a manager, peers within the agent network, or a completely new agent.
|
338
344
|
|
339
345
|
<hr />
|
340
346
|
|
341
347
|
## Technologies Used
|
342
348
|
|
343
|
-
**Graph
|
349
|
+
**Task Graph**
|
344
350
|
|
345
351
|
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
346
352
|
* [Matplotlib](https://matplotlib.org/stable/index.html): Visualization library
|
@@ -401,16 +407,19 @@ src/
|
|
401
407
|
│ └── ...
|
402
408
|
│
|
403
409
|
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
404
|
-
|
410
|
+
│
|
411
|
+
└── _logs/ [.gitignore] # Local directory to store error/warning logs for debugging
|
412
|
+
│
|
413
|
+
│
|
405
414
|
pyproject.toml # Project config
|
406
415
|
|
407
416
|
```
|
408
417
|
|
409
418
|
<hr />
|
410
419
|
|
411
|
-
## Setting Up
|
420
|
+
## Setting Up Your Project
|
412
421
|
|
413
|
-
###
|
422
|
+
### Installing package manager
|
414
423
|
|
415
424
|
For MacOS:
|
416
425
|
|
@@ -424,7 +433,7 @@ pyproject.toml # Project config
|
|
424
433
|
```
|
425
434
|
|
426
435
|
|
427
|
-
###
|
436
|
+
### Installing dependencies
|
428
437
|
|
429
438
|
```
|
430
439
|
uv venv
|
@@ -457,7 +466,7 @@ pyproject.toml # Project config
|
|
457
466
|
|
458
467
|
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
459
468
|
|
460
|
-
###
|
469
|
+
### Adding env secrets to .env file
|
461
470
|
|
462
471
|
Create `.env` file in the project root and add following:
|
463
472
|
|
@@ -470,6 +479,7 @@ Create `.env` file in the project root and add following:
|
|
470
479
|
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
471
480
|
```
|
472
481
|
|
482
|
+
|
473
483
|
<hr />
|
474
484
|
|
475
485
|
## Contributing
|
@@ -574,7 +584,7 @@ Common issues and solutions:
|
|
574
584
|
|
575
585
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
576
586
|
|
577
|
-
* Issues related to
|
587
|
+
* Issues related to agents and other systems: Check `_logs` directory for detailed error messages and stack traces.
|
578
588
|
|
579
589
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
580
590
|
|
@@ -36,10 +36,10 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
36
36
|
- [Supervising](#supervising)
|
37
37
|
- [Technologies Used](#technologies-used)
|
38
38
|
- [Project Structure](#project-structure)
|
39
|
-
- [Setting Up
|
40
|
-
- [
|
41
|
-
- [
|
42
|
-
- [
|
39
|
+
- [Setting Up Your Project](#setting-up-your-project)
|
40
|
+
- [Installing package manager](#installing-package-manager)
|
41
|
+
- [Installing dependencies](#installing-dependencies)
|
42
|
+
- [Adding env secrets to .env file](#adding-env-secrets-to-env-file)
|
43
43
|
- [Contributing](#contributing)
|
44
44
|
- [Steps](#steps)
|
45
45
|
- [Package Management with uv](#package-management-with-uv)
|
@@ -175,7 +175,7 @@ agent.update(
|
|
175
175
|
res = network.launch()
|
176
176
|
```
|
177
177
|
|
178
|
-
|
178
|
+
This will form a network with multiple agents on `Formation` and return `TaskOutput` object with output in JSON, plane text, Pydantic model format with evaluation.
|
179
179
|
|
180
180
|
|
181
181
|
### Executing tasks
|
@@ -185,81 +185,87 @@ You can simply build an agent using `Agent` model and execute the task using `Ta
|
|
185
185
|
By default, agents prioritize JSON over plane text outputs.
|
186
186
|
|
187
187
|
|
188
|
-
|
189
|
-
|
190
|
-
|
188
|
+
```python
|
189
|
+
import versionhq as vhq
|
190
|
+
from pydantic import BaseModel
|
191
191
|
|
192
|
-
|
193
|
-
|
194
|
-
|
192
|
+
class CustomOutput(BaseModel):
|
193
|
+
test1: str
|
194
|
+
test2: list[str]
|
195
195
|
|
196
|
-
|
197
|
-
|
196
|
+
def dummy_func(message: str, test1: str, test2: list[str]) -> str:
|
197
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
198
198
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
199
|
+
task = vhq.Task(
|
200
|
+
description="Amazing task",
|
201
|
+
pydantic_output=CustomOutput,
|
202
|
+
callback=dummy_func,
|
203
|
+
callback_kwargs=dict(message="Hi! Here is the result: ")
|
204
|
+
)
|
205
205
|
|
206
|
-
|
207
|
-
|
208
|
-
|
206
|
+
res = task.execute(context="amazing context to consider.")
|
207
|
+
print(res)
|
208
|
+
```
|
209
209
|
|
210
210
|
|
211
211
|
This will return a `TaskOutput` object that stores response in plane text, JSON, and Pydantic model: `CustomOutput` formats with a callback result, tool output (if given), and evaluation results (if given).
|
212
212
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
213
|
+
```python
|
214
|
+
res == TaskOutput(
|
215
|
+
task_id=UUID('<TASK UUID>'),
|
216
|
+
raw='{\"test1\":\"random str\", \"test2\":[\"str item 1\", \"str item 2\", \"str item 3\"]}',
|
217
|
+
json_dict={'test1': 'random str', 'test2': ['str item 1', 'str item 2', 'str item 3']},
|
218
|
+
pydantic=<class '__main__.CustomOutput'>,
|
219
|
+
tool_output=None,
|
220
|
+
callback_output='Hi! Here is the result: random str, str item 1, str item 2, str item 3', # returned a plain text summary
|
221
|
+
evaluation=None
|
222
|
+
)
|
223
|
+
```
|
224
224
|
|
225
225
|
### Supervising
|
226
226
|
|
227
|
-
|
228
|
-
import versionhq as vhq
|
227
|
+
To create an agent network with one or more manager agents, designate members using the `is_manager` tag.
|
229
228
|
|
230
|
-
|
231
|
-
|
229
|
+
```python
|
230
|
+
import versionhq as vhq
|
232
231
|
|
233
|
-
|
234
|
-
|
235
|
-
response_fields=[vhq.ResponseField(title="test1", data_type=str, required=True),],
|
236
|
-
allow_delegation=True
|
237
|
-
)
|
232
|
+
agent_a = vhq.Agent(role="agent a", goal="My amazing goals", llm="llm-of-your-choice")
|
233
|
+
agent_b = vhq.Agent(role="agent b", goal="My amazing goals", llm="llm-of-your-choice")
|
238
234
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
235
|
+
task_1 = vhq.Task(
|
236
|
+
description="Analyze the client's business model.",
|
237
|
+
response_fields=[vhq.ResponseField(title="test1", data_type=str, required=True),],
|
238
|
+
allow_delegation=True
|
239
|
+
)
|
244
240
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
241
|
+
task_2 = vhq.Task(
|
242
|
+
description="Define a cohort.",
|
243
|
+
response_fields=[vhq.ResponseField(title="test1", data_type=int, required=True),],
|
244
|
+
allow_delegation=False
|
245
|
+
)
|
246
|
+
|
247
|
+
network =vhq.AgentNetwork(
|
248
|
+
members=[
|
249
|
+
vhq.Member(agent=agent_a, is_manager=False, tasks=[task_1]),
|
250
|
+
vhq.Member(agent=agent_b, is_manager=True, tasks=[task_2]), # Agent B as a manager
|
251
|
+
],
|
252
|
+
)
|
253
|
+
res = network.launch()
|
254
|
+
|
255
|
+
assert isinstance(res, vhq.NetworkOutput)
|
256
|
+
assert not [item for item in task_1.processed_agents if "vhq-Delegated-Agent" == item]
|
257
|
+
assert [item for item in task_1.processed_agents if "agent b" == item]
|
258
|
+
```
|
253
259
|
|
254
260
|
This will return a list with dictionaries with keys defined in the `ResponseField` of each task.
|
255
261
|
|
256
|
-
Tasks can be delegated to a
|
262
|
+
Tasks can be delegated to a manager, peers within the agent network, or a completely new agent.
|
257
263
|
|
258
264
|
<hr />
|
259
265
|
|
260
266
|
## Technologies Used
|
261
267
|
|
262
|
-
**Graph
|
268
|
+
**Task Graph**
|
263
269
|
|
264
270
|
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
265
271
|
* [Matplotlib](https://matplotlib.org/stable/index.html): Visualization library
|
@@ -320,16 +326,19 @@ src/
|
|
320
326
|
│ └── ...
|
321
327
|
│
|
322
328
|
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
323
|
-
|
329
|
+
│
|
330
|
+
└── _logs/ [.gitignore] # Local directory to store error/warning logs for debugging
|
331
|
+
│
|
332
|
+
│
|
324
333
|
pyproject.toml # Project config
|
325
334
|
|
326
335
|
```
|
327
336
|
|
328
337
|
<hr />
|
329
338
|
|
330
|
-
## Setting Up
|
339
|
+
## Setting Up Your Project
|
331
340
|
|
332
|
-
###
|
341
|
+
### Installing package manager
|
333
342
|
|
334
343
|
For MacOS:
|
335
344
|
|
@@ -343,7 +352,7 @@ pyproject.toml # Project config
|
|
343
352
|
```
|
344
353
|
|
345
354
|
|
346
|
-
###
|
355
|
+
### Installing dependencies
|
347
356
|
|
348
357
|
```
|
349
358
|
uv venv
|
@@ -376,7 +385,7 @@ pyproject.toml # Project config
|
|
376
385
|
|
377
386
|
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
378
387
|
|
379
|
-
###
|
388
|
+
### Adding env secrets to .env file
|
380
389
|
|
381
390
|
Create `.env` file in the project root and add following:
|
382
391
|
|
@@ -389,6 +398,7 @@ Create `.env` file in the project root and add following:
|
|
389
398
|
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
390
399
|
```
|
391
400
|
|
401
|
+
|
392
402
|
<hr />
|
393
403
|
|
394
404
|
## Contributing
|
@@ -493,7 +503,7 @@ Common issues and solutions:
|
|
493
503
|
|
494
504
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
495
505
|
|
496
|
-
* Issues related to
|
506
|
+
* Issues related to agents and other systems: Check `_logs` directory for detailed error messages and stack traces.
|
497
507
|
|
498
508
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
499
509
|
|
@@ -9,7 +9,7 @@ tags:
|
|
9
9
|
|
10
10
|
<class>`class` versionhq.task.model.<bold>Task<bold></class>
|
11
11
|
|
12
|
-
A class to store and manage information for individual tasks, including their assignment to agents or
|
12
|
+
A class to store and manage information for individual tasks, including their assignment to agents or agent networks, and dependencies via a node-based system that tracks conditions and status.
|
13
13
|
|
14
14
|
Ref. Node / Edge / TaskGraph class
|
15
15
|
|
@@ -35,7 +35,7 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
35
35
|
Agents are model-agnostic, and will improve task output, while oprimizing token cost and job latency, by sharing their memory, knowledge base, and RAG tools with other agents in the network.
|
36
36
|
|
37
37
|
|
38
|
-
###
|
38
|
+
### Agent Network
|
39
39
|
|
40
40
|
Agents adapt their formation based on task complexity.
|
41
41
|
|
@@ -139,7 +139,7 @@ agent.update(
|
|
139
139
|
|
140
140
|
## Project Set Up
|
141
141
|
|
142
|
-
|
142
|
+
**Installing package manager**
|
143
143
|
|
144
144
|
For MacOS:
|
145
145
|
|
@@ -152,7 +152,7 @@ agent.update(
|
|
152
152
|
sudo apt-get install uv
|
153
153
|
```
|
154
154
|
|
155
|
-
|
155
|
+
**Installing dependencies**
|
156
156
|
|
157
157
|
```
|
158
158
|
uv venv
|
@@ -186,7 +186,7 @@ agent.update(
|
|
186
186
|
|
187
187
|
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
188
188
|
|
189
|
-
|
189
|
+
**Setting up a local env file**
|
190
190
|
|
191
191
|
Create `.env` file in the project root and add following:
|
192
192
|
|
@@ -216,7 +216,7 @@ Common issues and solutions:
|
|
216
216
|
|
217
217
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
218
218
|
|
219
|
-
* Issues related to
|
219
|
+
* Issues related to agents and other systems: Check `_logs` directory for detailed error messages and stack traces.
|
220
220
|
|
221
221
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
222
222
|
|
@@ -84,33 +84,39 @@ This will return a `TaskOutput` object that stores response in plane text, JSON,
|
|
84
84
|
|
85
85
|
## Supervising
|
86
86
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
)
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
)
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
],
|
110
|
-
|
111
|
-
|
112
|
-
|
87
|
+
To create an agent network with one or more manager agents, designate members using the `is_manager` tag.
|
88
|
+
|
89
|
+
```python
|
90
|
+
import versionhq as vhq
|
91
|
+
|
92
|
+
agent_a = vhq.Agent(role="agent a", goal="My amazing goals", llm="llm-of-your-choice")
|
93
|
+
agent_b = vhq.Agent(role="agent b", goal="My amazing goals", llm="llm-of-your-choice")
|
94
|
+
|
95
|
+
task_1 = vhq.Task(
|
96
|
+
description="Analyze the client's business model.",
|
97
|
+
response_fields=[vhq.ResponseField(title="test1", data_type=str, required=True),],
|
98
|
+
allow_delegation=True
|
99
|
+
)
|
100
|
+
|
101
|
+
task_2 = vhq.Task(
|
102
|
+
description="Define a cohort.",
|
103
|
+
response_fields=[vhq.ResponseField(title="test1", data_type=int, required=True),],
|
104
|
+
allow_delegation=False
|
105
|
+
)
|
106
|
+
|
107
|
+
network =vhq.AgentNetwork(
|
108
|
+
members=[
|
109
|
+
vhq.Member(agent=agent_a, is_manager=False, tasks=[task_1]),
|
110
|
+
vhq.Member(agent=agent_b, is_manager=True, tasks=[task_2]), # Agent B as a manager
|
111
|
+
],
|
112
|
+
)
|
113
|
+
res = network.launch()
|
114
|
+
|
115
|
+
assert isinstance(res, vhq.NetworkOutput)
|
116
|
+
assert not [item for item in task_1.processed_agents if "vhq-Delegated-Agent" == item]
|
117
|
+
assert [item for item in task_1.processed_agents if "agent b" == item]
|
118
|
+
```
|
113
119
|
|
114
120
|
This will return a list with dictionaries with keys defined in the `ResponseField` of each task.
|
115
121
|
|
116
|
-
Tasks can be delegated to a
|
122
|
+
Tasks can be delegated to a manager, peers within the agent network, or a completely new agent.
|
@@ -15,7 +15,7 @@ exclude = ["test*", "__pycache__", "*.egg-info"]
|
|
15
15
|
|
16
16
|
[project]
|
17
17
|
name = "versionhq"
|
18
|
-
version = "1.2.1.
|
18
|
+
version = "1.2.1.2"
|
19
19
|
authors = [{ name = "Kuriko Iwai", email = "kuriko@versi0n.io" }]
|
20
20
|
description = "An agentic orchestration framework for building agent networks that handle task automation."
|
21
21
|
readme = "README.md"
|
@@ -8,6 +8,7 @@ from dotenv import load_dotenv
|
|
8
8
|
load_dotenv(override=True)
|
9
9
|
|
10
10
|
from versionhq.agent.model import Agent
|
11
|
+
from versionhq.agent_network.model import AgentNetwork, NetworkOutput, Formation, Member, TaskHandlingProcess
|
11
12
|
from versionhq.llm.model import LLM
|
12
13
|
from versionhq.llm.llm_vars import LLM_CONTEXT_WINDOW_SIZES, PARAMS, PROVIDERS, MODELS
|
13
14
|
from versionhq.clients.customer.model import Customer
|
@@ -16,10 +17,9 @@ from versionhq.clients.workflow.model import MessagingWorkflow, MessagingCompone
|
|
16
17
|
from versionhq.knowledge.model import Knowledge, KnowledgeStorage
|
17
18
|
from versionhq.knowledge.source import PDFKnowledgeSource, CSVKnowledgeSource, JSONKnowledgeSource, TextFileKnowledgeSource, ExcelKnowledgeSource, StringKnowledgeSource
|
18
19
|
from versionhq.knowledge.source_docling import DoclingSource
|
19
|
-
from versionhq.
|
20
|
+
from versionhq.task_graph.model import TaskStatus, TaskGraph, Node, Edge, DependencyType
|
20
21
|
from versionhq.task.model import Task, TaskOutput, ResponseField, TaskExecutionType
|
21
22
|
from versionhq.task.evaluate import Evaluation, EvaluationItem
|
22
|
-
from versionhq.team.model import Team, TeamOutput, Formation, Member, TaskHandlingProcess
|
23
23
|
from versionhq.tool.model import Tool, ToolSet
|
24
24
|
from versionhq.tool.cache_handler import CacheHandler
|
25
25
|
from versionhq.tool.tool_handler import ToolHandler
|
@@ -30,10 +30,16 @@ from versionhq.memory.model import ShortTermMemory,LongTermMemory, UserMemory, M
|
|
30
30
|
from versionhq.task.formation import form_agent_network
|
31
31
|
|
32
32
|
|
33
|
-
__version__ = "1.2.1.
|
33
|
+
__version__ = "1.2.1.2"
|
34
34
|
__all__ = [
|
35
35
|
"Agent",
|
36
36
|
|
37
|
+
"AgentNetwork",
|
38
|
+
"NetworkOutput",
|
39
|
+
"Formation",
|
40
|
+
"Member",
|
41
|
+
"TaskHandlingProcess",
|
42
|
+
|
37
43
|
"LLM",
|
38
44
|
"LLM_CONTEXT_WINDOW_SIZES",
|
39
45
|
"PARAMS",
|
@@ -70,12 +76,6 @@ __all__ = [
|
|
70
76
|
"Evaluation",
|
71
77
|
"EvaluationItem",
|
72
78
|
|
73
|
-
"Team",
|
74
|
-
"TeamOutput",
|
75
|
-
"Formation",
|
76
|
-
"Member",
|
77
|
-
"TaskHandlingProcess",
|
78
|
-
|
79
79
|
"Tool",
|
80
80
|
"ToolSet",
|
81
81
|
"CacheHandler",
|