agenticaiframework 1.0.25__tar.gz → 1.0.27__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.
Files changed (26) hide show
  1. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/PKG-INFO +1 -1
  2. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/communication.py +17 -0
  3. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/guardrails.py +8 -0
  4. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/hub.py +10 -0
  5. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/knowledge.py +6 -0
  6. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/mcp_tools.py +9 -0
  7. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/memory.py +9 -0
  8. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/monitoring.py +4 -0
  9. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/processes.py +4 -0
  10. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/prompts.py +15 -3
  11. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/tasks.py +15 -0
  12. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework.egg-info/PKG-INFO +1 -1
  13. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/setup.py +1 -1
  14. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/tests/test_agenticai_additional.py +1 -1
  15. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/LICENSE +0 -0
  16. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/README.md +0 -0
  17. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/__init__.py +0 -0
  18. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/agents.py +0 -0
  19. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/configurations.py +0 -0
  20. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/evaluation.py +0 -0
  21. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework/llms.py +0 -0
  22. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework.egg-info/SOURCES.txt +0 -0
  23. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework.egg-info/dependency_links.txt +0 -0
  24. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/agenticaiframework.egg-info/top_level.txt +0 -0
  25. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/setup.cfg +0 -0
  26. {agenticaiframework-1.0.25 → agenticaiframework-1.0.27}/tests/test_agenticai.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agenticaiframework
3
- Version: 1.0.25
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
@@ -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}")
@@ -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}")
@@ -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)
@@ -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}'")
@@ -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}")
@@ -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}")
@@ -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}")
@@ -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}'")
@@ -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, prompt: Prompt):
22
- self.prompts[prompt.id] = prompt
23
- self._log(f"Registered prompt with ID {prompt.id}")
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)
@@ -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.25
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
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="agenticaiframework",
5
- version="1.0.25",
5
+ version="1.0.27",
6
6
  author="Sathishkumar Nagarajan",
7
7
  author_email="mail@sathishkumarnagarajan.com",
8
8
  description="AgenticAI - A Python SDK for building agentic applications with advanced orchestration, monitoring, and multimodal capabilities.",
@@ -266,7 +266,7 @@ def test_monitoring_system_log_and_metrics(capsys):
266
266
  ms.log_event("evt1")
267
267
  except TypeError:
268
268
  try:
269
- ms.log_event("evt1", {"info": "test"})
269
+ ms.log_event("evt1", {"info": "test"}) # type: ignore[call-arg]
270
270
  except Exception:
271
271
  pass
272
272
  try: