versionhq 1.2.1.1__tar.gz → 1.2.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/.gitignore +1 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/PKG-INFO +44 -43
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/README.md +43 -42
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/index.md +1 -1
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/pyproject.toml +1 -1
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/requirements.txt +2 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/__init__.py +1 -1
- versionhq-1.2.1.2/src/versionhq/_utils/logger.py +97 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task/model.py +2 -1
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq.egg-info/PKG-INFO +44 -43
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/agent/agent_test.py +0 -1
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/uv.lock +28 -28
- versionhq-1.2.1.1/src/versionhq/_utils/logger.py +0 -50
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/.github/workflows/publish.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/.github/workflows/run_tests.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/.pre-commit-config.yaml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/.python-version +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/LICENSE +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/SECURITY.md +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/db/preprocess.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/CNAME +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/_logos/favicon.ico +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/_logos/logo192.png +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/core/Agent.md +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/core/task/response-field.md +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/core/task/task-output.md +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/core/task-graph.md +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/core/task.md +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/core/tool.md +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/quickstart.md +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/docs/stylesheets/main.css +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/mkdocs.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/requirements-dev.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/runtime.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/setup.cfg +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/agent/inhouse_agents.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/agent/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/agent_network/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/agent_network/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/knowledge/source_docling.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/llm/llm_vars.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/llm/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/storage/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task/evaluate.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task/formation.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task/log_handler.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task/structured_response.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task_graph/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/task_graph/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/tool/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq.egg-info/SOURCES.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq.egg-info/requires.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/agent/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/agent/doc_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/agent_network/Prompts/Demo_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/agent_network/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/agent_network/agent_network_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/cli/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/clients/customer_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/clients/product_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/conftest.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/doc_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/formation_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/knowledge/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/llm/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/llm/llm_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/memory/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/memory/memory_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/task/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/task/doc_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/task/llm_connection_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/task/task_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/task_graph/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/task_graph/doc_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/task_graph/task_graph_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/tool/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/tool/composio_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/tool/doc_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/tool/tool_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.2}/tests/usecase_test.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.2.1.
|
3
|
+
Version: 1.2.1.2
|
4
4
|
Summary: An agentic orchestration framework for building agent networks that handle task automation.
|
5
5
|
Author-email: Kuriko Iwai <kuriko@versi0n.io>
|
6
6
|
License: MIT License
|
@@ -115,13 +115,12 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
115
115
|
- [Forming a agent network](#forming-a-agent-network)
|
116
116
|
- [Executing tasks](#executing-tasks)
|
117
117
|
- [Supervising](#supervising)
|
118
|
-
- [Supervising](#supervising-1)
|
119
118
|
- [Technologies Used](#technologies-used)
|
120
119
|
- [Project Structure](#project-structure)
|
121
|
-
- [Setting Up
|
122
|
-
- [
|
123
|
-
- [
|
124
|
-
- [
|
120
|
+
- [Setting Up Your Project](#setting-up-your-project)
|
121
|
+
- [Installing package manager](#installing-package-manager)
|
122
|
+
- [Installing dependencies](#installing-dependencies)
|
123
|
+
- [Adding env secrets to .env file](#adding-env-secrets-to-env-file)
|
125
124
|
- [Contributing](#contributing)
|
126
125
|
- [Steps](#steps)
|
127
126
|
- [Package Management with uv](#package-management-with-uv)
|
@@ -257,7 +256,7 @@ agent.update(
|
|
257
256
|
res = network.launch()
|
258
257
|
```
|
259
258
|
|
260
|
-
|
259
|
+
This will form a network with multiple agents on `Formation` and return `TaskOutput` object with output in JSON, plane text, Pydantic model format with evaluation.
|
261
260
|
|
262
261
|
|
263
262
|
### Executing tasks
|
@@ -267,47 +266,45 @@ You can simply build an agent using `Agent` model and execute the task using `Ta
|
|
267
266
|
By default, agents prioritize JSON over plane text outputs.
|
268
267
|
|
269
268
|
|
270
|
-
|
271
|
-
|
272
|
-
|
269
|
+
```python
|
270
|
+
import versionhq as vhq
|
271
|
+
from pydantic import BaseModel
|
273
272
|
|
274
|
-
|
275
|
-
|
276
|
-
|
273
|
+
class CustomOutput(BaseModel):
|
274
|
+
test1: str
|
275
|
+
test2: list[str]
|
277
276
|
|
278
|
-
|
279
|
-
|
277
|
+
def dummy_func(message: str, test1: str, test2: list[str]) -> str:
|
278
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
280
279
|
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
280
|
+
task = vhq.Task(
|
281
|
+
description="Amazing task",
|
282
|
+
pydantic_output=CustomOutput,
|
283
|
+
callback=dummy_func,
|
284
|
+
callback_kwargs=dict(message="Hi! Here is the result: ")
|
285
|
+
)
|
287
286
|
|
288
|
-
|
289
|
-
|
290
|
-
|
287
|
+
res = task.execute(context="amazing context to consider.")
|
288
|
+
print(res)
|
289
|
+
```
|
291
290
|
|
292
291
|
|
293
292
|
This will return a `TaskOutput` object that stores response in plane text, JSON, and Pydantic model: `CustomOutput` formats with a callback result, tool output (if given), and evaluation results (if given).
|
294
293
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
294
|
+
```python
|
295
|
+
res == TaskOutput(
|
296
|
+
task_id=UUID('<TASK UUID>'),
|
297
|
+
raw='{\"test1\":\"random str\", \"test2\":[\"str item 1\", \"str item 2\", \"str item 3\"]}',
|
298
|
+
json_dict={'test1': 'random str', 'test2': ['str item 1', 'str item 2', 'str item 3']},
|
299
|
+
pydantic=<class '__main__.CustomOutput'>,
|
300
|
+
tool_output=None,
|
301
|
+
callback_output='Hi! Here is the result: random str, str item 1, str item 2, str item 3', # returned a plain text summary
|
302
|
+
evaluation=None
|
303
|
+
)
|
304
|
+
```
|
306
305
|
|
307
306
|
### Supervising
|
308
307
|
|
309
|
-
## Supervising
|
310
|
-
|
311
308
|
To create an agent network with one or more manager agents, designate members using the `is_manager` tag.
|
312
309
|
|
313
310
|
```python
|
@@ -410,16 +407,19 @@ src/
|
|
410
407
|
│ └── ...
|
411
408
|
│
|
412
409
|
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
413
|
-
|
410
|
+
│
|
411
|
+
└── _logs/ [.gitignore] # Local directory to store error/warning logs for debugging
|
412
|
+
│
|
413
|
+
│
|
414
414
|
pyproject.toml # Project config
|
415
415
|
|
416
416
|
```
|
417
417
|
|
418
418
|
<hr />
|
419
419
|
|
420
|
-
## Setting Up
|
420
|
+
## Setting Up Your Project
|
421
421
|
|
422
|
-
###
|
422
|
+
### Installing package manager
|
423
423
|
|
424
424
|
For MacOS:
|
425
425
|
|
@@ -433,7 +433,7 @@ pyproject.toml # Project config
|
|
433
433
|
```
|
434
434
|
|
435
435
|
|
436
|
-
###
|
436
|
+
### Installing dependencies
|
437
437
|
|
438
438
|
```
|
439
439
|
uv venv
|
@@ -466,7 +466,7 @@ pyproject.toml # Project config
|
|
466
466
|
|
467
467
|
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
468
468
|
|
469
|
-
###
|
469
|
+
### Adding env secrets to .env file
|
470
470
|
|
471
471
|
Create `.env` file in the project root and add following:
|
472
472
|
|
@@ -479,6 +479,7 @@ Create `.env` file in the project root and add following:
|
|
479
479
|
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
480
480
|
```
|
481
481
|
|
482
|
+
|
482
483
|
<hr />
|
483
484
|
|
484
485
|
## Contributing
|
@@ -583,7 +584,7 @@ Common issues and solutions:
|
|
583
584
|
|
584
585
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
585
586
|
|
586
|
-
* Issues related to
|
587
|
+
* Issues related to agents and other systems: Check `_logs` directory for detailed error messages and stack traces.
|
587
588
|
|
588
589
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
589
590
|
|
@@ -34,13 +34,12 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
34
34
|
- [Forming a agent network](#forming-a-agent-network)
|
35
35
|
- [Executing tasks](#executing-tasks)
|
36
36
|
- [Supervising](#supervising)
|
37
|
-
- [Supervising](#supervising-1)
|
38
37
|
- [Technologies Used](#technologies-used)
|
39
38
|
- [Project Structure](#project-structure)
|
40
|
-
- [Setting Up
|
41
|
-
- [
|
42
|
-
- [
|
43
|
-
- [
|
39
|
+
- [Setting Up Your Project](#setting-up-your-project)
|
40
|
+
- [Installing package manager](#installing-package-manager)
|
41
|
+
- [Installing dependencies](#installing-dependencies)
|
42
|
+
- [Adding env secrets to .env file](#adding-env-secrets-to-env-file)
|
44
43
|
- [Contributing](#contributing)
|
45
44
|
- [Steps](#steps)
|
46
45
|
- [Package Management with uv](#package-management-with-uv)
|
@@ -176,7 +175,7 @@ agent.update(
|
|
176
175
|
res = network.launch()
|
177
176
|
```
|
178
177
|
|
179
|
-
|
178
|
+
This will form a network with multiple agents on `Formation` and return `TaskOutput` object with output in JSON, plane text, Pydantic model format with evaluation.
|
180
179
|
|
181
180
|
|
182
181
|
### Executing tasks
|
@@ -186,47 +185,45 @@ You can simply build an agent using `Agent` model and execute the task using `Ta
|
|
186
185
|
By default, agents prioritize JSON over plane text outputs.
|
187
186
|
|
188
187
|
|
189
|
-
|
190
|
-
|
191
|
-
|
188
|
+
```python
|
189
|
+
import versionhq as vhq
|
190
|
+
from pydantic import BaseModel
|
192
191
|
|
193
|
-
|
194
|
-
|
195
|
-
|
192
|
+
class CustomOutput(BaseModel):
|
193
|
+
test1: str
|
194
|
+
test2: list[str]
|
196
195
|
|
197
|
-
|
198
|
-
|
196
|
+
def dummy_func(message: str, test1: str, test2: list[str]) -> str:
|
197
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
199
198
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
199
|
+
task = vhq.Task(
|
200
|
+
description="Amazing task",
|
201
|
+
pydantic_output=CustomOutput,
|
202
|
+
callback=dummy_func,
|
203
|
+
callback_kwargs=dict(message="Hi! Here is the result: ")
|
204
|
+
)
|
206
205
|
|
207
|
-
|
208
|
-
|
209
|
-
|
206
|
+
res = task.execute(context="amazing context to consider.")
|
207
|
+
print(res)
|
208
|
+
```
|
210
209
|
|
211
210
|
|
212
211
|
This will return a `TaskOutput` object that stores response in plane text, JSON, and Pydantic model: `CustomOutput` formats with a callback result, tool output (if given), and evaluation results (if given).
|
213
212
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
213
|
+
```python
|
214
|
+
res == TaskOutput(
|
215
|
+
task_id=UUID('<TASK UUID>'),
|
216
|
+
raw='{\"test1\":\"random str\", \"test2\":[\"str item 1\", \"str item 2\", \"str item 3\"]}',
|
217
|
+
json_dict={'test1': 'random str', 'test2': ['str item 1', 'str item 2', 'str item 3']},
|
218
|
+
pydantic=<class '__main__.CustomOutput'>,
|
219
|
+
tool_output=None,
|
220
|
+
callback_output='Hi! Here is the result: random str, str item 1, str item 2, str item 3', # returned a plain text summary
|
221
|
+
evaluation=None
|
222
|
+
)
|
223
|
+
```
|
225
224
|
|
226
225
|
### Supervising
|
227
226
|
|
228
|
-
## Supervising
|
229
|
-
|
230
227
|
To create an agent network with one or more manager agents, designate members using the `is_manager` tag.
|
231
228
|
|
232
229
|
```python
|
@@ -329,16 +326,19 @@ src/
|
|
329
326
|
│ └── ...
|
330
327
|
│
|
331
328
|
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
332
|
-
|
329
|
+
│
|
330
|
+
└── _logs/ [.gitignore] # Local directory to store error/warning logs for debugging
|
331
|
+
│
|
332
|
+
│
|
333
333
|
pyproject.toml # Project config
|
334
334
|
|
335
335
|
```
|
336
336
|
|
337
337
|
<hr />
|
338
338
|
|
339
|
-
## Setting Up
|
339
|
+
## Setting Up Your Project
|
340
340
|
|
341
|
-
###
|
341
|
+
### Installing package manager
|
342
342
|
|
343
343
|
For MacOS:
|
344
344
|
|
@@ -352,7 +352,7 @@ pyproject.toml # Project config
|
|
352
352
|
```
|
353
353
|
|
354
354
|
|
355
|
-
###
|
355
|
+
### Installing dependencies
|
356
356
|
|
357
357
|
```
|
358
358
|
uv venv
|
@@ -385,7 +385,7 @@ pyproject.toml # Project config
|
|
385
385
|
|
386
386
|
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
387
387
|
|
388
|
-
###
|
388
|
+
### Adding env secrets to .env file
|
389
389
|
|
390
390
|
Create `.env` file in the project root and add following:
|
391
391
|
|
@@ -398,6 +398,7 @@ Create `.env` file in the project root and add following:
|
|
398
398
|
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
399
399
|
```
|
400
400
|
|
401
|
+
|
401
402
|
<hr />
|
402
403
|
|
403
404
|
## Contributing
|
@@ -502,7 +503,7 @@ Common issues and solutions:
|
|
502
503
|
|
503
504
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
504
505
|
|
505
|
-
* Issues related to
|
506
|
+
* Issues related to agents and other systems: Check `_logs` directory for detailed error messages and stack traces.
|
506
507
|
|
507
508
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
508
509
|
|
@@ -216,7 +216,7 @@ Common issues and solutions:
|
|
216
216
|
|
217
217
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
218
218
|
|
219
|
-
* Issues related to
|
219
|
+
* Issues related to agents and other systems: Check `_logs` directory for detailed error messages and stack traces.
|
220
220
|
|
221
221
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
222
222
|
|
@@ -15,7 +15,7 @@ exclude = ["test*", "__pycache__", "*.egg-info"]
|
|
15
15
|
|
16
16
|
[project]
|
17
17
|
name = "versionhq"
|
18
|
-
version = "1.2.1.
|
18
|
+
version = "1.2.1.2"
|
19
19
|
authors = [{ name = "Kuriko Iwai", email = "kuriko@versi0n.io" }]
|
20
20
|
description = "An agentic orchestration framework for building agent networks that handle task automation."
|
21
21
|
readme = "README.md"
|
@@ -0,0 +1,97 @@
|
|
1
|
+
import logging
|
2
|
+
from datetime import datetime
|
3
|
+
from typing import Optional
|
4
|
+
|
5
|
+
from pydantic import BaseModel, Field, PrivateAttr
|
6
|
+
|
7
|
+
|
8
|
+
class Printer:
|
9
|
+
def print(self, content: str, color: Optional[str] = None):
|
10
|
+
if color == "purple":
|
11
|
+
self._print_purple(content)
|
12
|
+
elif color == "red":
|
13
|
+
self._print_red(content)
|
14
|
+
elif color == "green":
|
15
|
+
self._print_green(content)
|
16
|
+
elif color == "blue":
|
17
|
+
self._print_blue(content)
|
18
|
+
elif color == "yellow":
|
19
|
+
self._print_yellow(content)
|
20
|
+
else:
|
21
|
+
print(content)
|
22
|
+
|
23
|
+
def _print_purple(self, content):
|
24
|
+
print("\033[1m\033[95m {}\033[00m".format(content))
|
25
|
+
|
26
|
+
def _print_green(self, content):
|
27
|
+
print("\033[1m\033[92m {}\033[00m".format(content))
|
28
|
+
|
29
|
+
def _print_red(self, content):
|
30
|
+
print("\033[91m {}\033[00m".format(content))
|
31
|
+
|
32
|
+
def _print_blue(self, content):
|
33
|
+
print("\033[1m\033[94m {}\033[00m".format(content))
|
34
|
+
|
35
|
+
def _print_yellow(self, content):
|
36
|
+
print("\033[1m\033[93m {}\033[00m".format(content))
|
37
|
+
|
38
|
+
|
39
|
+
class Logger(BaseModel):
|
40
|
+
"""
|
41
|
+
Control CLI messages.
|
42
|
+
Color: red = error, yellow = warning, blue = info (from vhq), green = info (from third parties)
|
43
|
+
"""
|
44
|
+
|
45
|
+
verbose: bool = Field(default=True)
|
46
|
+
info_file_save: bool = Field(default=False, description="whether to save INFO logs")
|
47
|
+
_printer: Printer = PrivateAttr(default_factory=Printer)
|
48
|
+
|
49
|
+
|
50
|
+
def log(self, level: str, message: str, color="yellow"):
|
51
|
+
if self.verbose:
|
52
|
+
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
53
|
+
self._printer.print(f"\n{timestamp} - versionHQ [{level.upper()}]: {message}", color=color)
|
54
|
+
|
55
|
+
self._save(level=level, message=message)
|
56
|
+
|
57
|
+
|
58
|
+
def _save(self, level: str, message: str, filename: str = None):
|
59
|
+
import os
|
60
|
+
from pathlib import Path
|
61
|
+
|
62
|
+
if level.lower() == "info" and self.info_file_save == False:
|
63
|
+
return
|
64
|
+
|
65
|
+
logging_level = logging.INFO
|
66
|
+
match level:
|
67
|
+
case "warning":
|
68
|
+
logging_level = logging.WARNING
|
69
|
+
case "error":
|
70
|
+
logging_level = logging.ERROR
|
71
|
+
case _:
|
72
|
+
pass
|
73
|
+
|
74
|
+
cwd = Path.cwd()
|
75
|
+
log_file_dir = f"{cwd}/_logs"
|
76
|
+
os.makedirs(log_file_dir, exist_ok=True)
|
77
|
+
filename = filename if filename else datetime.now().strftime('%H_%M_%S_%d_%m_%Y')
|
78
|
+
abs_dir = f"{log_file_dir}/{filename}.log"
|
79
|
+
|
80
|
+
logging.basicConfig(filename=abs_dir, filemode='w', level=logging_level)
|
81
|
+
logger = logging.getLogger(__name__)
|
82
|
+
file_handler = logging.FileHandler(filename=abs_dir)
|
83
|
+
formatter = logging.Formatter('%(asctime)s : %(levelname)s : %(name)s : %(message)s')
|
84
|
+
file_handler.setFormatter(formatter)
|
85
|
+
|
86
|
+
for handler in logging.root.handlers[:]:
|
87
|
+
logging.root.removeHandler(handler)
|
88
|
+
|
89
|
+
logger.addHandler(file_handler)
|
90
|
+
|
91
|
+
match logging_level:
|
92
|
+
case logging.WARNING:
|
93
|
+
logger.warning(message)
|
94
|
+
case logging.ERROR:
|
95
|
+
logger.error(message)
|
96
|
+
case _:
|
97
|
+
logger.info(message)
|
@@ -617,6 +617,7 @@ Ref. Output image: {output_formats_to_follow}
|
|
617
617
|
|
618
618
|
self.prompt_context = context
|
619
619
|
task_output: InstanceOf[TaskOutput] = None
|
620
|
+
raw_output: str = None
|
620
621
|
tool_output: str | list = None
|
621
622
|
task_tools: List[List[InstanceOf[Tool]| InstanceOf[ToolSet] | Type[Tool]]] = []
|
622
623
|
started_at, ended_at = datetime.datetime.now(), datetime.datetime.now()
|
@@ -673,7 +674,7 @@ Ref. Output image: {output_formats_to_follow}
|
|
673
674
|
self.output = task_output
|
674
675
|
self.processed_agents.add(agent.role)
|
675
676
|
|
676
|
-
if self.should_evaluate:
|
677
|
+
if self.should_evaluate and raw_output: # eval only when raw output exsits
|
677
678
|
task_output.evaluate(task=self)
|
678
679
|
|
679
680
|
self._create_short_and_long_term_memories(agent=agent, task_output=task_output)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.2.1.
|
3
|
+
Version: 1.2.1.2
|
4
4
|
Summary: An agentic orchestration framework for building agent networks that handle task automation.
|
5
5
|
Author-email: Kuriko Iwai <kuriko@versi0n.io>
|
6
6
|
License: MIT License
|
@@ -115,13 +115,12 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
115
115
|
- [Forming a agent network](#forming-a-agent-network)
|
116
116
|
- [Executing tasks](#executing-tasks)
|
117
117
|
- [Supervising](#supervising)
|
118
|
-
- [Supervising](#supervising-1)
|
119
118
|
- [Technologies Used](#technologies-used)
|
120
119
|
- [Project Structure](#project-structure)
|
121
|
-
- [Setting Up
|
122
|
-
- [
|
123
|
-
- [
|
124
|
-
- [
|
120
|
+
- [Setting Up Your Project](#setting-up-your-project)
|
121
|
+
- [Installing package manager](#installing-package-manager)
|
122
|
+
- [Installing dependencies](#installing-dependencies)
|
123
|
+
- [Adding env secrets to .env file](#adding-env-secrets-to-env-file)
|
125
124
|
- [Contributing](#contributing)
|
126
125
|
- [Steps](#steps)
|
127
126
|
- [Package Management with uv](#package-management-with-uv)
|
@@ -257,7 +256,7 @@ agent.update(
|
|
257
256
|
res = network.launch()
|
258
257
|
```
|
259
258
|
|
260
|
-
|
259
|
+
This will form a network with multiple agents on `Formation` and return `TaskOutput` object with output in JSON, plane text, Pydantic model format with evaluation.
|
261
260
|
|
262
261
|
|
263
262
|
### Executing tasks
|
@@ -267,47 +266,45 @@ You can simply build an agent using `Agent` model and execute the task using `Ta
|
|
267
266
|
By default, agents prioritize JSON over plane text outputs.
|
268
267
|
|
269
268
|
|
270
|
-
|
271
|
-
|
272
|
-
|
269
|
+
```python
|
270
|
+
import versionhq as vhq
|
271
|
+
from pydantic import BaseModel
|
273
272
|
|
274
|
-
|
275
|
-
|
276
|
-
|
273
|
+
class CustomOutput(BaseModel):
|
274
|
+
test1: str
|
275
|
+
test2: list[str]
|
277
276
|
|
278
|
-
|
279
|
-
|
277
|
+
def dummy_func(message: str, test1: str, test2: list[str]) -> str:
|
278
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
280
279
|
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
280
|
+
task = vhq.Task(
|
281
|
+
description="Amazing task",
|
282
|
+
pydantic_output=CustomOutput,
|
283
|
+
callback=dummy_func,
|
284
|
+
callback_kwargs=dict(message="Hi! Here is the result: ")
|
285
|
+
)
|
287
286
|
|
288
|
-
|
289
|
-
|
290
|
-
|
287
|
+
res = task.execute(context="amazing context to consider.")
|
288
|
+
print(res)
|
289
|
+
```
|
291
290
|
|
292
291
|
|
293
292
|
This will return a `TaskOutput` object that stores response in plane text, JSON, and Pydantic model: `CustomOutput` formats with a callback result, tool output (if given), and evaluation results (if given).
|
294
293
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
294
|
+
```python
|
295
|
+
res == TaskOutput(
|
296
|
+
task_id=UUID('<TASK UUID>'),
|
297
|
+
raw='{\"test1\":\"random str\", \"test2\":[\"str item 1\", \"str item 2\", \"str item 3\"]}',
|
298
|
+
json_dict={'test1': 'random str', 'test2': ['str item 1', 'str item 2', 'str item 3']},
|
299
|
+
pydantic=<class '__main__.CustomOutput'>,
|
300
|
+
tool_output=None,
|
301
|
+
callback_output='Hi! Here is the result: random str, str item 1, str item 2, str item 3', # returned a plain text summary
|
302
|
+
evaluation=None
|
303
|
+
)
|
304
|
+
```
|
306
305
|
|
307
306
|
### Supervising
|
308
307
|
|
309
|
-
## Supervising
|
310
|
-
|
311
308
|
To create an agent network with one or more manager agents, designate members using the `is_manager` tag.
|
312
309
|
|
313
310
|
```python
|
@@ -410,16 +407,19 @@ src/
|
|
410
407
|
│ └── ...
|
411
408
|
│
|
412
409
|
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
413
|
-
|
410
|
+
│
|
411
|
+
└── _logs/ [.gitignore] # Local directory to store error/warning logs for debugging
|
412
|
+
│
|
413
|
+
│
|
414
414
|
pyproject.toml # Project config
|
415
415
|
|
416
416
|
```
|
417
417
|
|
418
418
|
<hr />
|
419
419
|
|
420
|
-
## Setting Up
|
420
|
+
## Setting Up Your Project
|
421
421
|
|
422
|
-
###
|
422
|
+
### Installing package manager
|
423
423
|
|
424
424
|
For MacOS:
|
425
425
|
|
@@ -433,7 +433,7 @@ pyproject.toml # Project config
|
|
433
433
|
```
|
434
434
|
|
435
435
|
|
436
|
-
###
|
436
|
+
### Installing dependencies
|
437
437
|
|
438
438
|
```
|
439
439
|
uv venv
|
@@ -466,7 +466,7 @@ pyproject.toml # Project config
|
|
466
466
|
|
467
467
|
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
468
468
|
|
469
|
-
###
|
469
|
+
### Adding env secrets to .env file
|
470
470
|
|
471
471
|
Create `.env` file in the project root and add following:
|
472
472
|
|
@@ -479,6 +479,7 @@ Create `.env` file in the project root and add following:
|
|
479
479
|
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
480
480
|
```
|
481
481
|
|
482
|
+
|
482
483
|
<hr />
|
483
484
|
|
484
485
|
## Contributing
|
@@ -583,7 +584,7 @@ Common issues and solutions:
|
|
583
584
|
|
584
585
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
585
586
|
|
586
|
-
* Issues related to
|
587
|
+
* Issues related to agents and other systems: Check `_logs` directory for detailed error messages and stack traces.
|
587
588
|
|
588
589
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
589
590
|
|