grasp_agents 0.5.0__tar.gz → 0.5.2__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.5.0 → grasp_agents-0.5.2}/PKG-INFO +1 -1
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/pyproject.toml +1 -1
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/memory.py +19 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/printer.py +4 -6
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/processor.py +3 -5
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/.gitignore +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/LICENSE.md +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/README.md +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/__init__.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/cloud_llm.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/comm_processor.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/costs_dict.yaml +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/errors.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/generics_utils.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/grasp_logging.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/http_client.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/litellm/__init__.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/litellm/completion_chunk_converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/litellm/completion_converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/litellm/converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/litellm/lite_llm.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/litellm/message_converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/llm.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/llm_agent.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/llm_agent_memory.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/llm_policy_executor.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/openai/__init__.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/openai/completion_chunk_converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/openai/completion_converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/openai/content_converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/openai/converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/openai/message_converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/openai/openai_llm.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/openai/tool_converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/packet.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/packet_pool.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/prompt_builder.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/rate_limiting/__init__.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/rate_limiting/rate_limiter_chunked.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/rate_limiting/types.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/rate_limiting/utils.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/run_context.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/runner.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/typing/__init__.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/typing/completion.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/typing/completion_chunk.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/typing/content.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/typing/converters.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/typing/events.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/typing/io.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/typing/message.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/typing/tool.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/usage_tracker.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/utils.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/workflow/__init__.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/workflow/looped_workflow.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/workflow/sequential_workflow.py +0 -0
- {grasp_agents-0.5.0 → grasp_agents-0.5.2}/src/grasp_agents/workflow/workflow_processor.py +0 -0
@@ -34,3 +34,22 @@ class Memory(BaseModel, ABC):
|
|
34
34
|
return f"{self.__class__.__name__}()"
|
35
35
|
|
36
36
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
37
|
+
|
38
|
+
|
39
|
+
class DummyMemory(Memory):
|
40
|
+
def reset(
|
41
|
+
self, *args: Any, ctx: RunContext[Any] | None = None, **kwargs: Any
|
42
|
+
) -> None:
|
43
|
+
pass
|
44
|
+
|
45
|
+
def erase(self) -> None:
|
46
|
+
pass
|
47
|
+
|
48
|
+
def update(
|
49
|
+
self, *args: Any, ctx: RunContext[Any] | None = None, **kwargs: Any
|
50
|
+
) -> None:
|
51
|
+
pass
|
52
|
+
|
53
|
+
@property
|
54
|
+
def is_empty(self) -> bool:
|
55
|
+
return True
|
@@ -136,9 +136,7 @@ class Printer:
|
|
136
136
|
elif isinstance(message, AssistantMessage):
|
137
137
|
out += f"<response>\n{content}\n</response>\n"
|
138
138
|
else:
|
139
|
-
out +=
|
140
|
-
f"<tool result> [{message.tool_call_id}]{content}\n</tool result>"
|
141
|
-
)
|
139
|
+
out += f"<tool result> [{message.tool_call_id}]\n{content}\n</tool result>\n"
|
142
140
|
|
143
141
|
# Tool calls
|
144
142
|
if isinstance(message, AssistantMessage) and message.tool_calls is not None:
|
@@ -154,7 +152,7 @@ class Printer:
|
|
154
152
|
usage_str += f"/{usage.reasoning_tokens or '-'}"
|
155
153
|
usage_str += f"/{usage.cached_tokens or '-'}"
|
156
154
|
|
157
|
-
out += f"\n------------------------------------\n{usage_str}"
|
155
|
+
out += f"\n------------------------------------\n{usage_str}\n"
|
158
156
|
|
159
157
|
logger.debug(out, **log_kwargs) # type: ignore
|
160
158
|
|
@@ -199,11 +197,11 @@ async def print_event_stream(
|
|
199
197
|
closing_text += "\n</tool call>\n"
|
200
198
|
|
201
199
|
if _thinking_open:
|
202
|
-
closing_text += "</thinking>\n"
|
200
|
+
closing_text += "\n</thinking>\n"
|
203
201
|
_thinking_open = False
|
204
202
|
|
205
203
|
if _response_open:
|
206
|
-
closing_text += "</response>\n"
|
204
|
+
closing_text += "\n</response>\n"
|
207
205
|
_response_open = False
|
208
206
|
|
209
207
|
if closing_text:
|
@@ -10,15 +10,13 @@ from pydantic import ValidationError as PydanticValidationError
|
|
10
10
|
|
11
11
|
from .errors import ProcInputValidationError, ProcOutputValidationError
|
12
12
|
from .generics_utils import AutoInstanceAttributesMixin
|
13
|
-
from .memory import MemT
|
13
|
+
from .memory import DummyMemory, MemT
|
14
14
|
from .packet import Packet
|
15
15
|
from .run_context import CtxT, RunContext
|
16
16
|
from .typing.events import (
|
17
17
|
Event,
|
18
|
-
# ProcFinishEvent,
|
19
18
|
ProcPacketOutputEvent,
|
20
19
|
ProcPayloadOutputEvent,
|
21
|
-
# ProcStartEvent,
|
22
20
|
ProcStreamingErrorData,
|
23
21
|
ProcStreamingErrorEvent,
|
24
22
|
)
|
@@ -42,7 +40,7 @@ class Processor(AutoInstanceAttributesMixin, ABC, Generic[InT, OutT_co, MemT, Ct
|
|
42
40
|
super().__init__()
|
43
41
|
|
44
42
|
self._name: ProcName = name
|
45
|
-
self._memory: MemT
|
43
|
+
self._memory: MemT = cast("MemT", DummyMemory())
|
46
44
|
self._max_retries: int = max_retries
|
47
45
|
|
48
46
|
@property
|
@@ -176,6 +174,7 @@ class Processor(AutoInstanceAttributesMixin, ABC, Generic[InT, OutT_co, MemT, Ct
|
|
176
174
|
chat_inputs=chat_inputs, in_packet=in_packet, in_args=in_args
|
177
175
|
)
|
178
176
|
_memory = self.memory.model_copy(deep=True) if forgetful else self.memory
|
177
|
+
|
179
178
|
outputs = await self._process(
|
180
179
|
chat_inputs=chat_inputs,
|
181
180
|
in_args=resolved_in_args,
|
@@ -292,7 +291,6 @@ class Processor(AutoInstanceAttributesMixin, ABC, Generic[InT, OutT_co, MemT, Ct
|
|
292
291
|
resolved_in_args = self._validate_and_resolve_single_input(
|
293
292
|
chat_inputs=chat_inputs, in_packet=in_packet, in_args=in_args
|
294
293
|
)
|
295
|
-
|
296
294
|
_memory = self.memory.model_copy(deep=True) if forgetful else self.memory
|
297
295
|
|
298
296
|
outputs: list[OutT_co] = []
|
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.5.0 → grasp_agents-0.5.2}/src/grasp_agents/litellm/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
|
{grasp_agents-0.5.0 → grasp_agents-0.5.2}/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
|
{grasp_agents-0.5.0 → grasp_agents-0.5.2}/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
|
File without changes
|
File without changes
|