dm-aioaiagent 0.3.1__tar.gz → 0.3.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.
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/PKG-INFO +1 -1
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/dm_aioaiagent/ai_agent.py +14 -3
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/dm_aioaiagent.egg-info/PKG-INFO +1 -1
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/setup.py +1 -1
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/README.md +0 -0
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/dm_aioaiagent/__init__.py +0 -0
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/dm_aioaiagent/async_ai_agent.py +0 -0
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/dm_aioaiagent/types.py +0 -0
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/dm_aioaiagent.egg-info/SOURCES.txt +0 -0
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/dm_aioaiagent.egg-info/dependency_links.txt +0 -0
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/dm_aioaiagent.egg-info/requires.txt +0 -0
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/dm_aioaiagent.egg-info/top_level.txt +0 -0
- {dm_aioaiagent-0.3.1 → dm_aioaiagent-0.3.2}/setup.cfg +0 -0
|
@@ -16,7 +16,7 @@ __all__ = ["DMAIAgent"]
|
|
|
16
16
|
class DMAIAgent:
|
|
17
17
|
agent_name = "AIAgent"
|
|
18
18
|
_allowed_roles = ("user", "ai")
|
|
19
|
-
MAX_MEMORY_MESSAGES = 20
|
|
19
|
+
MAX_MEMORY_MESSAGES = 20 # Only INT greater than 0
|
|
20
20
|
|
|
21
21
|
def __init__(
|
|
22
22
|
self,
|
|
@@ -67,8 +67,19 @@ class DMAIAgent:
|
|
|
67
67
|
state = self._graph.invoke({"input_messages": input_messages, "memory_id": memory_id})
|
|
68
68
|
return state["response"]
|
|
69
69
|
|
|
70
|
-
def get_memory_messages(
|
|
71
|
-
|
|
70
|
+
def get_memory_messages(
|
|
71
|
+
self,
|
|
72
|
+
memory_id: str = None,
|
|
73
|
+
*,
|
|
74
|
+
without_tool_m: bool = False,
|
|
75
|
+
return_str_m: bool = False
|
|
76
|
+
) -> Union[list[BaseMessage], list[str]]:
|
|
77
|
+
messages = self._memory.get(self._validate_memory_id(memory_id), [])
|
|
78
|
+
if without_tool_m:
|
|
79
|
+
messages = [m for m in messages if not (m.type == "tool" or (m.type == "ai" and m.tool_calls))]
|
|
80
|
+
if return_str_m:
|
|
81
|
+
messages = [m.content for m in messages]
|
|
82
|
+
return messages
|
|
72
83
|
|
|
73
84
|
def clear_memory(self, memory_id: str = None) -> None:
|
|
74
85
|
self._memory[self._validate_memory_id(memory_id)] = []
|
|
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
|