agentx-dev 2.0__tar.gz → 2.3__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.4
2
2
  Name: agentx-dev
3
- Version: 2.0
3
+ Version: 2.3
4
4
  Summary: A lightweight LLM agent framework with standard and structured tool support use, prompt management, and support for OpenAI.
5
5
  Author-email: Bruce-Arhin Shadrach <brucearhin098@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/shadrach098/Bruce_framework
@@ -32,15 +32,15 @@ Requires-Dist: PyYAML>=5.3.1
32
32
  published to PyPI:
33
33
 
34
34
  ```sh
35
- pip install AgentX-Dev
35
+ pip install agentx-dev==2.3
36
36
  ```
37
37
 
38
38
  ## Example use
39
39
 
40
40
  ```python
41
- from AgentXL import AgentRunner, AgentType,ChatModel
41
+ from agentx_dev import AgentRunner, AgentType,ChatModel
42
42
  from pydantic import BaseModel
43
- from AgentXL.Tools import StructuredTool,StandardTool
43
+ from agentx_dev.Tools import StructuredTool,StandardTool
44
44
  # Define a sample Stuctured tool
45
45
  class MultiplyTool(BaseModel):
46
46
  a: int
@@ -68,7 +68,7 @@ tools = [StructuredTool(name="MultiplyTool",
68
68
  agent = AgentRunner(model=chat_model,Agent=ReAct, tools=tools)
69
69
 
70
70
  # Initialize the agent with user input
71
- response = agent.Initialize("What is 5 times 8?")
71
+ response = agent.Initialize("What is 5 times 8?",ChatHistory=[{'role':"assistant",'content':'hello there how is it going'}])
72
72
 
73
73
  # Print the result
74
74
  print(response.content)
@@ -81,8 +81,8 @@ agent.Initialize("i need the weather in Barrie")
81
81
  ```
82
82
 
83
83
  ``` bruce_framework/
84
- ├── src/
85
- │ └── bruce_framework/
84
+
85
+ ├──agentx_dev/
86
86
  │ ├── __init__.py
87
87
  │ ├── agent/
88
88
  │ │ ├── __init__.py
@@ -110,3 +110,5 @@ MIT License
110
110
 
111
111
 
112
112
 
113
+
114
+
@@ -16,15 +16,15 @@
16
16
  published to PyPI:
17
17
 
18
18
  ```sh
19
- pip install AgentX-Dev
19
+ pip install agentx-dev==2.3
20
20
  ```
21
21
 
22
22
  ## Example use
23
23
 
24
24
  ```python
25
- from AgentXL import AgentRunner, AgentType,ChatModel
25
+ from agentx_dev import AgentRunner, AgentType,ChatModel
26
26
  from pydantic import BaseModel
27
- from AgentXL.Tools import StructuredTool,StandardTool
27
+ from agentx_dev.Tools import StructuredTool,StandardTool
28
28
  # Define a sample Stuctured tool
29
29
  class MultiplyTool(BaseModel):
30
30
  a: int
