dm-aioaiagent 0.3.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dm-aioaiagent
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: This is my custom aioaiagent client
5
5
  Home-page: https://pypi.org/project/dm-aioaiagent
6
6
  Author: dimka4621
@@ -12,14 +12,14 @@ Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Operating System :: OS Independent
13
13
  Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: dm-logger==0.5.2
16
- Requires-Dist: python-dotenv==1.0.1
17
- Requires-Dist: pydantic==2.9.2
18
- Requires-Dist: langchain==0.3.0
19
- Requires-Dist: langchain-core==0.3.5
20
- Requires-Dist: langgraph==0.2.23
21
- Requires-Dist: langchain-community==0.3.0
22
- Requires-Dist: langchain-openai==0.2.0
15
+ Requires-Dist: dm-logger~=0.5.2
16
+ Requires-Dist: python-dotenv>=1.0.0
17
+ Requires-Dist: pydantic<3.0.0,>=2.9.2
18
+ Requires-Dist: langchain~=0.3.0
19
+ Requires-Dist: langchain-core~=0.3.5
20
+ Requires-Dist: langgraph~=0.2.23
21
+ Requires-Dist: langchain-community~=0.3.0
22
+ Requires-Dist: langchain-openai~=0.2.0
23
23
 
24
24
  # DM-aioaiagent
25
25
 
@@ -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 # Only INT greater than 0
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(self, memory_id: str = None) -> list[BaseMessage]:
71
- return self._memory.get(self._validate_memory_id(memory_id), [])
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)] = []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dm-aioaiagent
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: This is my custom aioaiagent client
5
5
  Home-page: https://pypi.org/project/dm-aioaiagent
6
6
  Author: dimka4621
@@ -12,14 +12,14 @@ Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Operating System :: OS Independent
13
13
  Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: dm-logger==0.5.2
16
- Requires-Dist: python-dotenv==1.0.1
17
- Requires-Dist: pydantic==2.9.2
18
- Requires-Dist: langchain==0.3.0
19
- Requires-Dist: langchain-core==0.3.5
20
- Requires-Dist: langgraph==0.2.23
21
- Requires-Dist: langchain-community==0.3.0
22
- Requires-Dist: langchain-openai==0.2.0
15
+ Requires-Dist: dm-logger~=0.5.2
16
+ Requires-Dist: python-dotenv>=1.0.0
17
+ Requires-Dist: pydantic<3.0.0,>=2.9.2
18
+ Requires-Dist: langchain~=0.3.0
19
+ Requires-Dist: langchain-core~=0.3.5
20
+ Requires-Dist: langgraph~=0.2.23
21
+ Requires-Dist: langchain-community~=0.3.0
22
+ Requires-Dist: langchain-openai~=0.2.0
23
23
 
24
24
  # DM-aioaiagent
25
25
 
@@ -0,0 +1,8 @@
1
+ dm-logger~=0.5.2
2
+ python-dotenv>=1.0.0
3
+ pydantic<3.0.0,>=2.9.2
4
+ langchain~=0.3.0
5
+ langchain-core~=0.3.5
6
+ langgraph~=0.2.23
7
+ langchain-community~=0.3.0
8
+ langchain-openai~=0.2.0
@@ -8,7 +8,7 @@ def readme():
8
8
 
9
9
  setup(
10
10
  name='dm-aioaiagent',
11
- version='v0.3.0',
11
+ version='v0.3.2',
12
12
  author='dimka4621',
13
13
  author_email='mismartconfig@gmail.com',
14
14
  description='This is my custom aioaiagent client',
@@ -17,14 +17,14 @@ setup(
17
17
  url='https://pypi.org/project/dm-aioaiagent',
18
18
  packages=find_packages(),
19
19
  install_requires=[
20
- 'dm-logger==0.5.2',
21
- 'python-dotenv==1.0.1',
22
- 'pydantic==2.9.2',
23
- 'langchain==0.3.0',
24
- 'langchain-core==0.3.5',
25
- 'langgraph==0.2.23',
26
- 'langchain-community==0.3.0',
27
- 'langchain-openai==0.2.0',
20
+ 'dm-logger~=0.5.2',
21
+ 'python-dotenv>=1.0.0',
22
+ 'pydantic>=2.9.2, < 3.0.0',
23
+ 'langchain~=0.3.0',
24
+ 'langchain-core~=0.3.5',
25
+ 'langgraph~=0.2.23',
26
+ 'langchain-community~=0.3.0',
27
+ 'langchain-openai~=0.2.0',
28
28
  ],
29
29
  classifiers=[
30
30
  'Programming Language :: Python :: 3.8',
@@ -1,8 +0,0 @@
1
- dm-logger==0.5.2
2
- python-dotenv==1.0.1
3
- pydantic==2.9.2
4
- langchain==0.3.0
5
- langchain-core==0.3.5
6
- langgraph==0.2.23
7
- langchain-community==0.3.0
8
- langchain-openai==0.2.0
File without changes
File without changes