versionhq 1.2.2.9__tar.gz → 1.2.2.10__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.9 → versionhq-1.2.2.10}/.gitignore +2 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/PKG-INFO +2 -2
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/README.md +1 -1
- versionhq-1.2.2.10/docs/core/knowledge.md +11 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/llm/index.md +2 -1
- versionhq-1.2.2.10/docs/core/memory.md +11 -0
- versionhq-1.2.2.10/docs/core/rag-tool.md +85 -0
- versionhq-1.2.2.10/docs/core/task/evaluation.md +77 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/task/index.md +1 -1
- versionhq-1.2.2.10/docs/core/task/reference.md +105 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/task/task-output.md +3 -2
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/task/task-strc-response.md +1 -1
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/tool.md +2 -1
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/mkdocs.yml +4 -1
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/pyproject.toml +1 -1
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/__init__.py +1 -1
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/llm/llm_vars.py +4 -1
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/tool/rag_tool.py +1 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq.egg-info/PKG-INFO +2 -2
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq.egg-info/SOURCES.txt +5 -1
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/llm/llm_connection_test.py +28 -1
- versionhq-1.2.2.10/tests/task/doc_eval_test.py +23 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/task/eval_test.py +1 -1
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/tool/rag_tool_test.py +3 -2
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/uv.lock +1 -1
- versionhq-1.2.2.9/docs/core/task/evaluation.md +0 -6
- versionhq-1.2.2.9/docs/core/task/task-ref.md +0 -38
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/.env.sample +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/.github/workflows/publish.yml +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/.github/workflows/run_tests.yml +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/.pre-commit-config.yaml +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/.python-version +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/LICENSE +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/SECURITY.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/db/preprocess.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/CNAME +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/_logos/favicon.ico +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/_logos/logo192.png +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/agent/config.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/agent/index.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/agent/task-handling.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/agent-network/config.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/agent-network/form.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/agent-network/index.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/agent-network/ref.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/task/response-field.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/task/task-execution.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/core/task-graph/index.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/index.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/quickstart.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/stylesheets/main.css +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/docs/tags.md +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/requirements-dev.txt +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/requirements.txt +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/runtime.txt +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/setup.cfg +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/_utils/llm_as_a_judge.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/_utils/logger.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent/inhouse_agents.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent_network/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent_network/formation.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/agent_network/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/knowledge/source_docling.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/llm/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/storage/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task/evaluation.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task/structured_response.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task_graph/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task_graph/colors.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task_graph/draft.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/task_graph/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/tool/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq.egg-info/requires.txt +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/_sample/sample.csv +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/_sample/sample.json +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/agent/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/agent/agent_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/agent/doc_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/agent_network/Prompts/Demo_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/agent_network/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/agent_network/agent_network_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/agent_network/doc_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/cli/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/clients/customer_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/clients/product_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/conftest.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/doc_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/formation_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/knowledge/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/llm/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/llm/llm_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/memory/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/memory/memory_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/task/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/task/doc_taskoutput_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/task/doc_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/task/task_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/task_graph/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/task_graph/doc_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/task_graph/task_graph_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/tool/__init__.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/tool/composio_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/tool/doc_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/tests/tool/tool_test.py +0 -0
- {versionhq-1.2.2.9 → versionhq-1.2.2.10}/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.10
|
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
|
@@ -100,7 +100,7 @@ Agentic orchestration framework for multi-agent networks and task graphs for com
|
|
100
100
|
**Visit:**
|
101
101
|
|
102
102
|
- [Playground](https://versi0n.io/)
|
103
|
-
- [
|
103
|
+
- [Documentation](https://docs.versi0n.io)
|
104
104
|
- [Github](https://github.com/versionHQ/)
|
105
105
|
- [Python SDK](https://pypi.org/project/versionhq/)
|
106
106
|
|
@@ -13,7 +13,7 @@ Agentic orchestration framework for multi-agent networks and task graphs for com
|
|
13
13
|
**Visit:**
|
14
14
|
|
15
15
|
- [Playground](https://versi0n.io/)
|
16
|
-
- [
|
16
|
+
- [Documentation](https://docs.versi0n.io)
|
17
17
|
- [Github](https://github.com/versionHQ/)
|
18
18
|
- [Python SDK](https://pypi.org/project/versionhq/)
|
19
19
|
|
@@ -0,0 +1,85 @@
|
|
1
|
+
---
|
2
|
+
tags:
|
3
|
+
- Utilities
|
4
|
+
---
|
5
|
+
|
6
|
+
|
7
|
+
# RAG Tool
|
8
|
+
|
9
|
+
<class>`class` versionhq.tool.rag_tool.<bold>RagTool<bold></class>
|
10
|
+
|
11
|
+
A Pydantic class to store RAG tools that the agent will use when it executes the task.
|
12
|
+
|
13
|
+
|
14
|
+
## Quick Start
|
15
|
+
|
16
|
+
Similar to the `Tool` class, you can run the RAG tool using `url` and `query` variables.
|
17
|
+
|
18
|
+
```python
|
19
|
+
import versionhq as vhq
|
20
|
+
|
21
|
+
rt = vhq.RagTool(
|
22
|
+
url="https://github.com/chroma-core/chroma/issues/3233",
|
23
|
+
query="What is the next action plan?"
|
24
|
+
)
|
25
|
+
res = rt.run()
|
26
|
+
|
27
|
+
assert rt.text is not None # text source from the url
|
28
|
+
assert res is not None
|
29
|
+
```
|
30
|
+
|
31
|
+
|
32
|
+
<hr>
|
33
|
+
|
34
|
+
## Using with Agents
|
35
|
+
|
36
|
+
You can call a specific agent when you run a RAG tool.
|
37
|
+
|
38
|
+
```python
|
39
|
+
import versionhq as vhq
|
40
|
+
|
41
|
+
rt = vhq.RagTool(url="https://github.com/chroma-core/chroma/issues/3233", query="What is the next action plan?")
|
42
|
+
|
43
|
+
agent = vhq.Agent(role="RAG Tool Tester")
|
44
|
+
res = rt.run(agent=agent)
|
45
|
+
|
46
|
+
assert agent.knowledge_sources is not None
|
47
|
+
assert rt.text is not None
|
48
|
+
assert res is not None
|
49
|
+
```
|
50
|
+
|
51
|
+
|
52
|
+
Agents can own RAG tools.
|
53
|
+
|
54
|
+
```python
|
55
|
+
import versionhq as vhq
|
56
|
+
|
57
|
+
rt = vhq.RagTool(url="https://github.com/chroma-core/chroma/issues/3233", query="What is the next action plan?")
|
58
|
+
|
59
|
+
agent = vhq.Agent(role="RAG Tool Tester", tools=[rt]) # adding RAG tool/s
|
60
|
+
task = vhq.Task(description="return a simple response", can_use_agent_tools=True, tool_res_as_final=True)
|
61
|
+
res = task.execute(agent=agent)
|
62
|
+
|
63
|
+
assert res.raw is not None
|
64
|
+
assert res.tool_output is not None
|
65
|
+
```
|
66
|
+
|
67
|
+
|
68
|
+
### Variables
|
69
|
+
|
70
|
+
| <div style="width:160px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
71
|
+
| :--- | :--- | :--- | :--- | :--- |
|
72
|
+
| **`api_key_name`** | Optional[str] | None | True | API key name in .env file. |
|
73
|
+
| **`api_endpoint`** | Optional[str] | None | True |API endpoint. |
|
74
|
+
| **`url`** | Optional[str] | None | True | URLs to extract the text source. |
|
75
|
+
| **`headers`** | Optional[Dict[str, Any]] | dict() | - | Request headers |
|
76
|
+
| **`query`** | Optional[str] | None | True | Query. |
|
77
|
+
| **`text`** | Optional[str] | None | True | Text sources extracted from the URL or API call |
|
78
|
+
|
79
|
+
|
80
|
+
### Class Methods
|
81
|
+
|
82
|
+
| <div style="width:120px">**Method**</div> | <div style="width:300px">**Params**</div> | **Returns** | **Description** |
|
83
|
+
| :--- | :--- | :--- | :--- |
|
84
|
+
| **`store_data`** | <p>agent: Optional["vhq.Agent"] = Non</p> | None | Stores the retrieved data in the storage. |
|
85
|
+
| **`run`** | *args, **kwargs | Any | Execute the tool. |
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
tags:
|
3
|
+
- Task Graph
|
4
|
+
---
|
5
|
+
|
6
|
+
# Evaluation
|
7
|
+
|
8
|
+
<class>`class` versionhq.task.evaluate.<bold>Evaluation<bold></class>
|
9
|
+
|
10
|
+
A Pydantic class to store conditions and results of the evaluation.
|
11
|
+
|
12
|
+
|
13
|
+
### Variables
|
14
|
+
|
15
|
+
| <div style="width:120px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
16
|
+
| :--- | :--- | :--- | :--- | :--- |
|
17
|
+
| **`items`** | List[InstanceOf[EvaluationItem]] | list() | - | Stores evaluation items. |
|
18
|
+
| **`eval_by`** | Any | None | True | Stores an agent evaluated the output. |
|
19
|
+
|
20
|
+
|
21
|
+
### Property
|
22
|
+
|
23
|
+
| <div style="width:120px">**Property**</div> | **Returns** | **Description** |
|
24
|
+
| :--- | :--- | :--- |
|
25
|
+
| **`aggregate_score`** | float | Calucurates weighted average eval scores of the task output. |
|
26
|
+
| **`suggestion_summary`** | str | Returns summary of the suggestions. |
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
<hr>
|
31
|
+
|
32
|
+
## EvaluationItem
|
33
|
+
|
34
|
+
<class>`class` versionhq.task.evaluate.<bold>EvaluationItem<bold></class>
|
35
|
+
|
36
|
+
### Variables
|
37
|
+
|
38
|
+
| <div style="width:120px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
39
|
+
| :--- | :--- | :--- | :--- | :--- |
|
40
|
+
| **`criteria`** | str | None | False | Stores evaluation criteria given by the client. |
|
41
|
+
| **`suggestion`** | str | None | True | Stores suggestion on improvement from the evaluator agent. |
|
42
|
+
| **`score`** | float | None | True | Stores the score on a 0 to 1 scale. |
|
43
|
+
|
44
|
+
|
45
|
+
<hr>
|
46
|
+
|
47
|
+
## Usage
|
48
|
+
|
49
|
+
Evaluator agents will evaluate the task output based on the given criteria, and store the results in the `TaskOutput` object.
|
50
|
+
|
51
|
+
|
52
|
+
```python
|
53
|
+
import versionhq as vhq
|
54
|
+
from pydantic import BaseModel
|
55
|
+
|
56
|
+
class CustomOutput(BaseModel):
|
57
|
+
test1: str
|
58
|
+
test2: list[str]
|
59
|
+
|
60
|
+
task = vhq.Task(
|
61
|
+
description="Research a topic to teach a kid aged 6 about math.",
|
62
|
+
pydantic_output=CustomOutput,
|
63
|
+
should_evaluate=True, # triggers evaluation
|
64
|
+
eval_criteria=["uniquness", "audience fit",],
|
65
|
+
|
66
|
+
)
|
67
|
+
res = task.execute()
|
68
|
+
|
69
|
+
assert isinstance(res.evaluation, vhq.Evaluation)
|
70
|
+
assert [item for item in res.evaluation.items if item.criteria == "uniquness" or item.criteria == "audience fit"]
|
71
|
+
assert res.evaluation.aggregate_score is not None
|
72
|
+
assert res.evaluation.suggestion_summary is not None
|
73
|
+
```
|
74
|
+
|
75
|
+
An `Evaluation` object provides scores for the given criteria.
|
76
|
+
|
77
|
+
For example, it might indicate a `uniqueness` score of 0.56, an `audience fit` score of 0.70, and an `aggregate score` of 0.63.
|
@@ -7,7 +7,7 @@ tags:
|
|
7
7
|
|
8
8
|
<class>`class` versionhq.task.model.<bold>Task<bold></class>
|
9
9
|
|
10
|
-
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.
|
10
|
+
A Pydantic 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.
|
11
11
|
|
12
12
|
Ref. Node / Edge / <a href="/core/task-graph">TaskGraph</a> class
|
13
13
|
|
@@ -0,0 +1,105 @@
|
|
1
|
+
## `Task`
|
2
|
+
|
3
|
+
### Variables
|
4
|
+
|
5
|
+
| <div style="width:160px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
6
|
+
| :--- | :--- | :--- | :--- | :--- |
|
7
|
+
| **`id`** | UUID | uuid.uuid4() | False | Stores task `id` as an identifier. |
|
8
|
+
| **`name`** | Optional[str] | None | True | Stores a task name (Inherited as `node` identifier if the task is dependent) |
|
9
|
+
| **`description`** | str | None | False | Required field to store a concise task description |
|
10
|
+
| **`pydantic_output`** | Optional[Type[BaseModel]] | None | True | Stores pydantic custom output class for structured response |
|
11
|
+
| **`response_fields`** | Optional[List[ResponseField]] | list() | True | Stores JSON formats for stuructured response |
|
12
|
+
| **`tools`** | Optional[List[ToolSet | Tool | Any]] | None | True | 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 the tool response a final response from the agent |
|
15
|
+
| **`execution_type`** | TaskExecutionType | TaskExecutionType.SYNC | - | Sync or async execution |
|
16
|
+
| **`allow_delegation`** | bool | False | - | Whether to allow the agent to delegate the task to another agent |
|
17
|
+
| **`callback`** | Optional[Callable] | None | True | Callback function to be executed after LLM calling |
|
18
|
+
| **`callback_kwargs`** | Optional[Dict[str, Any]] | dict() | True | Args for the callback function (if any)|
|
19
|
+
| **`should_evaluate`** | bool | False | - | Whether to evaluate the task output using eval criteria |
|
20
|
+
| **`eval_criteria`** | Optional[List[str]] | list() | True | Evaluation criteria given by the human client |
|
21
|
+
| **`fsls`** | Optional[List[str]] | None | True | Examples of excellent and weak responses |
|
22
|
+
| **`processed_agents`** | Set[str] | set() | True | [Ops] Stores roles of the agents executed the task |
|
23
|
+
| **`tool_errors`** | int | 0 | True | [Ops] Stores number of tool errors |
|
24
|
+
| **`delegation`** | int | 0 | True | [Ops] Stores number of agent delegations |
|
25
|
+
| **`output`** | Optional[TaskOutput] | None | True | [Ops] Stores `TaskOutput` object after the execution |
|
26
|
+
|
27
|
+
|
28
|
+
### Class Methods
|
29
|
+
|
30
|
+
| <div style="width:120px">**Method**</div> | <div style="width:300px">**Params**</div> | **Returns** | **Description** |
|
31
|
+
| :--- | :--- | :--- | :--- |
|
32
|
+
| **`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. |
|
33
|
+
|
34
|
+
|
35
|
+
### Properties
|
36
|
+
|
37
|
+
| <div style="width:120px">**Property**</div> | **Returns** | **Description** |
|
38
|
+
| :--- | :--- | :--- |
|
39
|
+
| **`key`** | str | Returns task key based on its description and output format. |
|
40
|
+
| **`summary`** | str | Returns a summary of the task based on its id, description and tools. |
|
41
|
+
|
42
|
+
<hr>
|
43
|
+
|
44
|
+
## `TaskOutput`
|
45
|
+
|
46
|
+
### Variables
|
47
|
+
|
48
|
+
| <div style="width:120px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
49
|
+
| :--- | :--- | :--- | :--- | :--- |
|
50
|
+
| **`task_id`** | UUID | uuid.uuid4() | False | Stores task `id` as an identifier. |
|
51
|
+
| **`raw`** | str | None | False | Stores response in plane text format. `None` or `""` when the model returned errors.|
|
52
|
+
| **`json_dict`** | Dict[str, Any] | None | False | Stores response in JSON serializable dictionary. When the system failed formatting or executing tasks without response_fields, `{ output: <res.raw> }` will be returned. |
|
53
|
+
| **`pydantic`** | Type[`BaseModel`] | None | True | Populates and stores Pydantic class object defined in the `pydantic_output` field. `None` if `pydantic_output` is NOT given. |
|
54
|
+
| **`tool_output`** | Optional[Any] | None | True | Stores results from the tools of the task or agents ONLY when `tool_res_as_final` set as `True`. |
|
55
|
+
| **`callback_output`** | Optional[Any] | None | True | Stores results from callback functions if any. |
|
56
|
+
| **`latency`** | Optional[float] | None | True | Stores job latency in milseconds. |
|
57
|
+
| **`evaluation`** | Optional[InstanceOf[`Evaluation`]] | None | True | Stores overall evaluations and usage of the task output. |
|
58
|
+
|
59
|
+
|
60
|
+
### Class Methods
|
61
|
+
|
62
|
+
| <div style="width:120px">**Method**</div> | **Params** | **Returns** | **Description** |
|
63
|
+
| :--- | :--- | :--- | :--- |
|
64
|
+
| **`evaluate`** | task: InstanceOf[`Task`] | InstanceOf[`Evaluation`] | Evaluates task output based on the criteria |
|
65
|
+
|
66
|
+
|
67
|
+
### Property
|
68
|
+
|
69
|
+
| <div style="width:120px">**Property**</div> | **Returns** | **Description** |
|
70
|
+
| :--- | :--- | :--- |
|
71
|
+
| **`aggregate_score`** | float | Calucurates weighted average eval scores of the task output. |
|
72
|
+
| **`json_string`** | str | Returns `json_dict` in string format. |
|
73
|
+
|
74
|
+
|
75
|
+
<hr>
|
76
|
+
|
77
|
+
## `Evaluation`
|
78
|
+
|
79
|
+
### Variables
|
80
|
+
|
81
|
+
| <div style="width:120px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
82
|
+
| :--- | :--- | :--- | :--- | :--- |
|
83
|
+
| **`items`** | List[InstanceOf[EvaluationItem]] | list() | - | Stores evaluation items. |
|
84
|
+
| **`eval_by`** | Any | None | True | Stores an agent evaluated the output. |
|
85
|
+
|
86
|
+
|
87
|
+
### Property
|
88
|
+
|
89
|
+
| <div style="width:120px">**Property**</div> | **Returns** | **Description** |
|
90
|
+
| :--- | :--- | :--- |
|
91
|
+
| **`aggregate_score`** | float | Calucurates weighted average eval scores of the task output. |
|
92
|
+
| **`suggestion_summary`** | str | Returns summary of the suggestions. |
|
93
|
+
|
94
|
+
|
95
|
+
<hr>
|
96
|
+
|
97
|
+
## `EvaluationItem`
|
98
|
+
|
99
|
+
### Variables
|
100
|
+
|
101
|
+
| <div style="width:120px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
102
|
+
| :--- | :--- | :--- | :--- | :--- |
|
103
|
+
| **`criteria`** | str | None | False | Stores evaluation criteria given by the client. |
|
104
|
+
| **`suggestion`** | str | None | True | Stores suggestion on improvement from the evaluator agent. |
|
105
|
+
| **`score`** | float | None | True | Stores the score on a 0 to 1 scale. |
|
@@ -7,7 +7,7 @@ tags:
|
|
7
7
|
|
8
8
|
<class>`class` versionhq.task.model.<bold>TaskOutput<bold></class>
|
9
9
|
|
10
|
-
A Pydantic class to store and manage
|
10
|
+
A Pydantic class to store and manage results of `Task`.
|
11
11
|
|
12
12
|
<hr />
|
13
13
|
|
@@ -18,9 +18,10 @@ A Pydantic class to store and manage response from the `Task` object.
|
|
18
18
|
| **`task_id`** | UUID | uuid.uuid4() | False | Stores task `id` as an identifier. |
|
19
19
|
| **`raw`** | str | None | False | Stores response in plane text format. `None` or `""` when the model returned errors.|
|
20
20
|
| **`json_dict`** | Dict[str, Any] | None | False | Stores response in JSON serializable dictionary. When the system failed formatting or executing tasks without response_fields, `{ output: <res.raw> }` will be returned. |
|
21
|
-
| **`pydantic`** | Type[`BaseModel`] | None | True | Populates and stores Pydantic class defined in the `pydantic_output` field. `None` if `pydantic_output` is NOT given. |
|
21
|
+
| **`pydantic`** | Type[`BaseModel`] | None | True | Populates and stores Pydantic class object defined in the `pydantic_output` field. `None` if `pydantic_output` is NOT given. |
|
22
22
|
| **`tool_output`** | Optional[Any] | None | True | Stores results from the tools of the task or agents ONLY when `tool_res_as_final` set as `True`. |
|
23
23
|
| **`callback_output`** | Optional[Any] | None | True | Stores results from callback functions if any. |
|
24
|
+
| **`latency`** | Optional[float] | None | True | Stores job latency in milseconds. |
|
24
25
|
| **`evaluation`** | Optional[InstanceOf[`Evaluation`]] | None | True | Stores overall evaluations and usage of the task output. |
|
25
26
|
|
26
27
|
|
@@ -12,7 +12,7 @@ But you can choose to generate Pydantic class or specifig JSON object as respons
|
|
12
12
|
|
13
13
|
`[var]`<bold>`pydantic_output: Optional[Type[BaseModel]] = None`</bold>
|
14
14
|
|
15
|
-
|
15
|
+
Add a `custom Pydantic class` as a structured response format to the `pydantic_output` field.
|
16
16
|
|
17
17
|
The custom class can accept **one layer of a nested child** as you can see in the following code snippet:
|
18
18
|
|
@@ -131,9 +131,12 @@ nav:
|
|
131
131
|
- Executing: 'core/task/task-execution.md'
|
132
132
|
- Outputs: 'core/task/task-output.md'
|
133
133
|
- Evaluating: 'core/task/evaluation.md'
|
134
|
-
- Reference: 'core/task/
|
134
|
+
- Reference: 'core/task/reference.md'
|
135
135
|
- Components:
|
136
136
|
- Tool: 'core/tool.md'
|
137
|
+
- RAG Tool: core/rag-tool.md
|
138
|
+
- Memory: core/memory.md
|
139
|
+
- Knowledge: core/knowledge.md
|
137
140
|
- Archive: 'tags.md'
|
138
141
|
- Cases:
|
139
142
|
- Playground: https://versi0n.io/playground
|
@@ -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.10"
|
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"
|
@@ -19,6 +19,7 @@ ENDPOINT_PROVIDERS = [
|
|
19
19
|
|
20
20
|
MODELS = {
|
21
21
|
"openai": [
|
22
|
+
"gpt-4.5-preview-2025-02-27",
|
22
23
|
"gpt-4",
|
23
24
|
"gpt-4o",
|
24
25
|
"gpt-4o-mini",
|
@@ -77,13 +78,15 @@ ENV_VARS = {
|
|
77
78
|
}
|
78
79
|
|
79
80
|
|
81
|
+
|
80
82
|
"""
|
81
83
|
Max input token size by the model.
|
82
84
|
"""
|
83
85
|
LLM_CONTEXT_WINDOW_SIZES = {
|
84
|
-
"gpt-4":
|
86
|
+
"gpt-4.5-preview-2025-02-27": 128000,
|
85
87
|
"gpt-4o": 128000,
|
86
88
|
"gpt-4o-mini": 128000,
|
89
|
+
"gpt-4": 8192,
|
87
90
|
"o1-preview": 128000,
|
88
91
|
"o1-mini": 128000,
|
89
92
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.2.2.
|
3
|
+
Version: 1.2.2.10
|
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
|
@@ -100,7 +100,7 @@ Agentic orchestration framework for multi-agent networks and task graphs for com
|
|
100
100
|
**Visit:**
|
101
101
|
|
102
102
|
- [Playground](https://versi0n.io/)
|
103
|
-
- [
|
103
|
+
- [Documentation](https://docs.versi0n.io)
|
104
104
|
- [Github](https://github.com/versionHQ/)
|
105
105
|
- [Python SDK](https://pypi.org/project/versionhq/)
|
106
106
|
|
@@ -23,6 +23,9 @@ docs/quickstart.md
|
|
23
23
|
docs/tags.md
|
24
24
|
docs/_logos/favicon.ico
|
25
25
|
docs/_logos/logo192.png
|
26
|
+
docs/core/knowledge.md
|
27
|
+
docs/core/memory.md
|
28
|
+
docs/core/rag-tool.md
|
26
29
|
docs/core/tool.md
|
27
30
|
docs/core/agent/config.md
|
28
31
|
docs/core/agent/index.md
|
@@ -34,10 +37,10 @@ docs/core/agent-network/ref.md
|
|
34
37
|
docs/core/llm/index.md
|
35
38
|
docs/core/task/evaluation.md
|
36
39
|
docs/core/task/index.md
|
40
|
+
docs/core/task/reference.md
|
37
41
|
docs/core/task/response-field.md
|
38
42
|
docs/core/task/task-execution.md
|
39
43
|
docs/core/task/task-output.md
|
40
|
-
docs/core/task/task-ref.md
|
41
44
|
docs/core/task/task-strc-response.md
|
42
45
|
docs/core/task-graph/index.md
|
43
46
|
docs/stylesheets/main.css
|
@@ -137,6 +140,7 @@ tests/llm/llm_test.py
|
|
137
140
|
tests/memory/__init__.py
|
138
141
|
tests/memory/memory_test.py
|
139
142
|
tests/task/__init__.py
|
143
|
+
tests/task/doc_eval_test.py
|
140
144
|
tests/task/doc_taskoutput_test.py
|
141
145
|
tests/task/doc_test.py
|
142
146
|
tests/task/eval_test.py
|
@@ -37,7 +37,7 @@ def res_field_task():
|
|
37
37
|
return Task(description="return random values strictly following the given response format.", response_fields=demo_response_fields)
|
38
38
|
|
39
39
|
|
40
|
-
def
|
40
|
+
def test_con_bedrock(simple_task, tool_task, schema_task, res_field_task):
|
41
41
|
llms_to_test = [
|
42
42
|
"bedrock/converse/us.meta.llama3-3-70b-instruct-v1:0",
|
43
43
|
"bedrock/us.meta.llama3-2-11b-instruct-v1:0",
|
@@ -65,3 +65,30 @@ def test_con(simple_task, tool_task, schema_task, res_field_task):
|
|
65
65
|
|
66
66
|
res_4 = res_field_task.execute(agent=agent, context="running a test")
|
67
67
|
assert [v and type(v) == res_field_task.response_fields[i].data_type for i, (k, v) in enumerate(res_4.json_dict.items())]
|
68
|
+
|
69
|
+
|
70
|
+
def test_con_gpt(simple_task, tool_task, schema_task, res_field_task):
|
71
|
+
llms_to_test = [
|
72
|
+
"gpt-4.5-preview-2025-02-27",
|
73
|
+
]
|
74
|
+
agents = [set_agent(llm=llm) for llm in llms_to_test]
|
75
|
+
|
76
|
+
for agent in agents:
|
77
|
+
assert isinstance(agent.llm, LLM)
|
78
|
+
assert agent.llm.provider == "openai"
|
79
|
+
assert agent.llm._init_model_name and agent.llm.provider and agent.llm.llm_config["max_tokens"] == agent.llm_config["max_tokens"]
|
80
|
+
|
81
|
+
res_1 = simple_task.execute(agent=agent, context="running a test")
|
82
|
+
assert res_1.raw is not None
|
83
|
+
|
84
|
+
res_2 = tool_task.execute(agent=agent, context="running a test")
|
85
|
+
assert res_2.tool_output is not None
|
86
|
+
|
87
|
+
res_3 = schema_task.execute(agent=agent, context="running a test")
|
88
|
+
assert [
|
89
|
+
getattr(res_3.pydantic, k) and v.annotation == Demo.model_fields[k].annotation
|
90
|
+
for k, v in res_3.pydantic.model_fields.items()
|
91
|
+
]
|
92
|
+
|
93
|
+
res_4 = res_field_task.execute(agent=agent, context="running a test")
|
94
|
+
assert [v and type(v) == res_field_task.response_fields[i].data_type for i, (k, v) in enumerate(res_4.json_dict.items())]
|
@@ -0,0 +1,23 @@
|
|
1
|
+
def test_eval():
|
2
|
+
import versionhq as vhq
|
3
|
+
from pydantic import BaseModel
|
4
|
+
|
5
|
+
class CustomOutput(BaseModel):
|
6
|
+
test1: str
|
7
|
+
test2: list[str]
|
8
|
+
|
9
|
+
task = vhq.Task(
|
10
|
+
description="Research a topic to teach a kid aged 6 about math.",
|
11
|
+
pydantic_output=CustomOutput,
|
12
|
+
should_evaluate=True, # triggers evaluation
|
13
|
+
eval_criteria=["Uniquness", "Fit to audience",],
|
14
|
+
|
15
|
+
)
|
16
|
+
res = task.execute()
|
17
|
+
|
18
|
+
assert isinstance(res.evaluation, vhq.Evaluation)
|
19
|
+
assert [item for item in res.evaluation.items if item.criteria == "Uniquness" or item.criteria == "Fit to audience"]
|
20
|
+
assert res.evaluation.aggregate_score is not None
|
21
|
+
assert res.evaluation.suggestion_summary is not None
|
22
|
+
|
23
|
+
test_eval()
|
@@ -50,4 +50,4 @@ def test_eval_with_fsls():
|
|
50
50
|
assert [isinstance(item, vhq.EvaluationItem) and item.criteria in task.eval_criteria for item in res.evaluation.items]
|
51
51
|
assert res.latency and res._tokens
|
52
52
|
assert res.evaluation.aggregate_score is not None
|
53
|
-
assert res.evaluation.suggestion_summary
|
53
|
+
assert res.evaluation.suggestion_summary is not None
|
@@ -10,7 +10,7 @@ def test_rag_tool():
|
|
10
10
|
def test_rag_tool_with_agent():
|
11
11
|
import versionhq as vhq
|
12
12
|
|
13
|
-
agent = vhq.Agent(role="
|
13
|
+
agent = vhq.Agent(role="RAG Tool Tester")
|
14
14
|
rt = vhq.RagTool(url="https://github.com/chroma-core/chroma/issues/3233", query="What is the next action plan?")
|
15
15
|
res = rt.run(agent=agent)
|
16
16
|
|
@@ -23,8 +23,9 @@ def test_use_rag_tool():
|
|
23
23
|
import versionhq as vhq
|
24
24
|
|
25
25
|
rt = vhq.RagTool(url="https://github.com/chroma-core/chroma/issues/3233", query="What is the next action plan?")
|
26
|
-
agent = vhq.Agent(role="
|
26
|
+
agent = vhq.Agent(role="RAG Tool Tester", tools=[rt])
|
27
27
|
task = vhq.Task(description="return a simple response", can_use_agent_tools=True, tool_res_as_final=True)
|
28
28
|
res = task.execute(agent=agent)
|
29
29
|
|
30
30
|
assert res.raw is not None
|
31
|
+
assert res.tool_output is not None
|