grasp_agents 0.4.3__tar.gz → 0.4.6__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.
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/PKG-INFO +1 -1
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/pyproject.toml +1 -1
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/processor.py +3 -1
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/utils.py +18 -6
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/.gitignore +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/LICENSE.md +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/README.md +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/__init__.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/cloud_llm.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/comm_processor.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/costs_dict.yaml +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/errors.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/generics_utils.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/grasp_logging.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/http_client.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/llm.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/llm_agent.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/llm_agent_memory.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/llm_policy_executor.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/memory.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/openai/__init__.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/openai/completion_chunk_converters.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/openai/completion_converters.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/openai/content_converters.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/openai/converters.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/openai/message_converters.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/openai/openai_llm.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/openai/tool_converters.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/packet.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/packet_pool.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/printer.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/prompt_builder.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/rate_limiting/__init__.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/rate_limiting/rate_limiter_chunked.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/rate_limiting/types.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/rate_limiting/utils.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/run_context.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/typing/__init__.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/typing/completion.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/typing/completion_chunk.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/typing/content.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/typing/converters.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/typing/events.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/typing/io.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/typing/message.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/typing/tool.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/usage_tracker.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/workflow/__init__.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/workflow/looped_workflow.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/workflow/sequential_workflow.py +0 -0
- {grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/workflow/workflow_processor.py +0 -0
@@ -245,7 +245,9 @@ class Processor(AutoInstanceAttributesMixin, ABC, Generic[InT, OutT_co, MemT, Ct
|
|
245
245
|
run_id: str | None = None,
|
246
246
|
ctx: RunContext[CtxT] | None = None,
|
247
247
|
) -> Packet[OutT_co]:
|
248
|
-
if isinstance(in_args, Sequence)
|
248
|
+
if (in_args is not None and isinstance(in_args, Sequence)) or (
|
249
|
+
in_packet is not None and len(in_packet.payloads) > 1
|
250
|
+
):
|
249
251
|
return await self._run_par(
|
250
252
|
chat_inputs=chat_inputs,
|
251
253
|
in_packet=in_packet,
|
@@ -90,10 +90,18 @@ def validate_obj_from_json_or_py_string(
|
|
90
90
|
strip_language_markdown: bool = True,
|
91
91
|
) -> T | str:
|
92
92
|
_selected_adapter: TypeAdapter[T] | None = None
|
93
|
+
_selected_tag: str | None = None
|
94
|
+
s_orig = s
|
95
|
+
|
93
96
|
if isinstance(adapter, Mapping):
|
94
|
-
for
|
95
|
-
|
96
|
-
|
97
|
+
for _tag, _adapter in adapter.items():
|
98
|
+
match = re.search(rf"<{_tag}>\s*(.*?)\s*</{_tag}>", s, re.DOTALL)
|
99
|
+
if not match:
|
100
|
+
continue
|
101
|
+
s = match.group(1).strip()
|
102
|
+
_selected_adapter = _adapter
|
103
|
+
_selected_tag = _tag
|
104
|
+
break
|
97
105
|
if _selected_adapter is None:
|
98
106
|
return s
|
99
107
|
else:
|
@@ -126,9 +134,12 @@ def validate_obj_from_json_or_py_string(
|
|
126
134
|
parsed = s
|
127
135
|
return _selected_adapter.validate_python(parsed)
|
128
136
|
except ValidationError as exc:
|
129
|
-
|
130
|
-
|
131
|
-
|
137
|
+
err_message = f"Invalid JSON or Python string:\n{s_orig}"
|
138
|
+
if _selected_tag:
|
139
|
+
err_message += f"\nExpected type {_type} within tag <{_selected_tag}>"
|
140
|
+
else:
|
141
|
+
err_message += f"\nExpected type {_type}"
|
142
|
+
raise OutputValidationError(err_message) from exc
|
132
143
|
|
133
144
|
|
134
145
|
def extract_xml_list(text: str) -> list[str]:
|
@@ -170,6 +181,7 @@ async def asyncio_gather_with_pbar(
|
|
170
181
|
no_tqdm: bool = False,
|
171
182
|
desc: str | None = None,
|
172
183
|
) -> list[Any]:
|
184
|
+
# TODO: optimize
|
173
185
|
pbar = tqdm(total=len(corouts), desc=desc, disable=no_tqdm)
|
174
186
|
|
175
187
|
async def run_and_update(coro: Coroutine[Any, Any, Any]) -> Any:
|
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
|
{grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/openai/completion_chunk_converters.py
RENAMED
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
|
{grasp_agents-0.4.3 → grasp_agents-0.4.6}/src/grasp_agents/rate_limiting/rate_limiter_chunked.py
RENAMED
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
|