grasp_agents 0.2.5__py3-none-any.whl → 0.2.7__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.
- grasp_agents/llm_agent.py +2 -2
- grasp_agents/prompt_builder.py +12 -12
- {grasp_agents-0.2.5.dist-info → grasp_agents-0.2.7.dist-info}/METADATA +3 -3
- {grasp_agents-0.2.5.dist-info → grasp_agents-0.2.7.dist-info}/RECORD +6 -6
- {grasp_agents-0.2.5.dist-info → grasp_agents-0.2.7.dist-info}/WHEEL +0 -0
- {grasp_agents-0.2.5.dist-info → grasp_agents-0.2.7.dist-info}/licenses/LICENSE.md +0 -0
grasp_agents/llm_agent.py
CHANGED
@@ -441,8 +441,8 @@ class LLMAgent(
|
|
441
441
|
def _format_in_args(
|
442
442
|
self,
|
443
443
|
*,
|
444
|
-
usr_args: LLMPromptArgs,
|
445
|
-
in_args: InT,
|
444
|
+
usr_args: LLMPromptArgs | None = None,
|
445
|
+
in_args: InT | None = None,
|
446
446
|
batch_idx: int = 0,
|
447
447
|
ctx: RunContextWrapper[CtxT] | None = None,
|
448
448
|
) -> LLMFormattedArgs:
|
grasp_agents/prompt_builder.py
CHANGED
@@ -34,8 +34,8 @@ class FormatInputArgsHandler(Protocol[InT, CtxT]):
|
|
34
34
|
def __call__(
|
35
35
|
self,
|
36
36
|
*,
|
37
|
-
usr_args: LLMPromptArgs,
|
38
|
-
in_args: InT,
|
37
|
+
usr_args: LLMPromptArgs | None,
|
38
|
+
in_args: InT | None,
|
39
39
|
batch_idx: int,
|
40
40
|
ctx: RunContextWrapper[CtxT] | None,
|
41
41
|
) -> LLMFormattedArgs: ...
|
@@ -78,8 +78,8 @@ class PromptBuilder(AutoInstanceAttributesMixin, Generic[InT, CtxT]):
|
|
78
78
|
def _format_in_args(
|
79
79
|
self,
|
80
80
|
*,
|
81
|
-
usr_args: LLMPromptArgs,
|
82
|
-
in_args: InT,
|
81
|
+
usr_args: LLMPromptArgs | None = None,
|
82
|
+
in_args: InT | None = None,
|
83
83
|
batch_idx: int = 0,
|
84
84
|
ctx: RunContextWrapper[CtxT] | None = None,
|
85
85
|
) -> LLMFormattedArgs:
|
@@ -93,7 +93,7 @@ class PromptBuilder(AutoInstanceAttributesMixin, Generic[InT, CtxT]):
|
|
93
93
|
"Cannot apply default formatting to non-BaseModel received arguments."
|
94
94
|
)
|
95
95
|
|
96
|
-
usr_args_ = usr_args
|
96
|
+
usr_args_ = DummySchema() if usr_args is None else usr_args
|
97
97
|
in_args_ = DummySchema() if in_args is None else in_args
|
98
98
|
|
99
99
|
usr_args_dump = usr_args_.model_dump(exclude_unset=True)
|
@@ -149,10 +149,12 @@ class PromptBuilder(AutoInstanceAttributesMixin, Generic[InT, CtxT]):
|
|
149
149
|
usr_args_batch_, in_args_batch_ = self._make_batched(usr_args, in_args_batch)
|
150
150
|
|
151
151
|
val_usr_args_batch_ = [
|
152
|
-
self.usr_args_schema.model_validate(u)
|
152
|
+
self.usr_args_schema.model_validate(u) if u is not None else None
|
153
|
+
for u in usr_args_batch_
|
153
154
|
]
|
154
155
|
val_in_args_batch_ = [
|
155
|
-
self._in_args_type_adapter.validate_python(inp)
|
156
|
+
self._in_args_type_adapter.validate_python(inp) if inp is not None else None
|
157
|
+
for inp in in_args_batch_
|
156
158
|
]
|
157
159
|
|
158
160
|
formatted_in_args_batch = [
|
@@ -220,11 +222,9 @@ class PromptBuilder(AutoInstanceAttributesMixin, Generic[InT, CtxT]):
|
|
220
222
|
self,
|
221
223
|
usr_args: UserRunArgs | None = None,
|
222
224
|
in_args_batch: Sequence[InT] | None = None,
|
223
|
-
) -> tuple[Sequence[LLMPromptArgs |
|
224
|
-
usr_args_batch_ = (
|
225
|
-
|
226
|
-
)
|
227
|
-
in_args_batch_ = in_args_batch or [DummySchema()]
|
225
|
+
) -> tuple[Sequence[LLMPromptArgs | None], Sequence[InT | None]]:
|
226
|
+
usr_args_batch_ = usr_args if isinstance(usr_args, list) else [usr_args]
|
227
|
+
in_args_batch_ = in_args_batch or [None]
|
228
228
|
|
229
229
|
# Broadcast singleton → match lengths
|
230
230
|
if len(usr_args_batch_) == 1 and len(in_args_batch_) > 1:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: grasp_agents
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.7
|
4
4
|
Summary: Grasp Agents Library
|
5
5
|
License-File: LICENSE.md
|
6
6
|
Requires-Python: <4,>=3.11.4
|
@@ -66,7 +66,7 @@ Description-Content-Type: text/markdown
|
|
66
66
|
|
67
67
|
## Quickstart & Installation Variants (UV Package manager)
|
68
68
|
|
69
|
-
> **Note:** You can check this sample project code in the [src/grasp_agents/examples/demo/uv](src/grasp_agents/examples/demo/uv) folder. Feel free to copy and paste the code from there to a separate project. There are also [examples](src/grasp_agents/examples/demo/) for other package managers.
|
69
|
+
> **Note:** You can check this sample project code in the [src/grasp_agents/examples/demo/uv](https://github.com/grasp-technologies/grasp-agents/tree/master/src/grasp_agents/examples/demo/uv) folder. Feel free to copy and paste the code from there to a separate project. There are also [examples](https://github.com/grasp-technologies/grasp-agents/tree/master/src/grasp_agents/examples/demo/) for other package managers.
|
70
70
|
|
71
71
|
#### 1. Prerequisites
|
72
72
|
|
@@ -212,4 +212,4 @@ Run your script:
|
|
212
212
|
uv run problem_recommender.py
|
213
213
|
```
|
214
214
|
|
215
|
-
You can find more examples in [src/grasp_agents/examples/notebooks/agents_demo.ipynb](src/grasp_agents/examples/notebooks/agents_demo.ipynb).
|
215
|
+
You can find more examples in [src/grasp_agents/examples/notebooks/agents_demo.ipynb](https://github.com/grasp-technologies/grasp-agents/tree/master/src/grasp_agents/examples/notebooks/agents_demo.ipynb).
|
@@ -9,11 +9,11 @@ grasp_agents/generics_utils.py,sha256=kw4Odte6Nvl4c9U7-mKPgXCavWZXo009zYDHAA0BR3
|
|
9
9
|
grasp_agents/grasp_logging.py,sha256=H1GYhXdQvVkmauFDZ-KDwvVmPQHZUUm9sRqX_ObK2xI,1111
|
10
10
|
grasp_agents/http_client.py,sha256=KZva2MjJjuI5ohUeU8RdTAImUnQYaqBrV2jDH8smbJw,738
|
11
11
|
grasp_agents/llm.py,sha256=n67lXbB8spr_i3Xz0Plw7oeykfjQmVHHkSiveqBB5Lw,3150
|
12
|
-
grasp_agents/llm_agent.py,sha256=
|
12
|
+
grasp_agents/llm_agent.py,sha256=4uSGJvvs6a-7TqTp8OJAkkHpxDSvVrw1qoMKJYblES8,16130
|
13
13
|
grasp_agents/llm_agent_state.py,sha256=L54zUW5nAT-ubvEB7XNAQ84ExOgRlUFzc-Q49mUXUT0,2390
|
14
14
|
grasp_agents/memory.py,sha256=X1YtVX8XxP5KnGPMW8BqjID8QK4hTG2obxoyhnnZ4pU,5575
|
15
15
|
grasp_agents/printer.py,sha256=ZENcTITCcgSizvcUXnIQiFl_NcVHg-801Z-sbT0D8rg,5030
|
16
|
-
grasp_agents/prompt_builder.py,sha256=
|
16
|
+
grasp_agents/prompt_builder.py,sha256=1KGfRlZwdBHYlukdqV0qzCu0mo-4dk4pjUXVAtArKU4,8508
|
17
17
|
grasp_agents/run_context.py,sha256=4v6IcddHSWUAMYX8M9hQRXNMfPf7gUv45nn_Fb5lLaI,2233
|
18
18
|
grasp_agents/tool_orchestrator.py,sha256=XgKCOytPs4y4SBpS5i4eogCB428XaDnNIB3VxzJC_k0,6095
|
19
19
|
grasp_agents/usage_tracker.py,sha256=4gy0XtfIBAjQHblEFpQuPelmxMGDvE7vw4c8Ccr1msk,3471
|
@@ -40,7 +40,7 @@ grasp_agents/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
|
|
40
40
|
grasp_agents/workflow/looped_agent.py,sha256=5tvlkPyhPdNGVSEaxTNPX0QQfPwP01OpZrvmv4bWXsA,4046
|
41
41
|
grasp_agents/workflow/sequential_agent.py,sha256=SbeAKHCbhMy-2CmQWs1f5VMSRj88MLiAQc76g_ivGvA,2131
|
42
42
|
grasp_agents/workflow/workflow_agent.py,sha256=E6jzfFmdUfCoYehH9ZsAa_MTICjEaP4NGwNxhc3NR_E,2436
|
43
|
-
grasp_agents-0.2.
|
44
|
-
grasp_agents-0.2.
|
45
|
-
grasp_agents-0.2.
|
46
|
-
grasp_agents-0.2.
|
43
|
+
grasp_agents-0.2.7.dist-info/METADATA,sha256=typgobfJqh-odwou3J7-xMDzRpUf1nqIs_VsIQ1sVxk,7187
|
44
|
+
grasp_agents-0.2.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
45
|
+
grasp_agents-0.2.7.dist-info/licenses/LICENSE.md,sha256=-nNNdWqGB8gJ2O-peFQ2Irshv5tW5pHKyTcYkwvH7CE,1201
|
46
|
+
grasp_agents-0.2.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|