versionhq 1.2.1.3__py3-none-any.whl → 1.2.1.5__py3-none-any.whl
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/__init__.py +1 -1
- versionhq/_utils/logger.py +1 -1
- versionhq/task/model.py +18 -19
- {versionhq-1.2.1.3.dist-info → versionhq-1.2.1.5.dist-info}/METADATA +3 -3
- {versionhq-1.2.1.3.dist-info → versionhq-1.2.1.5.dist-info}/RECORD +8 -8
- {versionhq-1.2.1.3.dist-info → versionhq-1.2.1.5.dist-info}/LICENSE +0 -0
- {versionhq-1.2.1.3.dist-info → versionhq-1.2.1.5.dist-info}/WHEEL +0 -0
- {versionhq-1.2.1.3.dist-info → versionhq-1.2.1.5.dist-info}/top_level.txt +0 -0
versionhq/__init__.py
CHANGED
versionhq/_utils/logger.py
CHANGED
@@ -72,7 +72,7 @@ class Logger(BaseModel):
|
|
72
72
|
pass
|
73
73
|
|
74
74
|
cwd = Path.cwd()
|
75
|
-
log_file_dir = f"{cwd}
|
75
|
+
log_file_dir = f"{cwd}/.logs"
|
76
76
|
os.makedirs(log_file_dir, exist_ok=True)
|
77
77
|
filename = filename if filename else datetime.now().strftime('%H_%M_%S_%d_%m_%Y')
|
78
78
|
abs_dir = f"{log_file_dir}/{filename}.log"
|
versionhq/task/model.py
CHANGED
@@ -185,18 +185,20 @@ class TaskOutput(BaseModel):
|
|
185
185
|
evaluation: Optional[InstanceOf[Evaluation]] = Field(default=None, description="store overall evaluation of the task output. passed to ltm")
|
186
186
|
|
187
187
|
|
188
|
-
def
|
188
|
+
def to_context_prompt(self) -> str:
|
189
189
|
"""
|
190
|
-
|
190
|
+
Returns response in string as a prompt context.
|
191
191
|
"""
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
192
|
+
context = ""
|
193
|
+
try:
|
194
|
+
context = json.dumps(self.json_dict)
|
195
|
+
except:
|
196
|
+
try:
|
197
|
+
if self.pydantic:
|
198
|
+
context = self.pydantic.model_dump()
|
199
|
+
except:
|
200
|
+
context = self.raw
|
201
|
+
return context
|
200
202
|
|
201
203
|
|
202
204
|
def evaluate(self, task) -> Evaluation:
|
@@ -267,14 +269,10 @@ class Task(BaseModel):
|
|
267
269
|
name: Optional[str] = Field(default=None)
|
268
270
|
description: str = Field(description="Description of the actual task")
|
269
271
|
|
270
|
-
#
|
272
|
+
# response format
|
271
273
|
pydantic_output: Optional[Type[BaseModel]] = Field(default=None, description="store Pydantic class as structured response format")
|
272
274
|
response_fields: Optional[List[ResponseField]] = Field(default_factory=list, description="store list of ResponseField as structured response format")
|
273
275
|
|
274
|
-
# task setup
|
275
|
-
# context: Optional[List["Task"]] = Field(default=None, description="other tasks whose outputs should be used as context")
|
276
|
-
# prompt_context: Optional[str] = Field(default=None)
|
277
|
-
|
278
276
|
# tool usage
|
279
277
|
tools: Optional[List[ToolSet | Tool | Any]] = Field(default_factory=list, description="tools that the agent can use aside from their tools")
|
280
278
|
can_use_agent_tools: bool = Field(default=False, description="whether the agent can use their own tools when executing the task")
|
@@ -386,13 +384,14 @@ Ref. Output image: {output_formats_to_follow}
|
|
386
384
|
case Task():
|
387
385
|
if not context.output:
|
388
386
|
res = context.execute()
|
389
|
-
context_to_add = res.
|
387
|
+
context_to_add = res.to_context_prompt()
|
390
388
|
|
391
389
|
else:
|
392
390
|
context_to_add = context.output.raw
|
393
391
|
|
394
392
|
case TaskOutput():
|
395
|
-
context_to_add = context.
|
393
|
+
context_to_add = context.to_context_prompt()
|
394
|
+
|
396
395
|
|
397
396
|
case dict():
|
398
397
|
context_to_add = str(context)
|
@@ -412,10 +411,10 @@ Ref. Output image: {output_formats_to_follow}
|
|
412
411
|
Format the task prompt and cascade it to the agent.
|
413
412
|
"""
|
414
413
|
output_prompt = self._draft_output_prompt(model_provider=model_provider)
|
415
|
-
context_prompt = self._draft_context_prompt(context=context) if context else None
|
416
414
|
task_slices = [self.description, output_prompt, ]
|
417
415
|
|
418
|
-
if
|
416
|
+
if context:
|
417
|
+
context_prompt = self._draft_context_prompt(context=context)
|
419
418
|
task_slices.insert(len(task_slices), f"Consider the following context when responding: {context_prompt}")
|
420
419
|
|
421
420
|
return "\n".join(task_slices)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.2.1.
|
3
|
+
Version: 1.2.1.5
|
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
|
@@ -415,7 +415,7 @@ src/
|
|
415
415
|
│
|
416
416
|
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
417
417
|
│
|
418
|
-
└──
|
418
|
+
└── .logs/ [.gitignore] # Local directory to store error/warning logs for debugging
|
419
419
|
│
|
420
420
|
│
|
421
421
|
pyproject.toml # Project config
|
@@ -591,7 +591,7 @@ Common issues and solutions:
|
|
591
591
|
|
592
592
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
593
593
|
|
594
|
-
* Issues related to agents and other systems: Check `
|
594
|
+
* Issues related to agents and other systems: Check `.logs` directory located in the root directory for error messages and stack traces.
|
595
595
|
|
596
596
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
597
597
|
|
@@ -1,7 +1,7 @@
|
|
1
|
-
versionhq/__init__.py,sha256=
|
1
|
+
versionhq/__init__.py,sha256=zh62wJK4H9QFpeR2SWXHuFDB8fvp-sN1ygezYC4pQGU,2817
|
2
2
|
versionhq/_utils/__init__.py,sha256=dzoZr4cBlh-2QZuPzTdehPUCe9lP1dmRtauD7qTjUaA,158
|
3
3
|
versionhq/_utils/i18n.py,sha256=TwA_PnYfDLA6VqlUDPuybdV9lgi3Frh_ASsb_X8jJo8,1483
|
4
|
-
versionhq/_utils/logger.py,sha256=
|
4
|
+
versionhq/_utils/logger.py,sha256=zgogTwAY-ujDLrdryAKhdtoaNe1nOFajmEN0V8aMR34,3155
|
5
5
|
versionhq/_utils/process_config.py,sha256=jbPGXK2Kb4iyCugJ3FwRJuU0wL5Trq2x4xFQz2uOyFY,746
|
6
6
|
versionhq/_utils/usage_metrics.py,sha256=NXF18dn5NNvGK7EsQ4AAghpR8ppYOjMx6ABenLLHnmM,1066
|
7
7
|
versionhq/_utils/vars.py,sha256=bZ5Dx_bFKlt3hi4-NNGXqdk7B23If_WaTIju2fiTyPQ,57
|
@@ -47,7 +47,7 @@ versionhq/task/evaluate.py,sha256=WdUgjbZL62XrxyWe5MTz29scfzwmuAHGxJ7GvAB8Fmk,39
|
|
47
47
|
versionhq/task/formation.py,sha256=qkAJ1ToeOHQFR3hqC8nJyU6msftPgm8yEPTrFfz77OA,6906
|
48
48
|
versionhq/task/formatter.py,sha256=N8Kmk9vtrMtBdgJ8J7RmlKNMdZWSmV8O1bDexmCWgU0,643
|
49
49
|
versionhq/task/log_handler.py,sha256=LT7YnO7gcPR9IZS7eRvMjnHh8crMBFtqduxd8dxIbkk,1680
|
50
|
-
versionhq/task/model.py,sha256=
|
50
|
+
versionhq/task/model.py,sha256=y4scd9c_RFF32OmJqBL3BBxVPykR8fu2DWk_tIqNgXk,28429
|
51
51
|
versionhq/task/structured_response.py,sha256=4q-hQPu7oMMHHXEzh9YW4SJ7N5eCZ7OfZ65juyl_jCI,5000
|
52
52
|
versionhq/task/TEMPLATES/Description.py,sha256=V-4kh8xpQTKOcDMi2xnuP-fcNk6kuoz1_5tYBlDLQWQ,420
|
53
53
|
versionhq/task_graph/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -59,8 +59,8 @@ versionhq/tool/composio_tool_vars.py,sha256=FvBuEXsOQUYnN7RTFxT20kAkiEYkxWKkiVtg
|
|
59
59
|
versionhq/tool/decorator.py,sha256=C4ZM7Xi2gwtEMaSeRo-geo_g_MAkY77WkSLkAuY0AyI,1205
|
60
60
|
versionhq/tool/model.py,sha256=PO4zNWBZcJhYVur381YL1dy6zqurio2jWjtbxOxZMGI,12194
|
61
61
|
versionhq/tool/tool_handler.py,sha256=2m41K8qo5bGCCbwMFferEjT-XZ-mE9F0mDUOBkgivOI,1416
|
62
|
-
versionhq-1.2.1.
|
63
|
-
versionhq-1.2.1.
|
64
|
-
versionhq-1.2.1.
|
65
|
-
versionhq-1.2.1.
|
66
|
-
versionhq-1.2.1.
|
62
|
+
versionhq-1.2.1.5.dist-info/LICENSE,sha256=cRoGGdM73IiDs6nDWKqPlgSv7aR4n-qBXYnJlCMHCeE,1082
|
63
|
+
versionhq-1.2.1.5.dist-info/METADATA,sha256=NdmB2VpDlH4dUaxzey8BSIjMlMzB1vj4tTrpYF00LdE,22395
|
64
|
+
versionhq-1.2.1.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
65
|
+
versionhq-1.2.1.5.dist-info/top_level.txt,sha256=DClQwxDWqIUGeRJkA8vBlgeNsYZs4_nJWMonzFt5Wj0,10
|
66
|
+
versionhq-1.2.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|