@@ -52,7 +52,7 @@ tools = [StructuredTool(name="MultiplyTool",
52
52
  agent = AgentRunner(model=chat_model,Agent=ReAct, tools=tools)
53
53
 
54
54
  # Initialize the agent with user input
55
- response = agent.Initialize("What is 5 times 8?")
55
+ response = agent.Initialize("What is 5 times 8?",ChatHistory=[{'role':"assistant",'content':'hello there how is it going'}])
56
56
 
57
57
  # Print the result
58
58
  print(response.content)
@@ -65,8 +65,8 @@ agent.Initialize("i need the weather in Barrie")
65
65
  ```
66
66
 
67
67
  ``` bruce_framework/
68
- ├── src/
69
- │ └── bruce_framework/
68
+
69
+ ├──agentx_dev/
70
70
  │ ├── __init__.py
71
71
  │ ├── agent/
72
72
  │ │ ├── __init__.py
@@ -94,3 +94,5 @@ MIT License
94
94
 
95
95
 
96
96
 
97
+
98
+
@@ -1,7 +1,7 @@
1
- from AgentXL.Agents import AgentFormattor,AgentCompletion,AgentPrompt
2
- from AgentXL.ChatModel import BaseChatModel
3
- from AgentXL.Agents.Agent import StandardParser,ToolCall
4
- from AgentXL.Tools import StandardTool,StructuredTool,logger
1
+ from agentx_dev.Agents import AgentFormattor,AgentCompletion,AgentPrompt
2
+ from agentx_dev.ChatModel import BaseChatModel
3
+ from agentx_dev.Agents.Agent import StandardParser,ToolCall
4
+ from agentx_dev.Tools import StandardTool,StructuredTool,logger
5
5
  from typing import Dict, Callable, List, Type, Optional
6
6
  from pydantic import BaseModel,Field
7
7
 
@@ -197,7 +197,7 @@ class AgentRunner:
197
197
  logger.warning(f"Tool '{tool_name}' not found. Available tools: {list(self.func.keys()) + list(self.args.keys())}")
198
198
  return f"Error: Tool '{tool_name}' not found. Please double-check the tool name."
199
199
 
200
- def Initialize(self, user_input: str)-> AgentCompletion:
200
+ def Initialize(self, user_input: str,ChatHistory:Optional[List[Dict[str,str]]]=None)-> AgentCompletion:
201
201
 
202
202
 
203
203
  """
@@ -217,7 +217,13 @@ class AgentRunner:
217
217
 
218
218
  if not any(entry["role"] == "system" for entry in self.history):
219
219
  self.history.append({"role": "system", "content": self.format_prompt})
220
-
220
+ if ChatHistory and isinstance(ChatHistory,List[Dict[str,str]]):
221
+ for r in ChatHistory:
222
+ if r.role and r.content:
223
+ self.history.append({'role':r.role,'content':r.content + r.timestamp if r.get('timestamp') else r.content})
224
+
225
+
226
+
221
227
  self.history.append({"role":"user","content":self.Query})
222
228
 
223
229
  # logger.info to announce the start of the process.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentx-dev
3
- Version: 2.0
3
+ Version: 2.3
4
4
  Summary: A lightweight LLM agent framework with standard and structured tool support use, prompt management, and support for OpenAI.
5
5
  Author-email: Bruce-Arhin Shadrach <brucearhin098@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/shadrach098/Bruce_framework
@@ -32,15 +32,15 @@ Requires-Dist: PyYAML>=5.3.1
32
32
  published to PyPI:
33
33
 
34
34
  ```sh
35
- pip install AgentX-Dev
35
+ pip install agentx-dev==2.3
36
36
  ```
37
37
 
38
38
  ## Example use
39
39
 
40
40
  ```python
41
- from AgentXL import AgentRunner, AgentType,ChatModel
41
+ from agentx_dev import AgentRunner, AgentType,ChatModel
42
42
  from pydantic import BaseModel
43
- from AgentXL.Tools import StructuredTool,StandardTool
43
+ from agentx_dev.Tools import StructuredTool,StandardTool
44
44
  # Define a sample Stuctured tool
45
45
  class MultiplyTool(BaseModel):
46
46
  a: int
@@ -68,7 +68,7 @@ tools = [StructuredTool(name="MultiplyTool",
68
68
  agent = AgentRunner(model=chat_model,Agent=ReAct, tools=tools)
69
69
 
70
70
  # Initialize the agent with user input
71
- response = agent.Initialize("What is 5 times 8?")
71
+ response = agent.Initialize("What is 5 times 8?",ChatHistory=[{'role':"assistant",'content':'hello there how is it going'}])
72
72
 
73
73
  # Print the result
74
74
  print(response.content)
@@ -81,8 +81,8 @@ agent.Initialize("i need the weather in Barrie")
81
81
  ```
82
82
 
83
83
  ``` bruce_framework/
84
- ├── src/
85
- │ └── bruce_framework/
84
+
85
+ ├──agentx_dev/
86
86
  │ ├── __init__.py
87
87
  │ ├── agent/
88
88
  │ │ ├── __init__.py
@@ -110,3 +110,5 @@ MIT License
110
110
 
111
111
 
112
112
 
113
+
114
+
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
 
3
3
  name = "agentx-dev"
4
- version = "2.0"
4
+ version = "2.3"
5
5
  description = "A lightweight LLM agent framework with standard and structured tool support use, prompt management, and support for OpenAI."
6
6
  authors = [{ name = "Bruce-Arhin Shadrach", email = "brucearhin098@gmail.com" }]
7
7
  # Best practice: link to the license file
File without changes
File without changes
File without changes