agenticaiframework 1.0.25__py3-none-any.whl → 1.0.27__py3-none-any.whl
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.
- agenticaiframework/communication.py +17 -0
- agenticaiframework/guardrails.py +8 -0
- agenticaiframework/hub.py +10 -0
- agenticaiframework/knowledge.py +6 -0
- agenticaiframework/mcp_tools.py +9 -0
- agenticaiframework/memory.py +9 -0
- agenticaiframework/monitoring.py +4 -0
- agenticaiframework/processes.py +4 -0
- agenticaiframework/prompts.py +15 -3
- agenticaiframework/tasks.py +15 -0
- {agenticaiframework-1.0.25.dist-info → agenticaiframework-1.0.27.dist-info}/METADATA +1 -1
- agenticaiframework-1.0.27.dist-info/RECORD +20 -0
- agenticaiframework-1.0.25.dist-info/RECORD +0 -20
- {agenticaiframework-1.0.25.dist-info → agenticaiframework-1.0.27.dist-info}/WHEEL +0 -0
- {agenticaiframework-1.0.25.dist-info → agenticaiframework-1.0.27.dist-info}/licenses/LICENSE +0 -0
- {agenticaiframework-1.0.25.dist-info → agenticaiframework-1.0.27.dist-info}/top_level.txt +0 -0
@@ -10,6 +10,11 @@ class CommunicationManager:
|
|
10
10
|
self.protocols[name] = handler_fn
|
11
11
|
self._log(f"Registered communication protocol '{name}'")
|
12
12
|
|
13
|
+
def register_handler(self, handler_fn: Callable[[Any], Any], name: str = None):
|
14
|
+
"""Alternative method for registering handlers - alias for register_protocol"""
|
15
|
+
protocol_name = name or f"handler_{len(self.protocols)}"
|
16
|
+
self.register_protocol(protocol_name, handler_fn)
|
17
|
+
|
13
18
|
def send(self, protocol: str, data: Any):
|
14
19
|
if protocol in self.protocols:
|
15
20
|
try:
|
@@ -23,5 +28,17 @@ class CommunicationManager:
|
|
23
28
|
def list_protocols(self):
|
24
29
|
return list(self.protocols.keys())
|
25
30
|
|
31
|
+
def send_message(self, message: Any, protocol: str = None):
|
32
|
+
"""Send a message using the first available protocol or specified protocol"""
|
33
|
+
if protocol:
|
34
|
+
return self.send(protocol, message)
|
35
|
+
elif self.protocols:
|
36
|
+
# Use the first available protocol
|
37
|
+
first_protocol = next(iter(self.protocols))
|
38
|
+
return self.send(first_protocol, message)
|
39
|
+
else:
|
40
|
+
self._log("No protocols available to send message")
|
41
|
+
return None
|
42
|
+
|
26
43
|
def _log(self, message: str):
|
27
44
|
print(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] [CommunicationManager] {message}")
|
agenticaiframework/guardrails.py
CHANGED
@@ -41,5 +41,13 @@ class GuardrailManager:
|
|
41
41
|
return False
|
42
42
|
return True
|
43
43
|
|
44
|
+
def validate(self, guardrail_name: str, data: Any) -> bool:
|
45
|
+
"""Validate data against a specific guardrail by name"""
|
46
|
+
for guardrail in self.guardrails.values():
|
47
|
+
if guardrail.name == guardrail_name:
|
48
|
+
return guardrail.validate(data)
|
49
|
+
self._log(f"Guardrail '{guardrail_name}' not found")
|
50
|
+
return False
|
51
|
+
|
44
52
|
def _log(self, message: str):
|
45
53
|
print(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] [GuardrailManager] {message}")
|
agenticaiframework/hub.py
CHANGED
@@ -9,6 +9,7 @@ class Hub:
|
|
9
9
|
self.tools: Dict[str, Any] = {}
|
10
10
|
self.guardrails: Dict[str, Any] = {}
|
11
11
|
self.llms: Dict[str, Any] = {}
|
12
|
+
self.services: Dict[str, Any] = {}
|
12
13
|
|
13
14
|
def register(self, category: str, name: str, item: Any):
|
14
15
|
if hasattr(self, category):
|
@@ -17,6 +18,15 @@ class Hub:
|
|
17
18
|
else:
|
18
19
|
self._log(f"Invalid category '{category}'")
|
19
20
|
|
21
|
+
def register_service(self, name: str, service: Any):
|
22
|
+
"""Register a service in the hub"""
|
23
|
+
self.services[name] = service
|
24
|
+
self._log(f"Registered service '{name}'")
|
25
|
+
|
26
|
+
def get_service(self, name: str) -> Any:
|
27
|
+
"""Get a service by name"""
|
28
|
+
return self.services.get(name)
|
29
|
+
|
20
30
|
def get(self, category: str, name: str) -> Any:
|
21
31
|
if hasattr(self, category):
|
22
32
|
return getattr(self, category).get(name)
|
agenticaiframework/knowledge.py
CHANGED
@@ -6,11 +6,17 @@ class KnowledgeRetriever:
|
|
6
6
|
def __init__(self):
|
7
7
|
self.sources: Dict[str, Callable[[str], List[Dict[str, Any]]]] = {}
|
8
8
|
self.cache: Dict[str, Any] = {}
|
9
|
+
self.knowledge_base: Dict[str, str] = {} # Simple in-memory knowledge store
|
9
10
|
|
10
11
|
def register_source(self, name: str, retrieval_fn: Callable[[str], List[Dict[str, Any]]]):
|
11
12
|
self.sources[name] = retrieval_fn
|
12
13
|
self._log(f"Registered knowledge source '{name}'")
|
13
14
|
|
15
|
+
def add_knowledge(self, key: str, content: str):
|
16
|
+
"""Add knowledge to the internal knowledge base"""
|
17
|
+
self.knowledge_base[key] = content
|
18
|
+
self._log(f"Added knowledge for key '{key}'")
|
19
|
+
|
14
20
|
def retrieve(self, query: str, use_cache: bool = True) -> List[Dict[str, Any]]:
|
15
21
|
if use_cache and query in self.cache:
|
16
22
|
self._log(f"Cache hit for query '{query}'")
|
agenticaiframework/mcp_tools.py
CHANGED
@@ -44,5 +44,14 @@ class MCPToolManager:
|
|
44
44
|
self._log(f"Tool with ID {tool_id} not found")
|
45
45
|
return None
|
46
46
|
|
47
|
+
def execute_tool_by_name(self, tool_name: str, *args, **kwargs):
|
48
|
+
"""Execute a tool by its name instead of ID"""
|
49
|
+
for tool in self.tools.values():
|
50
|
+
if tool.name == tool_name:
|
51
|
+
self._log(f"Executing MCP tool '{tool.name}'")
|
52
|
+
return tool.execute(*args, **kwargs)
|
53
|
+
self._log(f"Tool with name '{tool_name}' not found")
|
54
|
+
return None
|
55
|
+
|
47
56
|
def _log(self, message: str):
|
48
57
|
print(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] [MCPToolManager] {message}")
|
agenticaiframework/memory.py
CHANGED
@@ -12,6 +12,15 @@ class MemoryManager:
|
|
12
12
|
self.short_term[key] = value
|
13
13
|
self._log(f"Stored short-term memory: {key}")
|
14
14
|
|
15
|
+
def store(self, key: str, value: Any, memory_type: str = "short_term"):
|
16
|
+
"""Generic store method that defaults to short-term memory"""
|
17
|
+
if memory_type == "long_term":
|
18
|
+
self.store_long_term(key, value)
|
19
|
+
elif memory_type == "external":
|
20
|
+
self.store_external(key, value)
|
21
|
+
else:
|
22
|
+
self.store_short_term(key, value)
|
23
|
+
|
15
24
|
def store_long_term(self, key: str, value: Any):
|
16
25
|
self.long_term[key] = value
|
17
26
|
self._log(f"Stored long-term memory: {key}")
|
agenticaiframework/monitoring.py
CHANGED
@@ -31,5 +31,9 @@ class MonitoringSystem:
|
|
31
31
|
def get_logs(self) -> List[str]:
|
32
32
|
return self.logs
|
33
33
|
|
34
|
+
def get_metrics(self) -> Dict[str, Any]:
|
35
|
+
"""Get all recorded metrics"""
|
36
|
+
return self.metrics.copy()
|
37
|
+
|
34
38
|
def _log(self, message: str):
|
35
39
|
self.log_message(f"[MonitoringSystem] {message}")
|
agenticaiframework/processes.py
CHANGED
@@ -13,6 +13,10 @@ class Process:
|
|
13
13
|
self.tasks.append((task_callable, args, kwargs))
|
14
14
|
self._log(f"Added task {task_callable.__name__}")
|
15
15
|
|
16
|
+
def add_step(self, step_callable: Callable, *args, **kwargs):
|
17
|
+
"""Alias for add_task - add a step to the process"""
|
18
|
+
self.add_task(step_callable, *args, **kwargs)
|
19
|
+
|
16
20
|
def execute(self):
|
17
21
|
self.status = "running"
|
18
22
|
self._log(f"Executing process '{self.name}' with strategy '{self.strategy}'")
|
agenticaiframework/prompts.py
CHANGED
@@ -18,9 +18,21 @@ class PromptManager:
|
|
18
18
|
def __init__(self):
|
19
19
|
self.prompts: Dict[str, Prompt] = {}
|
20
20
|
|
21
|
-
def register_prompt(self,
|
22
|
-
|
23
|
-
|
21
|
+
def register_prompt(self, prompt_or_name, prompt_obj=None):
|
22
|
+
if isinstance(prompt_or_name, Prompt):
|
23
|
+
# Original behavior: register a Prompt object
|
24
|
+
prompt = prompt_or_name
|
25
|
+
self.prompts[prompt.id] = prompt
|
26
|
+
self._log(f"Registered prompt with ID {prompt.id}")
|
27
|
+
elif isinstance(prompt_or_name, str) and prompt_obj is not None:
|
28
|
+
# New behavior: register with a name and Prompt object
|
29
|
+
prompt = prompt_obj
|
30
|
+
prompt.metadata = prompt.metadata or {}
|
31
|
+
prompt.metadata['name'] = prompt_or_name
|
32
|
+
self.prompts[prompt.id] = prompt
|
33
|
+
self._log(f"Registered prompt '{prompt_or_name}' with ID {prompt.id}")
|
34
|
+
else:
|
35
|
+
self._log("Invalid arguments for register_prompt")
|
24
36
|
|
25
37
|
def get_prompt(self, prompt_id: str) -> Prompt:
|
26
38
|
return self.prompts.get(prompt_id)
|
agenticaiframework/tasks.py
CHANGED
@@ -55,5 +55,20 @@ class TaskManager:
|
|
55
55
|
results[task_id] = task.run()
|
56
56
|
return results
|
57
57
|
|
58
|
+
def execute_task(self, task_name_or_id: str):
|
59
|
+
"""Execute a task by name or ID"""
|
60
|
+
# Try to find by ID first
|
61
|
+
task = self.get_task(task_name_or_id)
|
62
|
+
if task:
|
63
|
+
return task.run()
|
64
|
+
|
65
|
+
# If not found by ID, try to find by name
|
66
|
+
for task in self.tasks.values():
|
67
|
+
if task.name == task_name_or_id:
|
68
|
+
return task.run()
|
69
|
+
|
70
|
+
self._log(f"Task '{task_name_or_id}' not found")
|
71
|
+
return None
|
72
|
+
|
58
73
|
def _log(self, message: str):
|
59
74
|
print(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] [TaskManager] {message}")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: agenticaiframework
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.27
|
4
4
|
Summary: AgenticAI - A Python SDK for building agentic applications with advanced orchestration, monitoring, and multimodal capabilities.
|
5
5
|
Home-page: https://github.com/isathish/AgenticAI
|
6
6
|
Author: Sathishkumar Nagarajan
|
@@ -0,0 +1,20 @@
|
|
1
|
+
agenticaiframework/__init__.py,sha256=Bk5u9D1FnUkZXtxvkQudCNQTSrcYfNGcjAq8NVzzcp8,1026
|
2
|
+
agenticaiframework/agents.py,sha256=gSdEzgUeme9jrKZVaLrBwSM5S--DTVsR3GMNt3XSBc0,1896
|
3
|
+
agenticaiframework/communication.py,sha256=eyqy4-vu3D8_6jHPmE3SgIrEgrlHZhAggKwZlAI0nXs,1710
|
4
|
+
agenticaiframework/configurations.py,sha256=BFWyMWSc8dWrXGGE9twntQZrTyn2L_jUiH1MeSQgdVM,1155
|
5
|
+
agenticaiframework/evaluation.py,sha256=aDsCmcYq84RLAXfWmydt6q0-GGyuYniO0L4A9AdE6qE,1090
|
6
|
+
agenticaiframework/guardrails.py,sha256=qCNb1mmGkAj2S7lDuTp00AP-PIoqCWUkrVR8rHhrdDc,1914
|
7
|
+
agenticaiframework/hub.py,sha256=CXal8SYqmu5k9291gPaBbkuqgb4EcXVpR47b21zNKS4,1585
|
8
|
+
agenticaiframework/knowledge.py,sha256=gcPAYEC_3iCErsPsIpzSJficzjLWN0OQsnofJ28fRvc,1596
|
9
|
+
agenticaiframework/llms.py,sha256=BlW386KDKqtc7iyeUmrQR_-zpIkn2aIKIr6-AK4oJrY,1217
|
10
|
+
agenticaiframework/mcp_tools.py,sha256=QoquKZKLtbt9aongt8aiYwZj4PIqTKyrZo2JhZ7qXHI,1935
|
11
|
+
agenticaiframework/memory.py,sha256=GFUmDQEuKwVlKnxhAzj4ymtUyLAKkUc0zD1WlA0sQbQ,1750
|
12
|
+
agenticaiframework/monitoring.py,sha256=Fn_ajaFWIRucKffFHc4gzxmmFKUJYL1E2DA_8MQYBbo,1252
|
13
|
+
agenticaiframework/processes.py,sha256=A4HPi9dZAAY2HaXmgDUp8Wggmy8E4iD2BRq-RLLvGh0,2085
|
14
|
+
agenticaiframework/prompts.py,sha256=UwMUVAcI-GIGrpmJXjsk5_KeOR8x6VcgmW3DgatIw3A,2046
|
15
|
+
agenticaiframework/tasks.py,sha256=IY1HHSzYK10jXS72Ll-1lROeQRmpWG2a_ovgYU05uws,2336
|
16
|
+
agenticaiframework-1.0.27.dist-info/licenses/LICENSE,sha256=fKYjpVuxF75tWQhzLkN90tDG4knIjDZKUMiPJbKWxIw,1079
|
17
|
+
agenticaiframework-1.0.27.dist-info/METADATA,sha256=8CpjWa03_MUR1V2DB7h8_IWhCl9O2AHSbvLcs2Ke9Jc,5917
|
18
|
+
agenticaiframework-1.0.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
19
|
+
agenticaiframework-1.0.27.dist-info/top_level.txt,sha256=q30EgNdX3TPF02Aq6mVwI0LUBpgfH12X7pwBIwm0mPo,19
|
20
|
+
agenticaiframework-1.0.27.dist-info/RECORD,,
|
@@ -1,20 +0,0 @@
|
|
1
|
-
agenticaiframework/__init__.py,sha256=Bk5u9D1FnUkZXtxvkQudCNQTSrcYfNGcjAq8NVzzcp8,1026
|
2
|
-
agenticaiframework/agents.py,sha256=gSdEzgUeme9jrKZVaLrBwSM5S--DTVsR3GMNt3XSBc0,1896
|
3
|
-
agenticaiframework/communication.py,sha256=aWhXWCGu5vSq4MeSm2AoVYKEnM5IUqqux99YTzZRGWI,906
|
4
|
-
agenticaiframework/configurations.py,sha256=BFWyMWSc8dWrXGGE9twntQZrTyn2L_jUiH1MeSQgdVM,1155
|
5
|
-
agenticaiframework/evaluation.py,sha256=aDsCmcYq84RLAXfWmydt6q0-GGyuYniO0L4A9AdE6qE,1090
|
6
|
-
agenticaiframework/guardrails.py,sha256=JhUqYU-sn2R2ycjbkVHkuv9DHtfTICnKnWJhgPy9ZZE,1554
|
7
|
-
agenticaiframework/hub.py,sha256=ezwChjQlJofNFlsuGwxp2Cz_iM2CIn-vVGMQfscUg4Y,1231
|
8
|
-
agenticaiframework/knowledge.py,sha256=Lqw-c4BJpnwz0C_GCID7J2MyzkNKr9b7i94n1TIqboY,1301
|
9
|
-
agenticaiframework/llms.py,sha256=BlW386KDKqtc7iyeUmrQR_-zpIkn2aIKIr6-AK4oJrY,1217
|
10
|
-
agenticaiframework/mcp_tools.py,sha256=VSXbepC-YVYF6cHi33KDiGx9_vm5zepmQYF5h1r-kyU,1533
|
11
|
-
agenticaiframework/memory.py,sha256=5GrvUvuyN9g2haROpYmkUwDICw0q0eConQv-dtV15FE,1375
|
12
|
-
agenticaiframework/monitoring.py,sha256=1xE0HrSUhTcV48nu8M0tPssOEbIX7DpMlCxPBlafM9I,1132
|
13
|
-
agenticaiframework/processes.py,sha256=oxuR4r5CKt7oIfJwAqKNe_TN_j1HNxvJfEsGL1oBMFA,1903
|
14
|
-
agenticaiframework/prompts.py,sha256=f0Biar0GvQ5bXB2jqUkSy-5FG468qBU6jJEVLAsLXRs,1398
|
15
|
-
agenticaiframework/tasks.py,sha256=hJKrFYJNlqkyGwl6qVYjXfZ7aeBRC9xGKEaWobF_KA4,1850
|
16
|
-
agenticaiframework-1.0.25.dist-info/licenses/LICENSE,sha256=fKYjpVuxF75tWQhzLkN90tDG4knIjDZKUMiPJbKWxIw,1079
|
17
|
-
agenticaiframework-1.0.25.dist-info/METADATA,sha256=9B0BuA2vbdYeH2zHKjYSdFCwo1YhgyT79yCUGy7TxXY,5917
|
18
|
-
agenticaiframework-1.0.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
19
|
-
agenticaiframework-1.0.25.dist-info/top_level.txt,sha256=q30EgNdX3TPF02Aq6mVwI0LUBpgfH12X7pwBIwm0mPo,19
|
20
|
-
agenticaiframework-1.0.25.dist-info/RECORD,,
|
File without changes
|
{agenticaiframework-1.0.25.dist-info → agenticaiframework-1.0.27.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|