versionhq 1.1.10.3__py3-none-any.whl → 1.1.10.4__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/agent/model.py +3 -10
- versionhq/llm/model.py +1 -2
- versionhq/task/model.py +5 -3
- versionhq/task/structured_response.py +5 -7
- {versionhq-1.1.10.3.dist-info → versionhq-1.1.10.4.dist-info}/METADATA +1 -1
- {versionhq-1.1.10.3.dist-info → versionhq-1.1.10.4.dist-info}/RECORD +10 -10
- {versionhq-1.1.10.3.dist-info → versionhq-1.1.10.4.dist-info}/LICENSE +0 -0
- {versionhq-1.1.10.3.dist-info → versionhq-1.1.10.4.dist-info}/WHEEL +0 -0
- {versionhq-1.1.10.3.dist-info → versionhq-1.1.10.4.dist-info}/top_level.txt +0 -0
versionhq/__init__.py
CHANGED
versionhq/agent/model.py
CHANGED
@@ -255,9 +255,9 @@ class Agent(BaseModel):
|
|
255
255
|
llm.timeout = self.max_execution_time if llm.timeout is None else llm.timeout
|
256
256
|
llm.max_tokens = self.max_tokens if self.max_tokens else llm.max_tokens
|
257
257
|
|
258
|
-
|
259
|
-
|
260
|
-
|
258
|
+
if self.callbacks:
|
259
|
+
llm.callbacks = self.callbacks
|
260
|
+
llm._set_callbacks(llm.callbacks)
|
261
261
|
|
262
262
|
if self.respect_context_window == False:
|
263
263
|
llm.context_window_size = DEFAULT_CONTEXT_WINDOW_SIZE
|
@@ -364,9 +364,6 @@ class Agent(BaseModel):
|
|
364
364
|
task_execution_counter += 1
|
365
365
|
self._logger.log(level="info", message=f"Agent response: {raw_response}", color="blue")
|
366
366
|
|
367
|
-
if raw_response and self.callbacks:
|
368
|
-
for item in self.callbacks:
|
369
|
-
raw_response = item(raw_response)
|
370
367
|
|
371
368
|
except Exception as e:
|
372
369
|
self._logger.log(level="error", message=f"An error occured. The agent will retry: {str(e)}", color="red")
|
@@ -379,10 +376,6 @@ class Agent(BaseModel):
|
|
379
376
|
task_execution_counter += 1
|
380
377
|
self._logger.log(level="info", message=f"Agent #{task_execution_counter} response: {raw_response}", color="blue")
|
381
378
|
|
382
|
-
if raw_response and self.callbacks:
|
383
|
-
for item in self.callbacks:
|
384
|
-
raw_response = item(raw_response)
|
385
|
-
|
386
379
|
if not raw_response:
|
387
380
|
self._logger.log(level="error", message="Received None or empty response from the model", color="red")
|
388
381
|
raise ValueError("Invalid response from LLM call - None or empty.")
|
versionhq/llm/model.py
CHANGED
@@ -200,7 +200,7 @@ class LLM(BaseModel):
|
|
200
200
|
|
201
201
|
with suppress_warnings():
|
202
202
|
if len(self.callbacks) > 0:
|
203
|
-
self._set_callbacks(self.callbacks)
|
203
|
+
self._set_callbacks(self.callbacks) # passed by agent
|
204
204
|
|
205
205
|
try:
|
206
206
|
if tools:
|
@@ -261,7 +261,6 @@ class LLM(BaseModel):
|
|
261
261
|
return tool_res
|
262
262
|
|
263
263
|
else:
|
264
|
-
print(messages)
|
265
264
|
res = litellm.completion(messages=messages, stream=False, **params)
|
266
265
|
|
267
266
|
return res["choices"][0]["message"]["content"]
|
versionhq/task/model.py
CHANGED
@@ -169,6 +169,7 @@ class TaskOutput(BaseModel):
|
|
169
169
|
json_dict: Dict[str, Any] = Field(default=None, description="`raw` converted to dictionary")
|
170
170
|
pydantic: Optional[Any] = Field(default=None)
|
171
171
|
tool_output: Optional[Any] = Field(default=None, description="store tool result when the task takes tool output as its final output")
|
172
|
+
gott: Optional[Any] = Field(default=None, description="store task or agent callback outcome")
|
172
173
|
|
173
174
|
def __str__(self) -> str:
|
174
175
|
return str(self.pydantic) if self.pydantic else str(self.json_dict) if self.json_dict else self.raw
|
@@ -243,7 +244,7 @@ class Task(BaseModel):
|
|
243
244
|
# execution rules
|
244
245
|
allow_delegation: bool = Field(default=False, description="ask other agents for help and run the task instead")
|
245
246
|
async_execution: bool = Field(default=False,description="whether the task should be executed asynchronously or not")
|
246
|
-
callback: Optional[
|
247
|
+
callback: Optional[Callable] = Field(default=None, description="callback to be executed after the task is completed.")
|
247
248
|
callback_kwargs: Optional[Dict[str, Any]] = Field(default_factory=dict, description="kwargs for the callback when the callback is callable")
|
248
249
|
|
249
250
|
# recording
|
@@ -574,8 +575,9 @@ Ref. Output image: {output_formats_to_follow}
|
|
574
575
|
self.output = task_output
|
575
576
|
self.processed_by_agents.add(agent.role)
|
576
577
|
|
577
|
-
if self.callback:
|
578
|
-
self.callback(
|
578
|
+
if self.callback and isinstance(self.callback, Callable):
|
579
|
+
callback_res = self.callback(**self.callback_kwargs, **task_output.json_dict)
|
580
|
+
task_output.callback_output = callback_res
|
579
581
|
|
580
582
|
# if self.output_file: ## disabled for now
|
581
583
|
# content = (
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#! FIXME
|
2
1
|
from typing import Dict, Optional, Type, List, Any, TypeVar
|
3
2
|
|
4
3
|
from pydantic import BaseModel, Field, InstanceOf
|
@@ -92,12 +91,13 @@ class StructuredList:
|
|
92
91
|
|
93
92
|
elif nested_object_type == list:
|
94
93
|
props.update({
|
95
|
-
"nest": {
|
94
|
+
# "nest": {
|
96
95
|
"type": "array",
|
97
|
-
"items": { "
|
98
|
-
}
|
96
|
+
"items": { "type": "string" } , #! REFINEME - field title <>`item`
|
97
|
+
# }
|
98
|
+
})
|
99
99
|
else:
|
100
|
-
props.update({ "
|
100
|
+
props.update({ "type": SchemaType(nested_object_type).convert() })
|
101
101
|
|
102
102
|
self.items = { **props }
|
103
103
|
return {
|
@@ -109,8 +109,6 @@ class StructuredList:
|
|
109
109
|
}
|
110
110
|
|
111
111
|
|
112
|
-
|
113
|
-
|
114
112
|
class StructuredOutput(BaseModel):
|
115
113
|
response_format: Any = None
|
116
114
|
provider: str = "openai"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
versionhq/__init__.py,sha256=
|
1
|
+
versionhq/__init__.py,sha256=Qyl2FbktMQEDCkzVHeRjD9bAfYO_1XpEMXph6wJHu4w,951
|
2
2
|
versionhq/_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
versionhq/_utils/i18n.py,sha256=TwA_PnYfDLA6VqlUDPuybdV9lgi3Frh_ASsb_X8jJo8,1483
|
4
4
|
versionhq/_utils/logger.py,sha256=U-MpeGueA6YS8Ptfy0VnU_ePsZP-8Pvkvi0tZ4s_UMg,1438
|
@@ -6,7 +6,7 @@ versionhq/_utils/process_config.py,sha256=jbPGXK2Kb4iyCugJ3FwRJuU0wL5Trq2x4xFQz2
|
|
6
6
|
versionhq/_utils/rpm_controller.py,sha256=dUgFd6JtdjiLLTRmrjsBHdTaLn73XFuKpLbJh7thf2A,2289
|
7
7
|
versionhq/_utils/usage_metrics.py,sha256=hhq1OCW8Z4V93vwW2O2j528EyjOlF8wlTsX5IL-7asA,1106
|
8
8
|
versionhq/agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
-
versionhq/agent/model.py,sha256=
|
9
|
+
versionhq/agent/model.py,sha256=6lXKEPOo8BLpiUWppMQkeenb1NR0i7LIBAvfPvSLLSQ,19281
|
10
10
|
versionhq/agent/parser.py,sha256=Z_swUPO3piJQuYU8oVYwXWeR2zjmNb4PxbXZeR-GlIg,4694
|
11
11
|
versionhq/agent/TEMPLATES/Backstory.py,sha256=Gub3SUbdrNAwV0ITLYdZFJ4VFZRDfDRPdBZrtlknrds,554
|
12
12
|
versionhq/agent/TEMPLATES/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -20,14 +20,14 @@ versionhq/clients/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
20
20
|
versionhq/clients/workflow/model.py,sha256=FNftenLLoha0bkivrjId32awLHAkBwIT8iNljdic_bw,6003
|
21
21
|
versionhq/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
versionhq/llm/llm_vars.py,sha256=PO__b-h5e-6oQ-uoIgXx3lPSAUPUwXYfdVRW73fvX14,8761
|
23
|
-
versionhq/llm/model.py,sha256=
|
23
|
+
versionhq/llm/model.py,sha256=KAONedzfpGFpkQCv0THJGj2ffMxrrDSRcN7bsYEuGv0,13386
|
24
24
|
versionhq/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
versionhq/storage/task_output_storage.py,sha256=xoBJHeqUyQt6iJoR1WQTghP-fyxXL66qslpX1QC2-4o,4827
|
26
26
|
versionhq/task/__init__.py,sha256=l2r_g01i91JAGlOoHZP_Gh2WCk6mo9D19lcqt7sKMpQ,186
|
27
27
|
versionhq/task/formatter.py,sha256=N8Kmk9vtrMtBdgJ8J7RmlKNMdZWSmV8O1bDexmCWgU0,643
|
28
28
|
versionhq/task/log_handler.py,sha256=KJRrcNZgFSKhlNzvtYFnvtp6xukaF1s7ifX9u4zWrN8,1683
|
29
|
-
versionhq/task/model.py,sha256
|
30
|
-
versionhq/task/structured_response.py,sha256=
|
29
|
+
versionhq/task/model.py,sha256=-ZBCHXdNdvSQKeSeu-GloE_JYYR2Ljei8faTLY4Nn98,25441
|
30
|
+
versionhq/task/structured_response.py,sha256=h5GbbkCNJ27f4AbHcriGctQLFSp4qlmq2REDEfSd8xU,4786
|
31
31
|
versionhq/team/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
32
|
versionhq/team/model.py,sha256=NzcRXWwP0adWL9vsnsmI-A5dOcE3199FGmGgemUB2VA,20043
|
33
33
|
versionhq/team/team_planner.py,sha256=XkM93ItI59cuEzMN1s1jJ-B4LyalSZnAlYBY5SUCbVs,3603
|
@@ -38,8 +38,8 @@ versionhq/tool/composio_tool_vars.py,sha256=FvBuEXsOQUYnN7RTFxT20kAkiEYkxWKkiVtg
|
|
38
38
|
versionhq/tool/decorator.py,sha256=C4ZM7Xi2gwtEMaSeRo-geo_g_MAkY77WkSLkAuY0AyI,1205
|
39
39
|
versionhq/tool/model.py,sha256=5qG-OH7zohvepPDOjdjDulhEqmNUM4osiyk5LaxmSiU,12333
|
40
40
|
versionhq/tool/tool_handler.py,sha256=2m41K8qo5bGCCbwMFferEjT-XZ-mE9F0mDUOBkgivOI,1416
|
41
|
-
versionhq-1.1.10.
|
42
|
-
versionhq-1.1.10.
|
43
|
-
versionhq-1.1.10.
|
44
|
-
versionhq-1.1.10.
|
45
|
-
versionhq-1.1.10.
|
41
|
+
versionhq-1.1.10.4.dist-info/LICENSE,sha256=7CCXuMrAjPVsUvZrsBq9DsxI2rLDUSYXR_qj4yO_ZII,1077
|
42
|
+
versionhq-1.1.10.4.dist-info/METADATA,sha256=czccqTaFssL2JXVnEcP62zWL2BIsnHAlfPYeH8hc8yQ,16356
|
43
|
+
versionhq-1.1.10.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
44
|
+
versionhq-1.1.10.4.dist-info/top_level.txt,sha256=DClQwxDWqIUGeRJkA8vBlgeNsYZs4_nJWMonzFt5Wj0,10
|
45
|
+
versionhq-1.1.10.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|