versionhq 1.2.1.12__tar.gz → 1.2.1.13__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.12 → versionhq-1.2.1.13}/PKG-INFO +1 -1
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/core/agent/index.md +10 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/pyproject.toml +1 -1
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/__init__.py +5 -1
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/agent/model.py +23 -7
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task/model.py +1 -1
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task_graph/draft.py +9 -10
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq.egg-info/PKG-INFO +1 -1
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/agent/doc_test.py +5 -3
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/uv.lock +1 -1
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/.env.sample +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/.github/workflows/publish.yml +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/.github/workflows/run_tests.yml +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/.gitignore +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/.pre-commit-config.yaml +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/.python-version +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/LICENSE +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/README.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/SECURITY.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/db/preprocess.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/CNAME +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/_logos/favicon.ico +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/_logos/logo192.png +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/core/task/evaluation.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/core/task/index.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/core/task/response-field.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/core/task/task-output.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/core/task-graph/index.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/core/tool.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/index.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/quickstart.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/stylesheets/main.css +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/docs/tags.md +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/mkdocs.yml +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/requirements-dev.txt +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/requirements.txt +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/runtime.txt +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/setup.cfg +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/_utils/logger.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/agent/inhouse_agents.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/agent_network/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/agent_network/model.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/knowledge/source_docling.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/llm/llm_vars.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/llm/model.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/storage/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task/evaluate.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task/formation.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task/log_handler.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task/structured_response.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task_graph/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task_graph/colors.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/task_graph/model.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/tool/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq.egg-info/SOURCES.txt +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq.egg-info/requires.txt +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/agent/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/agent/agent_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/agent_network/Prompts/Demo_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/agent_network/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/agent_network/agent_network_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/cli/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/clients/customer_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/clients/product_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/conftest.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/doc_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/formation_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/knowledge/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/llm/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/llm/llm_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/memory/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/memory/memory_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/task/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/task/doc_taskoutput_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/task/doc_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/task/llm_connection_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/task/task_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/task_graph/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/task_graph/doc_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/task_graph/task_graph_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/tool/__init__.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/tool/composio_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/tool/doc_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/tool/tool_test.py +0 -0
- {versionhq-1.2.1.12 → versionhq-1.2.1.13}/tests/usecase_test.py +0 -0
@@ -25,6 +25,16 @@ agent = vhq.Agent(
|
|
25
25
|
)
|
26
26
|
```
|
27
27
|
|
28
|
+
To start the agent and receive a `TaskOutput` object based on its goal, call the `.start()` method.
|
29
|
+
|
30
|
+
```python
|
31
|
+
# ...Inherited from the previous code
|
32
|
+
|
33
|
+
res = agent.start(context="Planning a new campaign promotion starting this summer")
|
34
|
+
|
35
|
+
assert isinstance(res, vhq.TaskOutput)
|
36
|
+
```
|
37
|
+
|
28
38
|
<hr />
|
29
39
|
|
30
40
|
## Customizing
|
@@ -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.13"
|
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"
|
@@ -30,8 +30,10 @@ from versionhq.memory.model import ShortTermMemory,LongTermMemory, UserMemory, M
|
|
30
30
|
from versionhq.task.formation import form_agent_network
|
31
31
|
from versionhq.task_graph.draft import workflow
|
32
32
|
|
33
|
+
# from versionhq._utils.logger import Logger
|
33
34
|
|
34
|
-
|
35
|
+
|
36
|
+
__version__ = "1.2.1.13"
|
35
37
|
__all__ = [
|
36
38
|
"Agent",
|
37
39
|
|
@@ -91,4 +93,6 @@ __all__ = [
|
|
91
93
|
|
92
94
|
"form_agent_network",
|
93
95
|
"workflow",
|
96
|
+
|
97
|
+
# "Logger",
|
94
98
|
]
|
@@ -3,7 +3,6 @@ import uuid
|
|
3
3
|
from typing import Any, Dict, List, Optional, TypeVar, Callable, Type
|
4
4
|
from typing_extensions import Self
|
5
5
|
from dotenv import load_dotenv
|
6
|
-
import litellm
|
7
6
|
|
8
7
|
from pydantic import UUID4, BaseModel, Field, InstanceOf, PrivateAttr, model_validator, field_validator
|
9
8
|
from pydantic_core import PydanticCustomError
|
@@ -57,9 +56,7 @@ class TokenProcess:
|
|
57
56
|
# @track_agent()
|
58
57
|
class Agent(BaseModel):
|
59
58
|
"""
|
60
|
-
A class to store agent
|
61
|
-
Agents must have `role`, `goal`, and `llm` = DEFAULT_MODEL_NAME as default.
|
62
|
-
Then run validation on `backstory`, `llm`, `tools`, `rpm` (request per min), `knowledge`, and `memory`.
|
59
|
+
A Pydantic class to store an agent object. Agents must have `role` and `goal` to start.
|
63
60
|
"""
|
64
61
|
|
65
62
|
__hash__ = object.__hash__
|
@@ -453,7 +450,6 @@ class Agent(BaseModel):
|
|
453
450
|
return self
|
454
451
|
|
455
452
|
|
456
|
-
|
457
453
|
def invoke(
|
458
454
|
self,
|
459
455
|
prompts: str,
|
@@ -515,8 +511,6 @@ class Agent(BaseModel):
|
|
515
511
|
raise ValueError("Invalid response from LLM call - None or empty.")
|
516
512
|
|
517
513
|
|
518
|
-
|
519
|
-
|
520
514
|
def execute_task(self, task, context: Optional[Any] = None, task_tools: Optional[List[Tool | ToolSet]] = list()) -> str:
|
521
515
|
"""
|
522
516
|
Format a task prompt, adding context from knowledge and memory (if given), and invoke LLM.
|
@@ -582,5 +576,27 @@ class Agent(BaseModel):
|
|
582
576
|
return raw_response
|
583
577
|
|
584
578
|
|
579
|
+
def start(self, context: Any = None) -> Any | None:
|
580
|
+
"""
|
581
|
+
Defines and executes a task when it is not given and returns TaskOutput object.
|
582
|
+
"""
|
583
|
+
|
584
|
+
if not self.goal or not self.role:
|
585
|
+
return None
|
586
|
+
|
587
|
+
from versionhq.task.model import Task, ResponseField
|
588
|
+
|
589
|
+
class Output(BaseModel):
|
590
|
+
steps: list[str]
|
591
|
+
conclution: str
|
592
|
+
|
593
|
+
task = Task(
|
594
|
+
description=f"List up first 3 steps that need to achieve {self.goal} in concise manner, then lead the conclusion in a sentence.",
|
595
|
+
pydantic_output=Output
|
596
|
+
)
|
597
|
+
res = task.execute(agent=self, context=context)
|
598
|
+
return res
|
599
|
+
|
600
|
+
|
585
601
|
def __repr__(self):
|
586
602
|
return f"Agent(role={self.role}, goal={self.goal}"
|
@@ -363,7 +363,7 @@ Response format: {response_format}
|
|
363
363
|
Ref. Output image: {output_formats_to_follow}
|
364
364
|
"""
|
365
365
|
else:
|
366
|
-
output_prompt = "Return your response as a valid JSON serializable string, enclosed in double quotes. Do not use single quotes, trailing commas, or other non-standard JSON syntax."
|
366
|
+
output_prompt = "You MUST Return your response as a valid JSON serializable string, enclosed in double quotes. Do not use single quotes, trailing commas, or other non-standard JSON syntax."
|
367
367
|
|
368
368
|
return dedent(output_prompt)
|
369
369
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import sys
|
2
2
|
from typing import Type, Any
|
3
|
-
from pydantic import BaseModel
|
3
|
+
from pydantic import BaseModel
|
4
4
|
from pydantic._internal._model_construction import ModelMetaclass
|
5
5
|
from textwrap import dedent
|
6
6
|
if 'pydantic.main' not in sys.modules:
|
@@ -10,11 +10,11 @@ sys.modules['pydantic.main'].ModelMetaclass = ModelMetaclass
|
|
10
10
|
|
11
11
|
from versionhq.agent.model import Agent
|
12
12
|
from versionhq.task.model import ResponseField
|
13
|
-
from versionhq.task_graph.model import TaskGraph, Task, DependencyType, Node
|
13
|
+
from versionhq.task_graph.model import TaskGraph, Task, DependencyType, Node
|
14
14
|
from versionhq._utils.logger import Logger
|
15
15
|
|
16
16
|
|
17
|
-
def workflow(final_output: Type[BaseModel], context: Any = None, human: bool =
|
17
|
+
def workflow(final_output: Type[BaseModel], context: Any = None, human: bool = False) -> TaskGraph | None:
|
18
18
|
"""
|
19
19
|
Generate a TaskGraph object to generate the givne final_output most resource-efficiently.
|
20
20
|
"""
|
@@ -52,13 +52,12 @@ def workflow(final_output: Type[BaseModel], context: Any = None, human: bool = T
|
|
52
52
|
description=dedent(f"Design a resource-efficient workflow to achieve the following goal: {final_output_prompt}. The workflow should consist of a list of detailed tasks that represent decision making points, each with the following information:\nname: A concise name of the task\ndescription: A concise description of the task.\nconnections: A list of target tasks that this task connects to.\ndependency_types: The type of dependency between this task and each of its connected task. \noutput: key output from the task in a word.\n\nUse the following dependency types: {dep_type_prompt}.\n\nPrioritize minimizing resource consumption (computation, memory, and data transfer) when defining tasks, connections, and dependencies. Consider how data is passed between tasks and aim to reduce unnecessary data duplication or transfer. Explain any design choices made to optimize resource usage."),
|
53
53
|
response_fields=[
|
54
54
|
ResponseField(title="tasks", data_type=list, items=dict, properties=[
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
)
|
55
|
+
ResponseField(title="name", data_type=str),
|
56
|
+
ResponseField(title="description", data_type=str),
|
57
|
+
ResponseField(title="output", data_type=str),
|
58
|
+
ResponseField(title="connections", data_type=list, items=str),
|
59
|
+
ResponseField(title="dependency_types", data_type=list, items=str),
|
60
|
+
])
|
62
61
|
]
|
63
62
|
)
|
64
63
|
res = task.execute(agent=graph_expert, context=[context_prompt, context])
|
@@ -1,14 +1,16 @@
|
|
1
1
|
"""Test use cases in docs/core/agents.md"""
|
2
2
|
|
3
3
|
def test_docs_core_agent_a():
|
4
|
-
|
5
|
-
agent = Agent(
|
4
|
+
import versionhq as vhq
|
5
|
+
agent = vhq.Agent(
|
6
6
|
role="Marketing Analyst",
|
7
|
-
goal="Coping with price competition in saturated markets"
|
7
|
+
goal="Coping with price competition in saturated markets",
|
8
8
|
)
|
9
9
|
|
10
10
|
assert agent.id and agent.role == "Marketing Analyst" and agent.goal == "Coping with price competition in saturated markets" and agent.backstory is not None
|
11
11
|
|
12
|
+
res = agent.start(context="Planning a new campaign promotion starting this summer")
|
13
|
+
assert isinstance(res, vhq.TaskOutput)
|
12
14
|
|
13
15
|
def test_docs_core_agent_b1():
|
14
16
|
from versionhq import Agent
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|