versionhq 1.2.3.8__tar.gz → 1.2.4.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.3.8 → versionhq-1.2.4.1}/PKG-INFO +10 -10
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/README.md +8 -8
- versionhq-1.2.4.1/docs/_logos/favicon.ico +0 -0
- versionhq-1.2.4.1/docs/_logos/logo192.png +0 -0
- versionhq-1.2.4.1/docs/core/agent-network/ref.md +139 -0
- versionhq-1.2.4.1/docs/core/task/reference.md +123 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/task/response-field.md +2 -14
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/task/task-execution.md +31 -6
- versionhq-1.2.4.1/docs/core/task/task-output.md +50 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/index.md +14 -15
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/pyproject.toml +2 -3
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/__init__.py +1 -1
- versionhq-1.2.4.1/src/versionhq/_prompt/model.py +147 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/_utils/__init__.py +1 -0
- versionhq-1.2.4.1/src/versionhq/_utils/is_valid_url.py +15 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent/model.py +36 -18
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent_network/formation.py +12 -5
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent_network/model.py +2 -6
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/knowledge/source_docling.py +3 -19
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/llm/model.py +8 -12
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task/evaluation.py +1 -1
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task/model.py +98 -45
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task/structured_response.py +3 -1
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task_graph/draft.py +8 -6
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq.egg-info/PKG-INFO +10 -10
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq.egg-info/SOURCES.txt +4 -0
- versionhq-1.2.4.1/tests/_sample/sample.mp3 +0 -0
- versionhq-1.2.4.1/tests/_sample/screenshot.png +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/agent_network/doc_test.py +0 -1
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/formation_test.py +3 -4
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/task/doc_test.py +19 -6
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/task/task_test.py +0 -126
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/task_graph/task_graph_test.py +2 -2
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/usecase_test.py +24 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/uv.lock +43 -45
- versionhq-1.2.3.8/docs/_logos/favicon.ico +0 -0
- versionhq-1.2.3.8/docs/_logos/logo192.png +0 -0
- versionhq-1.2.3.8/docs/core/agent-network/ref.md +0 -141
- versionhq-1.2.3.8/docs/core/task/reference.md +0 -105
- versionhq-1.2.3.8/docs/core/task/task-output.md +0 -80
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/.env.sample +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/.github/workflows/publish.yml +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/.github/workflows/run_tests.yml +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/.gitignore +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/.pre-commit-config.yaml +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/.python-version +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/LICENSE +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/SECURITY.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/db/preprocess.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/CNAME +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/agent/config.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/agent/index.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/agent/task-handling.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/agent-network/config.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/agent-network/form.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/agent-network/index.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/knowledge.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/llm/index.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/memory.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/rag-tool.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/task/evaluation.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/task/index.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/task/task-strc-response.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/task-graph/index.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/core/tool.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/quickstart.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/stylesheets/main.css +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/docs/tags.md +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/mkdocs.yml +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/requirements-dev.txt +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/requirements.txt +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/runtime.txt +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/setup.cfg +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/_utils/llm_as_a_judge.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/_utils/logger.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent/inhouse_agents.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/agent_network/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/llm/llm_vars.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/storage/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task_graph/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task_graph/colors.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/task_graph/model.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/tool/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/tool/rag_tool.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq.egg-info/requires.txt +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/_sample/sample.csv +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/_sample/sample.json +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/agent/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/agent/agent_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/agent/doc_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/agent_network/Prompts/Demo_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/agent_network/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/agent_network/agent_network_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/cli/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/clients/customer_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/clients/product_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/conftest.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/doc_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/knowledge/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/llm/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/llm/llm_connection_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/llm/llm_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/memory/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/memory/memory_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/task/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/task/doc_eval_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/task/doc_taskoutput_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/task/eval_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/task_graph/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/task_graph/doc_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/tool/__init__.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/tool/composio_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/tool/doc_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/tool/rag_tool_test.py +0 -0
- {versionhq-1.2.3.8 → versionhq-1.2.4.1}/tests/tool/tool_test.py +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.2.
|
4
|
-
Summary:
|
3
|
+
Version: 1.2.4.1
|
4
|
+
Summary: A Python framework for autonomous agent networks that handle task automation with multi-step reasoning.
|
5
5
|
Author-email: Kuriko Iwai <kuriko@versi0n.io>
|
6
6
|
License: MIT License
|
7
7
|
|
@@ -88,15 +88,15 @@ Requires-Dist: torchvision>=0.21.0; extra == "torch"
|
|
88
88
|
|
89
89
|
# Overview
|
90
90
|
|
91
|
-
[](https://clickpy.clickhouse.com/dashboard/versionhq)
|
92
92
|

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

|
95
95
|

|
96
96
|

|
97
97
|
|
98
98
|
|
99
|
-
|
99
|
+
A Python framework for autonomous agent networks that handle task automation with multi-step reasoning.
|
100
100
|
|
101
101
|
**Visit:**
|
102
102
|
|
@@ -154,11 +154,11 @@ Agents adapt their formation based on task complexity.
|
|
154
154
|
You can specify a desired formation or allow the agents to determine it autonomously (default).
|
155
155
|
|
156
156
|
|
157
|
-
|
|
158
|
-
| :---
|
159
|
-
| **Formation**
|
160
|
-
| **Usage**
|
161
|
-
| **Use case**
|
157
|
+
| | **Solo Agent** | **Supervising** | **Squad** | **Random** |
|
158
|
+
| :--- | :--- | :--- | :--- | :--- |
|
159
|
+
| **Formation** | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/rbgxttfoeqqis1ettlfz.png" alt="solo" width="200"> | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/zhungor3elxzer5dum10.png" alt="solo" width="200"> | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/dnusl7iy7kiwkxwlpmg8.png" alt="solo" width="200"> | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/sndpczatfzbrosxz9ama.png" alt="solo" width="200"> |
|
160
|
+
| **Usage** | <ul><li>A single agent with tools, knowledge, and memory.</li><li>When self-learning mode is on - it will turn into **Random** formation.</li></ul> | <ul><li>Leader agent gives directions, while sharing its knowledge and memory.</li><li>Subordinates can be solo agents or networks.</li></ul> | <ul><li>Share tasks, knowledge, and memory among network members.</li></ul> | <ul><li>A single agent handles tasks, asking help from other agents without sharing its memory or knowledge.</li></ul> |
|
161
|
+
| **Use case** | An email agent drafts promo message for the given audience. | The leader agent strategizes an outbound campaign plan and assigns components such as media mix or message creation to subordinate agents. | An email agent and social media agent share the product knowledge and deploy multi-channel outbound campaign. | 1. An email agent drafts promo message for the given audience, asking insights on tones from other email agents which oversee other clusters. 2. An agent calls the external agent to deploy the campaign. |
|
162
162
|
|
163
163
|
<hr />
|
164
164
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
# Overview
|
2
2
|
|
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
|
|
10
10
|
|
11
|
-
|
11
|
+
A Python framework for autonomous agent networks that handle task automation with multi-step reasoning.
|
12
12
|
|
13
13
|
**Visit:**
|
14
14
|
|
@@ -66,11 +66,11 @@ Agents adapt their formation based on task complexity.
|
|
66
66
|
You can specify a desired formation or allow the agents to determine it autonomously (default).
|
67
67
|
|
68
68
|
|
69
|
-
|
|
70
|
-
| :---
|
71
|
-
| **Formation**
|
72
|
-
| **Usage**
|
73
|
-
| **Use case**
|
69
|
+
| | **Solo Agent** | **Supervising** | **Squad** | **Random** |
|
70
|
+
| :--- | :--- | :--- | :--- | :--- |
|
71
|
+
| **Formation** | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/rbgxttfoeqqis1ettlfz.png" alt="solo" width="200"> | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/zhungor3elxzer5dum10.png" alt="solo" width="200"> | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/dnusl7iy7kiwkxwlpmg8.png" alt="solo" width="200"> | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/sndpczatfzbrosxz9ama.png" alt="solo" width="200"> |
|
72
|
+
| **Usage** | <ul><li>A single agent with tools, knowledge, and memory.</li><li>When self-learning mode is on - it will turn into **Random** formation.</li></ul> | <ul><li>Leader agent gives directions, while sharing its knowledge and memory.</li><li>Subordinates can be solo agents or networks.</li></ul> | <ul><li>Share tasks, knowledge, and memory among network members.</li></ul> | <ul><li>A single agent handles tasks, asking help from other agents without sharing its memory or knowledge.</li></ul> |
|
73
|
+
| **Use case** | An email agent drafts promo message for the given audience. | The leader agent strategizes an outbound campaign plan and assigns components such as media mix or message creation to subordinate agents. | An email agent and social media agent share the product knowledge and deploy multi-channel outbound campaign. | 1. An email agent drafts promo message for the given audience, asking insights on tones from other email agents which oversee other clusters. 2. An agent calls the external agent to deploy the campaign. |
|
74
74
|
|
75
75
|
<hr />
|
76
76
|
|
Binary file
|
Binary file
|
@@ -0,0 +1,139 @@
|
|
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** | **Description** |
|
12
|
+
| :--- | :--- | :--- | :--- |
|
13
|
+
| **`id`** | UUID4 | uuid.uuid4() | Stores auto-generated ID as identifier. Not editable. |
|
14
|
+
| **`name`** | str | None | Stores a name of the network. |
|
15
|
+
| **`members`** | List[`Member`] | list() | Stores a list of `Member` objects. |
|
16
|
+
| **`formation`** | `Formation` | None | Stores `Formation` enum. |
|
17
|
+
| **`should_reform`** | bool | False | Whether to reform the network during the activation. |
|
18
|
+
| **`network_tasks`** | List[`Task`] | list() | A list of `Task` objects unassigned to any network members. |
|
19
|
+
| **`prompt_file`** | str | None | Absolute file path to the prompt file w/ JSON formatted prompt. |
|
20
|
+
| **`process`** | `TaskHandlingProcess` | TaskHandlingProcess.SEQUENTIAL | Enum of the task handling process. |
|
21
|
+
| **`consent_trigger`** | Callable[..., Any] | None | 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 | 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:200px">**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:200px">**Property**</div> | **Returns** | **Description** |
|
39
|
+
| :--- | :--- | :--- |
|
40
|
+
| **`key`** | str | Unique identifier. |
|
41
|
+
| **`managers`** | List[InstanceOf[`Member`]] | A list of manager members. |
|
42
|
+
| **`manager_tasks`** | List[InstanceOf[`Task`]] | A list of tasks handled by managers. |
|
43
|
+
| **`tasks`** | List[InstanceOf[`Task`]] | All the tasks in the network. |
|
44
|
+
| **`unassigned_member_tasks`** | List[InstanceOf[`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** | **Description** |
|
54
|
+
| :--- | :--- | :--- | :--- |
|
55
|
+
| **`agent`** | InstanceOf[`Agent`] | None | 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 network members. |
|
58
|
+
| **`can_share_memory`** | bool | True | Whether the member can share its memories among the other network members. |
|
59
|
+
| **`tasks`** | List[InstanceOf[`Task`]] | list() | Assinged tasks. |
|
60
|
+
|
61
|
+
|
62
|
+
### Properties
|
63
|
+
|
64
|
+
| <div style="width:200px">**Property**</div> | **Returns** | **Description** |
|
65
|
+
| :--- | :--- | :--- |
|
66
|
+
| **`is_idling`** | bool | Whether it has unprocessed assgined task/s |
|
67
|
+
|
68
|
+
<hr>
|
69
|
+
|
70
|
+
## Class `Agent`
|
71
|
+
|
72
|
+
### Variables
|
73
|
+
|
74
|
+
| <div style="width:200px">**Variable**</div> | **Data Type** | **Default** | **Description** |
|
75
|
+
| :--- | :--- | :--- | :--- |
|
76
|
+
| **`id`** | UUID4 | uuid.uuid4() | Stores auto-generated ID as identifier. Not editable. |
|
77
|
+
| **`role`** | str | None | Stores a role of the agent. |
|
78
|
+
| **`goal`** | str | None | Stores a goal of the agent. |
|
79
|
+
| **`backstory`** | str | None | Stores backstory of the agent. Utilized as system prompt. |
|
80
|
+
| **`tools`** | List[InstanceOf[`Tool` \| `ToolSet`] \| Type[`Tool`]] | None | Stores tools to be used when executing a task. |
|
81
|
+
| **`knowledge_sources`** | List[`BaseKnowledgeSource` \| Any] | None | Stores knowledge sources in text, file path, or url. |
|
82
|
+
| **`embedder_config`** | Dict[str, Any] | None | Stores embedding configuration for storing knowledge sources. |
|
83
|
+
| **`with_memory`** | bool | False | Whether to store tasks and results in memory. |
|
84
|
+
| **`memory_config`** | Dict[str, Any] | None | Stores configuration of the memory. |
|
85
|
+
| **`short_term_memory`** | InstanceOf[`ShortTermMemory`] | None | Stores `ShortTermMemory` object. |
|
86
|
+
| **`long_term_memory`** | InstanceOf[`LongTermMemory`] | None | Stores `LongTermMemory` object. |
|
87
|
+
| **`user_memory`** | InstanceOf[`UserMemory`] | None | Stores `UserMemory` object. |
|
88
|
+
| **`use_developer_prompt`** | bool | True | Whether to use the system (developer) prompt when calling the model. |
|
89
|
+
| **`developer_promt_template`** | str | None | File path to the prompt template. |
|
90
|
+
| **`user_promt_template`** | str | None | File path to the prompt template. |
|
91
|
+
| **`networks`** | List[Any] | list() | Stores a list of agent networks that the agent belongs to. |
|
92
|
+
| **`allow_delegation`** | bool | False | Whether the agent can delegate assinged tasks to another agent. |
|
93
|
+
| **`max_retry_limit`** | int | 2 | Maximum number of retries when the task execution failed. |
|
94
|
+
| **`maxit`** | int | 25 | Maximum number of total optimization loops conducted when an error occues during the task execution. |
|
95
|
+
| **`callbacks`** | List[Callabale] | None | Stores a list of callback functions that must be called after every task execution completed.|
|
96
|
+
| **`llm`** | str \| InstanceOf[`LLM`] \| Dict[str, Any] | None | Stores the main model that the agent runs on. |
|
97
|
+
| **`func_calling_llm`** | str \| InstanceOf[`LLM`] \| Dict[str, Any] | None | Stores the function calling model that the agent runs on. |
|
98
|
+
| **`respect_context_window`** | bool | True | Whether to follow the main model's maximum context window size. |
|
99
|
+
| **`max_execution_time`** | int | None | Stores maximum execution time in seconds. |
|
100
|
+
| **`max_rpm`** | int | None | Stores maximum number of requests per minute. |
|
101
|
+
| **`llm_config`** | Dict[str, Any] | None | Stores configuration of `LLM` object. |
|
102
|
+
| **`config`** | Dict[str, Any] | None | Stores model config. |
|
103
|
+
|
104
|
+
|
105
|
+
### Class Methods
|
106
|
+
|
107
|
+
| <div style="width:200px">**Method**</div> | **Params** | **Returns** | **Description** |
|
108
|
+
| :--- | :--- | :--- | :--- |
|
109
|
+
| **`update`** | **kwargs: Any | Self | Updates agents with given kwargs. Invalid keys will be ignored. |
|
110
|
+
| **`start`** | context: Any = None <br> tool_res_as_final: bool = False | `TaskOutput` \| None | Starts to operate the agent. |
|
111
|
+
| **`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. |
|
112
|
+
|
113
|
+
|
114
|
+
### Properties
|
115
|
+
|
116
|
+
| <div style="width:200px">**Property**</div> | **Returns** | **Description** |
|
117
|
+
| :--- | :--- | :--- |
|
118
|
+
| **`key`** | str | Unique identifier of the agent using its ID and sanitized role. |
|
119
|
+
|
120
|
+
|
121
|
+
## ENUM `Formation`
|
122
|
+
|
123
|
+
```python
|
124
|
+
class Formation(str, Enum):
|
125
|
+
SOLO = 1
|
126
|
+
SUPERVISING = 2
|
127
|
+
SQUAD = 3
|
128
|
+
RANDOM = 4
|
129
|
+
HYBRID = 10
|
130
|
+
```
|
131
|
+
|
132
|
+
## ENUM `TaskHandlingProcess`
|
133
|
+
|
134
|
+
```python
|
135
|
+
class TaskHandlingProcess(str, Enum):
|
136
|
+
HIERARCHY = 1
|
137
|
+
SEQUENTIAL = 2
|
138
|
+
CONSENSUAL = 3
|
139
|
+
```
|
@@ -0,0 +1,123 @@
|
|
1
|
+
## Class `Task`
|
2
|
+
|
3
|
+
### Variables
|
4
|
+
|
5
|
+
| <div style="width:160px">**Variable**</div> | **Data Type** | **Default** | **Description** |
|
6
|
+
| :--- | :--- | :--- | :--- |
|
7
|
+
| **`id`** | UUID | uuid.uuid4() | Stores task `id` as an identifier. |
|
8
|
+
| **`name`** | Optional[str] | None | Stores a task name (Inherited as `node` identifier if the task is dependent) |
|
9
|
+
| **`description`** | str | None | Required field to store a concise task description |
|
10
|
+
| **`pydantic_output`** | Optional[Type[BaseModel]] | None | Stores pydantic custom output class for structured response |
|
11
|
+
| **`response_fields`** | Optional[List[ResponseField]] | list() | Stores JSON formats for stuructured response |
|
12
|
+
| **`tools`** | Optional[List[BaseTool \| ToolSet]] | None | Stores tools to be called when the agent executes the task. |
|
13
|
+
| **`can_use_agent_tools`** | bool | True | Whether to use the agent tools |
|
14
|
+
| **`tool_res_as_final`** | bool | False | Whether to make a tool output as a final response from the agent |
|
15
|
+
| **`image`** | Optional[str] | None | Stores an absolute file path or URL to the image file in string |
|
16
|
+
| **`file`** | Optional[str] | None | Stores an absolute file path or URL to the file in string |
|
17
|
+
| **`audio`** | Optional[str] | None | Stores an absolute file path or URL to the audio file in string |
|
18
|
+
| **`execution_type`** | TaskExecutionType | TaskExecutionType.SYNC | Sync or async execution |
|
19
|
+
| **`allow_delegation`** | bool | False | Whether to allow the agent to delegate the task to another agent |
|
20
|
+
| **`callback`** | Optional[Callable] | None | Callback function to be executed after LLM calling |
|
21
|
+
| **`callback_kwargs`** | Optional[Dict[str, Any]] | dict() | Args for the callback function (if any)|
|
22
|
+
| **`should_evaluate`** | bool | False | Whether to evaluate the task output using eval criteria |
|
23
|
+
| **`eval_criteria`** | Optional[List[str]] | list() | Evaluation criteria given by the human client |
|
24
|
+
| **`fsls`** | Optional[List[str]] | None | Examples of competitive and/or weak responses |
|
25
|
+
| **`processed_agents`** | Set[str] | set() | Stores keys of agents that executed the task |
|
26
|
+
| **`output`** | Optional[TaskOutput] | None | Stores `TaskOutput` object after the execution |
|
27
|
+
|
28
|
+
|
29
|
+
### Class Methods
|
30
|
+
|
31
|
+
| <div style="width:160px">**Method**</div> | <div style="width:300px">**Params**</div> | **Returns** | **Description** |
|
32
|
+
| :--- | :--- | :--- | :--- |
|
33
|
+
| **`execute`** | <p>type: TaskExecutionType = None<br>agent: Optional["vhq.Agent"] = None<br>context: Optional[Any] = None</p> | InstanceOf[`TaskOutput`] or None (error) | A main method to handle task execution. Auto-build an agent when the agent is not given. |
|
34
|
+
|
35
|
+
|
36
|
+
### Properties
|
37
|
+
|
38
|
+
| <div style="width:160px">**Property**</div> | **Data_Type** | **Description** |
|
39
|
+
| :--- | :--- | :--- |
|
40
|
+
| **`key`** | str | Returns task key based on its description and output format. |
|
41
|
+
| **`summary`** | str | Returns a summary of the task based on its id, description and tools. |
|
42
|
+
|
43
|
+
<hr>
|
44
|
+
|
45
|
+
## Class `ResponseField`
|
46
|
+
|
47
|
+
### Variables
|
48
|
+
|
49
|
+
| <div style="width:160px">**Variable**</div> | **Data Type** | **Default** | **Description** |
|
50
|
+
| :--- | :--- | :--- | :--- |
|
51
|
+
| **`title`** | str | None | Stores a field title. |
|
52
|
+
| **`data_type`** | Type | None | Stores data type of the response. |
|
53
|
+
| **`items`** | Type | None | Stores data type of items in the list. `None` when `data_type` is not list. |
|
54
|
+
| **`properties`** | List[`ResponseField`] | None | Stores properties in a list of `ResponseFormat` objects when the `data_type` is dict. |
|
55
|
+
| **`nullable`** | bool | False | If the field is nullable. |
|
56
|
+
| **`config`** | Dict[str, Any] | None | Stores other configs passed to response schema. |
|
57
|
+
|
58
|
+
|
59
|
+
<hr>
|
60
|
+
|
61
|
+
## Class `TaskOutput`
|
62
|
+
|
63
|
+
### Variables
|
64
|
+
|
65
|
+
| <div style="width:160px">**Variable**</div> | **Data Type** | **Default** | **Description** |
|
66
|
+
| :--- | :--- | :--- | :--- |
|
67
|
+
| **`task_id`** | UUID | uuid.uuid4() | Stores task `id` as an identifier. |
|
68
|
+
| **`raw`** | str | None | Stores response in plane text format. `None` or `""` when the model returned errors.|
|
69
|
+
| **`json_dict`** | Dict[str, Any] | None | Stores response in JSON serializable dictionary. When the system failed formatting or executing tasks without response_fields, `{ output: <res.raw> }` will be returned. |
|
70
|
+
| **`pydantic`** | Type[`BaseModel`] | None | Populates and stores Pydantic class object defined in the `pydantic_output` field if given. |
|
71
|
+
| **`tool_output`** | Optional[Any] | None | Stores results from the tools of the task or agents ONLY when `tool_res_as_final` set as `True`. |
|
72
|
+
| **`callback_output`** | Optional[Any] | None | Stores results from callback functions if any. |
|
73
|
+
| **`latency`** | Optional[float] | None | Stores job latency in milseconds. |
|
74
|
+
| **`evaluation`** | Optional[InstanceOf[`Evaluation`]] | None | Stores overall evaluations and usage of the task output. |
|
75
|
+
|
76
|
+
|
77
|
+
### Class Methods
|
78
|
+
|
79
|
+
| <div style="width:160px">**Method**</div> | **Params** | **Returns** | **Description** |
|
80
|
+
| :--- | :--- | :--- | :--- |
|
81
|
+
| **`evaluate`** | task: InstanceOf[`Task`] | InstanceOf[`Evaluation`] | Evaluates task output based on the criteria |
|
82
|
+
|
83
|
+
|
84
|
+
### Properties
|
85
|
+
|
86
|
+
| <div style="width:160px">**Property**</div> | **Data_Type** | **Description** |
|
87
|
+
| :--- | :--- | :--- |
|
88
|
+
| **`aggregate_score`** | float | Calucurates weighted average eval scores of the task output. |
|
89
|
+
| **`json_string`** | str | Returns `json_dict` in string format. |
|
90
|
+
|
91
|
+
|
92
|
+
<hr>
|
93
|
+
|
94
|
+
## Class `Evaluation`
|
95
|
+
|
96
|
+
### Variables
|
97
|
+
|
98
|
+
| <div style="width:160px">**Variable**</div> | **Data Type** | **Default** | **Description** |
|
99
|
+
| :--- | :--- | :--- | :--- |
|
100
|
+
| **`items`** | List[InstanceOf[EvaluationItem]] | list() | Stores evaluation items. |
|
101
|
+
| **`eval_by`** | Optional[InstanceOf[Agent]] | None | Stores an agent assigned to evaluate the output. |
|
102
|
+
|
103
|
+
|
104
|
+
### Properties
|
105
|
+
|
106
|
+
| <div style="width:160px">**Property**</div> | **Data_Type** | **Description** |
|
107
|
+
| :--- | :--- | :--- |
|
108
|
+
| **`aggregate_score`** | float | Calucurates weighted average eval scores of the task output. |
|
109
|
+
| **`suggestion_summary`** | str | Returns summary of the suggestions. |
|
110
|
+
|
111
|
+
|
112
|
+
<hr>
|
113
|
+
|
114
|
+
## SubClass `EvaluationItem`
|
115
|
+
|
116
|
+
### Variables
|
117
|
+
|
118
|
+
| <div style="width:160px">**Variable**</div> | **Data Type** | **Default** | **Description** |
|
119
|
+
| :--- | :--- | :--- | :--- |
|
120
|
+
| **`criteria`** | str | None | Stores evaluation criteria given by the client. |
|
121
|
+
| **`suggestion`** | str | None | Stores suggestion on improvement from the evaluator agent. |
|
122
|
+
| **`score`** | float | None | Stores the score on a 0 to 1 scale. |
|
123
|
+
| **`weight`** | int | None | Stores the weight (importance of the criteria) at any scale. |
|
@@ -4,20 +4,6 @@
|
|
4
4
|
|
5
5
|
A Pydantic class to store response formats to generate a structured response in JSON.
|
6
6
|
|
7
|
-
<hr/>
|
8
|
-
|
9
|
-
## Variables
|
10
|
-
|
11
|
-
| <div style="width:120px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
12
|
-
| :--- | :--- | :--- | :--- | :--- |
|
13
|
-
| **`title`** | str | None | False | Stores a field title. |
|
14
|
-
| **`data_type`** | Type | None | False | Stores data type of the response. |
|
15
|
-
| **`items`** | Type | None | True | Stores data type of items in the list. Can leave it None when `data_type` is not list. |
|
16
|
-
| **`properties`** | List[`ResponseField`] | None | True | Stores properties as a list of `ResponseFormat` objects when the `data_type` is dict. |
|
17
|
-
| **`nullable`** | bool | False | False | If the field is nullable. |
|
18
|
-
| **`config`** | Dict[str, Any] | None | True | Stores other configs passed to response schema. |
|
19
|
-
|
20
|
-
|
21
7
|
**Quick Start**
|
22
8
|
|
23
9
|
Define a response format with field titles and data types.
|
@@ -210,3 +196,5 @@ response_field = vhq.ResponseField(
|
|
210
196
|
# Agent output:
|
211
197
|
# summary-with-config: <AGENT_RESPONSE_IN_STRING>
|
212
198
|
```
|
199
|
+
|
200
|
+
Ref. <a href="/core/task/reference/#responsefield">List of variables</a>
|
@@ -24,10 +24,10 @@ context = [sub_res, sub_task_2, "context to add in string"]
|
|
24
24
|
res = task.execute(context=context)
|
25
25
|
|
26
26
|
# Explicitly mentioned. `task.execute()` will trigger the following:
|
27
|
-
task_prompt = task.
|
27
|
+
task_prompt = task._user_prompt(context=context)
|
28
28
|
|
29
|
-
assert sub_res.
|
30
|
-
assert sub_task_2.output and sub_task_2.output.
|
29
|
+
assert sub_res._to_context_prompt() in task_prompt
|
30
|
+
assert sub_task_2.output and sub_task_2.output._to_context_prompt() in task_prompt # sub tasks' outputs are included in the task prompt.
|
31
31
|
assert "context to add in string" in task_promp
|
32
32
|
assert res
|
33
33
|
```
|
@@ -55,7 +55,7 @@ task.execute()
|
|
55
55
|
|
56
56
|
assert task.output is not None
|
57
57
|
assert task.processed_agents is not None # auto assigned
|
58
|
-
assert task.
|
58
|
+
assert task._delegations ==1
|
59
59
|
```
|
60
60
|
|
61
61
|
<hr>
|
@@ -83,7 +83,7 @@ with patch.object(vhq.Agent, "execute_task", return_value="test") as execute:
|
|
83
83
|
|
84
84
|
<hr>
|
85
85
|
|
86
|
-
##
|
86
|
+
## Tools
|
87
87
|
|
88
88
|
`[var]`<bold>`tools: Optional[List[ToolSet | Tool | Any]] = None`</bold>
|
89
89
|
|
@@ -116,7 +116,9 @@ res = task.execute()
|
|
116
116
|
assert res.tool_output == "empty func_demo"
|
117
117
|
```
|
118
118
|
|
119
|
-
Ref. <a href="/core/tool">Tool</a> class / <a href="/core/
|
119
|
+
Ref 1. <a href="/core/tool">Tool</a> class / <a href="/core/rag-tool">RAGTool</a> class
|
120
|
+
|
121
|
+
Ref 2. <a href="/core/task/task-output">TaskOutput</a> class
|
120
122
|
|
121
123
|
<hr>
|
122
124
|
|
@@ -142,6 +144,29 @@ assert res.tool_output == "simple func"
|
|
142
144
|
|
143
145
|
<hr>
|
144
146
|
|
147
|
+
## Image, Audio, File Content
|
148
|
+
|
149
|
+
Refer the content by adding an absolute file path to the content file or URL to the task object.
|
150
|
+
|
151
|
+
|
152
|
+
```python
|
153
|
+
import versionhq as vhq
|
154
|
+
from pathlib import Path
|
155
|
+
|
156
|
+
current_dir = Path(__file__).parent.parent
|
157
|
+
file_path = current_dir / "_sample/screenshot.png"
|
158
|
+
audio_path = current_dir / "_sample/sample.mp3"
|
159
|
+
|
160
|
+
task = vhq.Task(description="Summarize the given content", image=str(file_path), audio=str(audio_path))
|
161
|
+
res = task.execute(agent=vhq.Agent(llm="gemini-2.0", role="Content Interpretator"))
|
162
|
+
|
163
|
+
assert res.raw is not None
|
164
|
+
```
|
165
|
+
|
166
|
+
* Audio files are only applicable to `gemini` models.
|
167
|
+
|
168
|
+
<hr>
|
169
|
+
|
145
170
|
## Callbacks
|
146
171
|
|
147
172
|
`[var]`<bold>`callback: Optional[Callable] = None`</bold>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
---
|
2
|
+
tags:
|
3
|
+
- Task Graph
|
4
|
+
---
|
5
|
+
|
6
|
+
# Task Output
|
7
|
+
|
8
|
+
<class>`class` versionhq.task.model.<bold>TaskOutput<bold></class>
|
9
|
+
|
10
|
+
A Pydantic class to store and manage results of `Task`.
|
11
|
+
|
12
|
+
The following snippet demonstrates the `TaskOutput` object when the task is all-in with Pydantic response format, callbacks, tools, and evaluation.
|
13
|
+
|
14
|
+
```python
|
15
|
+
import versionhq as vhq
|
16
|
+
from pydantic import BaseModel
|
17
|
+
|
18
|
+
class CustomOutput(BaseModel):
|
19
|
+
test1: str
|
20
|
+
test2: list[str]
|
21
|
+
|
22
|
+
def dummy_tool():
|
23
|
+
return "dummy"
|
24
|
+
|
25
|
+
def summarize_response(message: str, test1: str, test2: list[str]) -> str:
|
26
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
27
|
+
|
28
|
+
task = vhq.Task(
|
29
|
+
description="Research a topic to teach a kid aged 6 about math.",
|
30
|
+
pydantic_output=CustomOutput,
|
31
|
+
tools=[dummy_tool],
|
32
|
+
callback=summarize_response,
|
33
|
+
callback_kwargs=dict(message="Hi! Here is the result: "),
|
34
|
+
should_evaluate=True, # triggers evaluation
|
35
|
+
eval_criteria=["Uniquness", "Fit to audience",],
|
36
|
+
|
37
|
+
)
|
38
|
+
res = task.execute()
|
39
|
+
|
40
|
+
assert res.task_id == task.id
|
41
|
+
assert res.raw
|
42
|
+
assert res.json_dict
|
43
|
+
assert res.pydantic.test1 and res.pydantic.test2
|
44
|
+
assert "Hi! Here is the result: " in res.callback_output
|
45
|
+
assert res.pydantic.test1 in res.callback_output and ", ".join(res.pydantic.test2) in res.callback_output
|
46
|
+
assert res.tool_output is None
|
47
|
+
assert res.evaluation and isinstance(res.evaluation, vhq.Evaluation)
|
48
|
+
```
|
49
|
+
|
50
|
+
Ref. <a href="/core/task/reference/#taskoutput">List of variables and class methods</a>
|
@@ -1,26 +1,25 @@
|
|
1
1
|
# Overview
|
2
2
|
|
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
|
|
10
|
-
A Python framework for
|
10
|
+
A Python framework for autonomous agent networks that handle task automation with multi-step reasoning.
|
11
11
|
|
12
12
|
**Visit:**
|
13
13
|
|
14
|
-
- [Playground](https://versi0n.io/
|
15
|
-
- [
|
16
|
-
- [
|
14
|
+
- [Playground](https://versi0n.io/)
|
15
|
+
- [Documentation](https://docs.versi0n.io)
|
16
|
+
- [Github](https://github.com/versionHQ/)
|
17
|
+
- [Python SDK](https://pypi.org/project/versionhq/)
|
17
18
|
|
18
|
-
**Contribute:**
|
19
|
-
|
20
|
-
- [Github Repository](https://github.com/versionHQ/multi-agent-system)
|
21
19
|
|
22
20
|
<hr />
|
23
21
|
|
22
|
+
|
24
23
|
## Key Features
|
25
24
|
|
26
25
|
`versionhq` is a Python framework designed for automating complex, multi-step tasks using autonomous agent networks.
|
@@ -28,18 +27,18 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
28
27
|
Users can either configure their agents and network manually or allow the system to automatically manage the process based on provided task goals.
|
29
28
|
|
30
29
|
|
31
|
-
###
|
30
|
+
### Agent Network
|
32
31
|
|
33
32
|
Agents adapt their formation based on task complexity.
|
34
33
|
|
35
34
|
You can specify a desired formation or allow the agents to determine it autonomously (default).
|
36
35
|
|
37
36
|
|
38
|
-
|
|
39
|
-
| :---
|
40
|
-
| **Formation**
|
41
|
-
| **Usage**
|
42
|
-
| **Use case**
|
37
|
+
| | **Solo Agent** | **Supervising** | **Squad** | **Random** |
|
38
|
+
| :--- | :--- | :--- | :--- | :--- |
|
39
|
+
| **Formation** | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/rbgxttfoeqqis1ettlfz.png" alt="solo" width="200"> | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/zhungor3elxzer5dum10.png" alt="solo" width="200"> | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/dnusl7iy7kiwkxwlpmg8.png" alt="solo" width="200"> | <img src="https://res.cloudinary.com/dfeirxlea/image/upload/v1738818211/pj_m_agents/sndpczatfzbrosxz9ama.png" alt="solo" width="200"> |
|
40
|
+
| **Usage** | <ul><li>A single agent with tools, knowledge, and memory.</li><li>When self-learning mode is on - it will turn into **Random** formation.</li></ul> | <ul><li>Leader agent gives directions, while sharing its knowledge and memory.</li><li>Subordinates can be solo agents or networks.</li></ul> | <ul><li>Share tasks, knowledge, and memory among network members.</li></ul> | <ul><li>A single agent handles tasks, asking help from other agents without sharing its memory or knowledge.</li></ul> |
|
41
|
+
| **Use case** | An email agent drafts promo message for the given audience. | The leader agent strategizes an outbound campaign plan and assigns components such as media mix or message creation to subordinate agents. | An email agent and social media agent share the product knowledge and deploy multi-channel outbound campaign. | 1. An email agent drafts promo message for the given audience, asking insights on tones from other email agents which oversee other clusters. 2. An agent calls the external agent to deploy the campaign. |
|
43
42
|
|
44
43
|
<hr />
|
45
44
|
|
@@ -15,9 +15,9 @@ exclude = ["test*", "__pycache__", "*.egg-info"]
|
|
15
15
|
|
16
16
|
[project]
|
17
17
|
name = "versionhq"
|
18
|
-
version = "1.2.
|
18
|
+
version = "1.2.4.1"
|
19
19
|
authors = [{ name = "Kuriko Iwai", email = "kuriko@versi0n.io" }]
|
20
|
-
description = "
|
20
|
+
description = "A Python framework for autonomous agent networks that handle task automation with multi-step reasoning."
|
21
21
|
readme = "README.md"
|
22
22
|
requires-python = ">=3.11"
|
23
23
|
license = { file = "LICENSE" }
|
@@ -93,7 +93,6 @@ torch = [
|
|
93
93
|
"torchvision>=0.21.0",
|
94
94
|
]
|
95
95
|
|
96
|
-
|
97
96
|
[tool.uv]
|
98
97
|
dev-dependencies = [
|
99
98
|
"mypy>=1.10.0",
|