versionhq 1.2.2.0__tar.gz → 1.2.2.1__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.2.0 → versionhq-1.2.2.1}/PKG-INFO +10 -9
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/README.md +9 -8
- versionhq-1.2.2.1/docs/core/agent-network/config.md +102 -0
- versionhq-1.2.2.1/docs/core/agent-network/form.md +117 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/agent-network/index.md +4 -3
- versionhq-1.2.2.1/docs/core/agent-network/ref.md +141 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/index.md +1 -1
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/mkdocs.yml +3 -4
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/pyproject.toml +1 -1
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/__init__.py +1 -1
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent_network/formation.py +13 -3
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent_network/model.py +1 -88
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq.egg-info/PKG-INFO +10 -9
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq.egg-info/SOURCES.txt +2 -2
- versionhq-1.2.2.1/tests/agent_network/doc_test.py +150 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/uv.lock +1 -1
- versionhq-1.2.2.0/docs/core/agent/ref.md +0 -48
- versionhq-1.2.2.0/docs/core/agent-network/config.md +0 -6
- versionhq-1.2.2.0/docs/core/agent-network/ref.md +0 -54
- versionhq-1.2.2.0/docs/core/agent-network/task-handling.md +0 -6
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/.env.sample +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/.github/workflows/publish.yml +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/.github/workflows/run_tests.yml +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/.gitignore +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/.pre-commit-config.yaml +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/.python-version +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/LICENSE +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/SECURITY.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/db/preprocess.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/CNAME +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/_logos/favicon.ico +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/_logos/logo192.png +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/agent/config.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/agent/index.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/agent/task-handling.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/llm/index.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/task/evaluation.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/task/index.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/task/response-field.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/task/task-execution.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/task/task-output.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/task/task-ref.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/task/task-strc-response.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/task-graph/index.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/core/tool.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/quickstart.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/stylesheets/main.css +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/docs/tags.md +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/requirements-dev.txt +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/requirements.txt +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/runtime.txt +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/setup.cfg +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/_utils/logger.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent/inhouse_agents.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/agent_network/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/knowledge/source_docling.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/llm/llm_vars.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/llm/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/storage/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task/evaluation.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task/structured_response.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task_graph/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task_graph/colors.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task_graph/draft.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/task_graph/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/tool/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq.egg-info/requires.txt +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/agent/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/agent/agent_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/agent/doc_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/agent_network/Prompts/Demo_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/agent_network/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/agent_network/agent_network_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/cli/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/clients/customer_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/clients/product_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/conftest.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/doc_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/formation_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/knowledge/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/llm/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/llm/llm_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/memory/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/memory/memory_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/task/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/task/doc_taskoutput_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/task/doc_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/task/eval_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/task/llm_connection_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/task/task_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/task_graph/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/task_graph/doc_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/task_graph/task_graph_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/tool/__init__.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/tool/composio_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/tool/doc_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/tool/tool_test.py +0 -0
- {versionhq-1.2.2.0 → versionhq-1.2.2.1}/tests/usecase_test.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.2.2.
|
3
|
+
Version: 1.2.2.1
|
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
|
@@ -84,7 +84,7 @@ Requires-Dist: pygraphviz>=1.14; extra == "pygraphviz"
|
|
84
84
|
[](https://clickpy.clickhouse.com/dashboard/versionhq)
|
85
85
|

|
86
86
|
[](https://github.com/versionHQ/multi-agent-system/actions/workflows/publish.yml)
|
87
|
-

|
88
88
|

|
89
89
|

|
90
90
|
|
@@ -255,14 +255,14 @@ agent.update(
|
|
255
255
|
```python
|
256
256
|
import versionhq as vhq
|
257
257
|
|
258
|
-
network =
|
258
|
+
network = work(
|
259
259
|
task="YOUR AMAZING TASK OVERVIEW",
|
260
260
|
expected_outcome="YOUR OUTCOME EXPECTATION",
|
261
261
|
)
|
262
|
-
res,
|
262
|
+
res, tg = network.launch()
|
263
263
|
```
|
264
264
|
|
265
|
-
This will form a network with multiple agents on `Formation` and return `TaskOutput` object
|
265
|
+
This will form a agent network with multiple agents on `Formation` and return response in `TaskOutput` object and `TaskGraph` that connects multiple tasks as nodes.
|
266
266
|
|
267
267
|
|
268
268
|
### Executing tasks
|
@@ -295,7 +295,6 @@ res = task.execute(context="context to consider")
|
|
295
295
|
assert isinstance(res, vhq.TaskOutput)
|
296
296
|
```
|
297
297
|
|
298
|
-
|
299
298
|
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).
|
300
299
|
|
301
300
|
```python
|
@@ -338,11 +337,13 @@ network =vhq.AgentNetwork(
|
|
338
337
|
vhq.Member(agent=agent_b, is_manager=True, tasks=[task_2]), # Agent B as a manager
|
339
338
|
],
|
340
339
|
)
|
341
|
-
res,
|
340
|
+
res, tg = network.launch()
|
342
341
|
|
343
342
|
assert isinstance(res, vhq.TaskOutput)
|
344
|
-
assert
|
345
|
-
assert
|
343
|
+
assert agent_b.key in task_1.processed_agents
|
344
|
+
assert agent_b.key in task_2.processed_agents
|
345
|
+
|
346
|
+
assert isinstance(tg, vhq.TaskGraph)
|
346
347
|
```
|
347
348
|
|
348
349
|
This will return a list with dictionaries with keys defined in the `ResponseField` of each task.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
[](https://clickpy.clickhouse.com/dashboard/versionhq)
|
4
4
|

|
5
5
|
[](https://github.com/versionHQ/multi-agent-system/actions/workflows/publish.yml)
|
6
|
-

|
7
7
|

|
8
8
|

|
9
9
|
|
@@ -174,14 +174,14 @@ agent.update(
|
|
174
174
|
```python
|
175
175
|
import versionhq as vhq
|
176
176
|
|
177
|
-
network =
|
177
|
+
network = work(
|
178
178
|
task="YOUR AMAZING TASK OVERVIEW",
|
179
179
|
expected_outcome="YOUR OUTCOME EXPECTATION",
|
180
180
|
)
|
181
|
-
res,
|
181
|
+
res, tg = network.launch()
|
182
182
|
```
|
183
183
|
|
184
|
-
This will form a network with multiple agents on `Formation` and return `TaskOutput` object
|
184
|
+
This will form a agent network with multiple agents on `Formation` and return response in `TaskOutput` object and `TaskGraph` that connects multiple tasks as nodes.
|
185
185
|
|
186
186
|
|
187
187
|
### Executing tasks
|
@@ -214,7 +214,6 @@ res = task.execute(context="context to consider")
|
|
214
214
|
assert isinstance(res, vhq.TaskOutput)
|
215
215
|
```
|
216
216
|
|
217
|
-
|
218
217
|
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).
|
219
218
|
|
220
219
|
```python
|
@@ -257,11 +256,13 @@ network =vhq.AgentNetwork(
|
|
257
256
|
vhq.Member(agent=agent_b, is_manager=True, tasks=[task_2]), # Agent B as a manager
|
258
257
|
],
|
259
258
|
)
|
260
|
-
res,
|
259
|
+
res, tg = network.launch()
|
261
260
|
|
262
261
|
assert isinstance(res, vhq.TaskOutput)
|
263
|
-
assert
|
264
|
-
assert
|
262
|
+
assert agent_b.key in task_1.processed_agents
|
263
|
+
assert agent_b.key in task_2.processed_agents
|
264
|
+
|
265
|
+
assert isinstance(tg, vhq.TaskGraph)
|
265
266
|
```
|
266
267
|
|
267
268
|
This will return a list with dictionaries with keys defined in the `ResponseField` of each task.
|
@@ -0,0 +1,102 @@
|
|
1
|
+
---
|
2
|
+
tags:
|
3
|
+
- Agent Network
|
4
|
+
---
|
5
|
+
|
6
|
+
|
7
|
+
## Adding Members
|
8
|
+
|
9
|
+
<class>`class` versionhq.agent_network.model.<bold>Member<bold></class>
|
10
|
+
|
11
|
+
You can simply add an agent as a member using `members` field.
|
12
|
+
|
13
|
+
```python
|
14
|
+
import versionhq as vhq
|
15
|
+
|
16
|
+
network = vhq.AgentNetwork(
|
17
|
+
members=[
|
18
|
+
vhq.Member(
|
19
|
+
agent=vhq.Agent(role="new member", goal="work in the network"),
|
20
|
+
is_manager=False # explicitly mentioned. Setting `True` makes this member a manager of the network.
|
21
|
+
),
|
22
|
+
]
|
23
|
+
)
|
24
|
+
assert isinstance(network.members[0].agent, vhq.Agent)
|
25
|
+
```
|
26
|
+
|
27
|
+
Ref. <a href="/core/agent-network/ref/#member">`Member`</a> class.
|
28
|
+
|
29
|
+
<hr />
|
30
|
+
|
31
|
+
## Changing Formation
|
32
|
+
|
33
|
+
The formation of network members will be automatically assigned based on the task goals, but you can explicitly define it by using `formation` field.
|
34
|
+
|
35
|
+
|
36
|
+
```python
|
37
|
+
import versionhq as vhq
|
38
|
+
|
39
|
+
network = vhq.AgentNetwork(
|
40
|
+
members=[
|
41
|
+
vhq.Member(agent=vhq.Agent(role="member 1", goal="work in the network")),
|
42
|
+
vhq.Member(agent=vhq.Agent(role="member 2", goal="work in the network")),
|
43
|
+
vhq.Member(agent=vhq.Agent(role="member 3", goal="work in the network")),
|
44
|
+
],
|
45
|
+
formation=vhq.Formation.SQUAD,
|
46
|
+
)
|
47
|
+
|
48
|
+
assert network.formation == vhq.Formation.SQUAD
|
49
|
+
```
|
50
|
+
|
51
|
+
Ref. Enum <a href="/core/agent-network/ref/#enum-formation">`Formation`</a>
|
52
|
+
|
53
|
+
|
54
|
+
<hr >
|
55
|
+
|
56
|
+
## Task Handling
|
57
|
+
|
58
|
+
The class method `.launch()` will automatically decide the best task handling process and execute the tasks accordingly.
|
59
|
+
|
60
|
+
|
61
|
+
```python
|
62
|
+
import versionhq as vhq
|
63
|
+
|
64
|
+
network = vhq.AgentNetwork(
|
65
|
+
members=[
|
66
|
+
vhq.Member(agent=vhq.Agent(role="member 1", goal="work in the network"), tasks=[vhq.Task(description="Run a demo 1")]),
|
67
|
+
vhq.Member(agent=vhq.Agent(role="member 2", goal="work in the network"), tasks=[vhq.Task(description="Run a demo")]),
|
68
|
+
vhq.Member(agent=vhq.Agent(role="member 3", goal="work in the network")),
|
69
|
+
],
|
70
|
+
)
|
71
|
+
|
72
|
+
res, tg = network.launch()
|
73
|
+
|
74
|
+
assert isinstance(res, vhq.TaskOutput)
|
75
|
+
assert isinstance(tg, vhq.TaskGraph)
|
76
|
+
|
77
|
+
```
|
78
|
+
|
79
|
+
<hr >
|
80
|
+
|
81
|
+
You can also specify the process using `process` field.
|
82
|
+
|
83
|
+
```python
|
84
|
+
import versionhq as vhq
|
85
|
+
|
86
|
+
network = vhq.AgentNetwork(
|
87
|
+
members=[
|
88
|
+
vhq.Member(agent=vhq.Agent(role="member 1", goal="work in the network"), tasks=[vhq.Task(description="Run a demo 1")]),
|
89
|
+
vhq.Member(agent=vhq.Agent(role="member 2", goal="work in the network"), tasks=[vhq.Task(description="Run a demo 2")]),
|
90
|
+
vhq.Member(agent=vhq.Agent(role="member 3", goal="work in the network")),
|
91
|
+
],
|
92
|
+
process=vhq.TaskHandlingProcess.CONSENSUAL,
|
93
|
+
consent_trigger=lambda x: True, # consent trigger event is a MUST for TaskHandlingProcess.CONSENSUAL
|
94
|
+
)
|
95
|
+
|
96
|
+
res, tg = network.launch()
|
97
|
+
|
98
|
+
assert isinstance(res, vhq.TaskOutput)
|
99
|
+
assert isinstance(tg, vhq.TaskGraph)
|
100
|
+
```
|
101
|
+
|
102
|
+
Ref. Enum <a href="/core/agent-network/ref/#enum-taskhandlingprocess">`TaskHandlingProcess`</a>
|
@@ -0,0 +1,117 @@
|
|
1
|
+
---
|
2
|
+
tags:
|
3
|
+
- Agent Network
|
4
|
+
---
|
5
|
+
|
6
|
+
|
7
|
+
You can generate an `AgentNetwork` by using `form_agent_network` method with a concise `task` description and `expected_outcome` args.
|
8
|
+
|
9
|
+
```python
|
10
|
+
import versionhq as vhq
|
11
|
+
|
12
|
+
network = vhq.form_agent_network(
|
13
|
+
task="Find the best trip destination this summer.",
|
14
|
+
expected_outcome="a list of destinations and why it's suitable",
|
15
|
+
context="planning a suprise trip for my friend", # optional
|
16
|
+
)
|
17
|
+
|
18
|
+
assert isinstance(network, vhq.AgentNetwork)
|
19
|
+
assert network.members # auto-generated agents as network members
|
20
|
+
assert network.tasks # auto-defined sub-tasks to achieve the main task goal
|
21
|
+
```
|
22
|
+
|
23
|
+
|
24
|
+
<hr>
|
25
|
+
|
26
|
+
**Strucured Output**
|
27
|
+
|
28
|
+
To generate structured output, you can add a JSON dict or Pydantic class as `expected_outcome` args instead of plane text.
|
29
|
+
|
30
|
+
```python
|
31
|
+
import versionhq as vhq
|
32
|
+
from pydantic import BaseModel
|
33
|
+
|
34
|
+
class Outcome(BaseModel):
|
35
|
+
destinations: list[str]
|
36
|
+
why_suitable: list[str]
|
37
|
+
|
38
|
+
|
39
|
+
network = vhq.form_agent_network(
|
40
|
+
task="Find the best trip destination this summer.",
|
41
|
+
expected_outcome=Outcome,
|
42
|
+
context="planning a suprise trip for my friend", # optional
|
43
|
+
)
|
44
|
+
|
45
|
+
assert isinstance(network, vhq.AgentNetwork)
|
46
|
+
assert network.members
|
47
|
+
assert network.tasks
|
48
|
+
```
|
49
|
+
|
50
|
+
<hr >
|
51
|
+
|
52
|
+
**Agents**
|
53
|
+
|
54
|
+
You can use `agents` args to add existing agents to the network.
|
55
|
+
|
56
|
+
```python
|
57
|
+
import versionhq as vhq
|
58
|
+
from pydantic import BaseModel
|
59
|
+
|
60
|
+
my_agent = vhq.Agent(
|
61
|
+
role="Travel Agent",
|
62
|
+
goal="select best trip destination",
|
63
|
+
knowledge_sources=[".....","url1",]
|
64
|
+
)
|
65
|
+
|
66
|
+
class Outcome(BaseModel):
|
67
|
+
destinations: list[str]
|
68
|
+
why_suitable: list[str]
|
69
|
+
|
70
|
+
network = vhq.form_agent_network(
|
71
|
+
task="Find the best trip destination this summer.",
|
72
|
+
expected_outcome=Outcome,
|
73
|
+
context="planning a suprise trip for my friend",
|
74
|
+
agents=[my_agent,]
|
75
|
+
)
|
76
|
+
|
77
|
+
assert isinstance(network, vhq.AgentNetwork)
|
78
|
+
assert [member for member in network.members if member.agent == my_agent]
|
79
|
+
assert network.tasks
|
80
|
+
```
|
81
|
+
|
82
|
+
<hr>
|
83
|
+
|
84
|
+
**Formation**
|
85
|
+
|
86
|
+
Similar to `agents`, you can define `formation` args to specify the network formation:
|
87
|
+
|
88
|
+
|
89
|
+
```python
|
90
|
+
import versionhq as vhq
|
91
|
+
from pydantic import BaseModel
|
92
|
+
|
93
|
+
my_agent = vhq.Agent(
|
94
|
+
role="Travel Agent",
|
95
|
+
goal="select best trip destination",
|
96
|
+
knowledge_sources=[".....","url1",]
|
97
|
+
)
|
98
|
+
|
99
|
+
class Outcome(BaseModel):
|
100
|
+
destinations: list[str]
|
101
|
+
why_suitable: list[str]
|
102
|
+
|
103
|
+
network = vhq.form_agent_network(
|
104
|
+
task="Find the best trip destination this summer.",
|
105
|
+
expected_outcome=Outcome,
|
106
|
+
context="planning a suprise trip for my friend",
|
107
|
+
agents=[my_agent,],
|
108
|
+
formation=vhq.Formation.SUPERVISING
|
109
|
+
)
|
110
|
+
|
111
|
+
assert isinstance(network, vhq.AgentNetwork)
|
112
|
+
assert [member for member in network.members if member.agent == my_agent]
|
113
|
+
assert network.tasks
|
114
|
+
assert network.formation == vhq.Formation.SUPERVISING
|
115
|
+
```
|
116
|
+
|
117
|
+
Ref. Enum <a href="core/agent-network/ref/#enum-formation">Formation</a>
|
@@ -23,7 +23,7 @@ You can specify a desired formation or allow the agents to determine it autonomo
|
|
23
23
|
|
24
24
|
By default, lead agents will determine the best network formation autonomously based on the given task and its goal.
|
25
25
|
|
26
|
-
Calling `.launch()` method can start executing tasks
|
26
|
+
Calling `.launch()` method can start executing tasks and generate a tuple of response as a `TaskOutput` object and `TaskGraph` object.
|
27
27
|
|
28
28
|
```python
|
29
29
|
import versionhq as vhq
|
@@ -33,11 +33,12 @@ network = vhq.form_agent_network(
|
|
33
33
|
expected_outcome='media mix, key messages, and CTA targets.'
|
34
34
|
)
|
35
35
|
|
36
|
-
res,
|
36
|
+
res, tg = network.launch()
|
37
37
|
|
38
38
|
assert isinstance(res, vhq.TaskOutput)
|
39
|
+
assert isinstance(tg, vhq.TaskGraph)
|
39
40
|
```
|
40
41
|
|
41
|
-
Ref. <a href="/core/task-output">TaskOutput</a> class
|
42
|
+
Ref. <a href="/core/task-output">TaskOutput</a> / <a href="/core/task-graph">TaskGraph </a> class.
|
42
43
|
|
43
44
|
Visit <a href="https://versi0n.io">Playground</a>.
|
@@ -0,0 +1,141 @@
|
|
1
|
+
---
|
2
|
+
tags:
|
3
|
+
- Agent Network
|
4
|
+
---
|
5
|
+
|
6
|
+
|
7
|
+
## Class `AgentNetwork`
|
8
|
+
|
9
|
+
### Variable
|
10
|
+
|
11
|
+
| <div style="width:200px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
12
|
+
| :--- | :--- | :--- | :--- | :--- |
|
13
|
+
| **`id`** | UUID4 | uuid.uuid4() | False | Stores auto-generated ID as identifier. Not editable. |
|
14
|
+
| **`name`** | str | None | True | Stores a name of the network. |
|
15
|
+
| **`members`** | List[`Member`] | list() | False | Stores a list of `Member` objects. |
|
16
|
+
| **`formation`** | `Formation`| None | True | Stores `Formation` enum. |
|
17
|
+
| **`should_reform`** | bool | False | - | Whether to reform the network during the activation. |
|
18
|
+
| **`network_tasks`** | List[`Task`] | list() | - | Stores a list of `Task` objects not assigned to any network members. |
|
19
|
+
| **`prompt_file`** | str | None | True | Stores absolute file path to the prompt file with JSON formatted prompt |
|
20
|
+
| **`process`** | `TaskHandlingProcess` | TaskHandlingProcess.SEQUENTIAL | - | Enum of the task handling process. |
|
21
|
+
| **`consent_trigger`** | Callable[..., Any] | None | True | Stores a trigger event (func) for consentual processing. |
|
22
|
+
| **`pre_launch_callbacks`** | List[Callable[..., Any]] | list() | - | Stores callbacks to run before the network launch. |
|
23
|
+
| **`post_launch_callbacks`** | List[Callable[..., Any]] | list() | - | Stores callbacks to run after the network launch. |
|
24
|
+
| **`step_callbacks`** | Callable[..., Any] | None | True | Stores callbacks to run at every step of each member agent takes during the activation. |
|
25
|
+
| **`cache`** | bool | True | - | Whether to store cache. |
|
26
|
+
| **`execution_logs`** | List[Dict[str, Any]] | list() | - | Stores a list of execution logs of all the tasks in the network. |
|
27
|
+
|
28
|
+
|
29
|
+
### Class Methods
|
30
|
+
|
31
|
+
| <div style="width:120px">**Method**</div> | **Params** | **Returns** | **Description** |
|
32
|
+
| :--- | :--- | :--- | :--- |
|
33
|
+
| **`launch`** | kwargs_pre: Optional[Dict[str, str]] = None <br> kwargs_post: Optional[Dict[str, Any]] = None <br> start_index: int = None | Tuple[TaskOutput, TaskGraph]: | Core method to launch the network and execute tasks |
|
34
|
+
|
35
|
+
|
36
|
+
### Properties
|
37
|
+
|
38
|
+
| <div style="width:120px">**Property**</div> | **Returns** | **Description** |
|
39
|
+
| :--- | :--- | :--- |
|
40
|
+
| **`key`** | str | Unique identifier of the netowrk. |
|
41
|
+
| **`managers`** | List[`Member`] | A list of manager members. |
|
42
|
+
| **`manager_tasks`** | List[`Task`] | A list of tasks handled by managers. |
|
43
|
+
| **`tasks`** | List[`Task`] | All the tasks in the network.|
|
44
|
+
| **`unassigned_member_tasks`** | List[Task] | Unassigned member-level tasks. |
|
45
|
+
|
46
|
+
|
47
|
+
<hr>
|
48
|
+
|
49
|
+
## Class `Member`
|
50
|
+
|
51
|
+
### Variable
|
52
|
+
|
53
|
+
| <div style="width:200px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
54
|
+
| :--- | :--- | :--- | :--- | :--- |
|
55
|
+
| **`agent`** | `Agent` | None | True | Agent as a member |
|
56
|
+
| **`is_manager`** | bool | False | - | Whether the member is a manager. |
|
57
|
+
| **`can_share_knowledge`** | bool | True | - | Whether the member can share its knowledge among the other members in the network. |
|
58
|
+
| **`can_share_memory`** | bool | True | - | Whether the member can share its memories among the other members in the network. |
|
59
|
+
| **`tasks`** | List[`Task`]| list() | - | Assinged tasks. |
|
60
|
+
|
61
|
+
|
62
|
+
### Properties
|
63
|
+
|
64
|
+
| <div style="width:120px">**Property**</div> | **Returns** | **Description** |
|
65
|
+
| :--- | :--- | :--- |
|
66
|
+
| **`is_idling`** | bool | Whether it has unprocessed assgined task/s |
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<hr>
|
71
|
+
|
72
|
+
## Class `Agent`
|
73
|
+
|
74
|
+
### Variables
|
75
|
+
|
76
|
+
| <div style="width:200px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
77
|
+
| :--- | :--- | :--- | :--- | :--- |
|
78
|
+
| **`id`** | UUID4 | uuid.uuid4() | False | Stores auto-generated ID as identifier. Not editable. |
|
79
|
+
| **`role`** | str | None | False | Stores a role of the agent. |
|
80
|
+
| **`goal`** | str | None | False | Stores a goal of the agent. |
|
81
|
+
| **`backstory`** | str | None | True | Stores backstory of the agent. Utilized as system prompt. |
|
82
|
+
| **`tools`** | List[InstanceOf[`Tool` \| `ToolSet`] \| Type[`Tool`]] | None | True | Stores tools to be used when executing a task. |
|
83
|
+
| **`knowledge_sources`** | List[`BaseKnowledgeSource` \| Any] | None | True | Stores knowledge sources in text, file path, or url. |
|
84
|
+
| **`embedder_config`** | Dict[str, Any] | None | True | Stores embedding configuration for storing knowledge sources. |
|
85
|
+
| **`with_memory`** | bool | False | - | Whether to store tasks and results in memory. |
|
86
|
+
| **`memory_config`** | Dict[str, Any] | None | True | Stores configuration of the memory. |
|
87
|
+
| **`short_term_memory`** | InstanceOf[`ShortTermMemory`] | None | True | Stores `ShortTermMemory` object. |
|
88
|
+
| **`long_term_memory`** | InstanceOf[`LongTermMemory`] | None | True | Stores `LongTermMemory` object. |
|
89
|
+
| **`user_memory`** | InstanceOf[`UserMemory`] | None | True | Stores `UserMemory` object. |
|
90
|
+
| **`use_developer_prompt`** | bool | True | - | Whether to use the system (developer) prompt when calling the model. |
|
91
|
+
| **`developer_promt_template`** | str | None | True | File path to the prompt template. |
|
92
|
+
| **`user_promt_template`** | str | None | True | File path to the prompt template. |
|
93
|
+
| **`networks`** | List[Any] | list() | True | Stores a list of agent networks that the agent belongs to. |
|
94
|
+
| **`allow_delegation`** | bool | False | - | Whether the agent can delegate assinged tasks to another agent. |
|
95
|
+
| **`max_retry_limit`** | int | 2 | - | Maximum number of retries when the task execution failed. |
|
96
|
+
| **`maxit`** | int | 25 | - | Maximum number of total optimization loops conducted when an error occues during the task execution. |
|
97
|
+
| **`callbacks`** | List[Callabale] | None | True | Stores a list of callback functions that must be called after every task execution completed.|
|
98
|
+
| **`llm`** | str \| InstanceOf[`LLM`] \| Dict[str, Any] | None | False | Stores the main model that the agent runs on. |
|
99
|
+
| **`func_calling_llm`** | str \| InstanceOf[`LLM`] \| Dict[str, Any] | None | False | Stores the function calling model that the agent runs on. |
|
100
|
+
| **`respect_context_window`** | bool | True | - | Whether to follow the main model's maximum context window size. |
|
101
|
+
| **`max_execution_time`** | int | None | True | Stores maximum execution time in seconds. |
|
102
|
+
| **`max_rpm`** | int | None | True | Stores maximum number of requests per minute. |
|
103
|
+
| **`llm_config`** | Dict[str, Any] | None | True | Stores configuration of `LLM` object. |
|
104
|
+
| **`config`** | Dict[str, Any] | None | True | Stores model config. |
|
105
|
+
|
106
|
+
|
107
|
+
### Class Methods
|
108
|
+
|
109
|
+
| <div style="width:120px">**Method**</div> | **Params** | **Returns** | **Description** |
|
110
|
+
| :--- | :--- | :--- | :--- |
|
111
|
+
| **`update`** | **kwargs: Any | Self | Updates agents with given kwargs. Invalid keys will be ignored. |
|
112
|
+
| **`start`** | context: Any = None <br> tool_res_as_final: bool = False | `TaskOutput` \| None | Starts to operate the agent. |
|
113
|
+
| **`execute_task`** | task: [Task] <br> context: Any = None <br> task_tools: Optional[List[Tool \| ToolSet]] = list() | str | Returns response from the model in plane text format. |
|
114
|
+
|
115
|
+
|
116
|
+
### Properties
|
117
|
+
|
118
|
+
| <div style="width:120px">**Property**</div> | **Returns** | **Description** |
|
119
|
+
| :--- | :--- | :--- |
|
120
|
+
| **`key`** | str | Unique identifier of the agent using its ID and sanitized role. |
|
121
|
+
|
122
|
+
|
123
|
+
## ENUM `Formation`
|
124
|
+
|
125
|
+
```python
|
126
|
+
class Formation(str, Enum):
|
127
|
+
SOLO = 1
|
128
|
+
SUPERVISING = 2
|
129
|
+
SQUAD = 3
|
130
|
+
RANDOM = 4
|
131
|
+
HYBRID = 10
|
132
|
+
```
|
133
|
+
|
134
|
+
## ENUM `TaskHandlingProcess`
|
135
|
+
|
136
|
+
```python
|
137
|
+
class TaskHandlingProcess(str, Enum):
|
138
|
+
HIERARCHY = 1
|
139
|
+
SEQUENTIAL = 2
|
140
|
+
CONSENSUAL = 3
|
141
|
+
```
|
@@ -3,7 +3,7 @@
|
|
3
3
|
[](https://clickpy.clickhouse.com/dashboard/versionhq)
|
4
4
|

|
5
5
|
[](https://github.com/versionHQ/multi-agent-system/actions/workflows/publish.yml)
|
6
|
-

|
7
7
|

|
8
8
|

|
9
9
|
|
@@ -112,16 +112,15 @@ nav:
|
|
112
112
|
- Quick Start: 'quickstart.md'
|
113
113
|
- Agent Network:
|
114
114
|
- 'core/agent-network/index.md'
|
115
|
-
-
|
116
|
-
-
|
117
|
-
- Reference: 'core/agent-network/ref.md'
|
115
|
+
- Generating: 'core/agent-network/form.md'
|
116
|
+
- Configuring: 'core/agent-network/config.md'
|
118
117
|
- Agent:
|
119
118
|
- 'core/agent/index.md'
|
120
119
|
- Configuration: 'core/agent/config.md'
|
121
120
|
- Task Handling: 'core/agent/task-handling.md'
|
122
|
-
- Reference: 'core/agent/ref.md'
|
123
121
|
- LLM:
|
124
122
|
- 'core/llm/index.md'
|
123
|
+
- Reference: 'core/agent-network/ref.md'
|
125
124
|
- Task Graph:
|
126
125
|
- 'core/task-graph/index.md'
|
127
126
|
- Task:
|
@@ -15,7 +15,7 @@ exclude = ["test*", "__pycache__", "*.egg-info"]
|
|
15
15
|
|
16
16
|
[project]
|
17
17
|
name = "versionhq"
|
18
|
-
version = "1.2.2.
|
18
|
+
version = "1.2.2.1"
|
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"
|
@@ -61,7 +61,7 @@ def form_agent_network(
|
|
61
61
|
# try:
|
62
62
|
prompt_formation = formation.name if formation and isinstance(formation, Formation) else f"Select the best formation to effectively execute the tasks from the given Enum sets: {str(Formation.__dict__)}."
|
63
63
|
|
64
|
-
prompt_expected_outcome = expected_outcome if isinstance(expected_outcome, str) else expected_outcome.
|
64
|
+
prompt_expected_outcome = expected_outcome if isinstance(expected_outcome, str) else str(expected_outcome.model_dump()) if type(expected_outcome) == BaseModel else ""
|
65
65
|
|
66
66
|
class Outcome(BaseModel):
|
67
67
|
formation: Enum
|
@@ -76,7 +76,7 @@ def form_agent_network(
|
|
76
76
|
)
|
77
77
|
|
78
78
|
if agents:
|
79
|
-
vhq_task.description += "
|
79
|
+
vhq_task.description += "You MUST add the following agents' roles in the network formation: " + ", ".join([agent.role for agent in agents if isinstance(agent, Agent)])
|
80
80
|
|
81
81
|
res = vhq_task.execute(agent=vhq_formation_planner, context=context)
|
82
82
|
|
@@ -88,7 +88,17 @@ def form_agent_network(
|
|
88
88
|
members = []
|
89
89
|
leader = str(res.pydantic.leader_agent) if res.pydantic else str(res.json_dict["leader_agent"])
|
90
90
|
|
91
|
-
|
91
|
+
agent_roles = res.pydantic.agent_roles if res.pydantic else res.json_dict["agent_roles"]
|
92
|
+
created_agents = [Agent(role=str(item), goal=str(item)) for item in agent_roles]
|
93
|
+
|
94
|
+
if agents:
|
95
|
+
for i, agent in enumerate(created_agents):
|
96
|
+
matches = [item for item in agents if item.role == agent.role]
|
97
|
+
if matches:
|
98
|
+
created_agents[i] = matches[0]
|
99
|
+
else:
|
100
|
+
pass
|
101
|
+
|
92
102
|
created_tasks = []
|
93
103
|
|
94
104
|
if res.pydantic:
|