agentkernel 0.2.0__tar.gz → 0.2.1__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 (36) hide show
  1. {agentkernel-0.2.0 → agentkernel-0.2.1}/PKG-INFO +6 -1
  2. {agentkernel-0.2.0 → agentkernel-0.2.1}/README.md +5 -0
  3. {agentkernel-0.2.0 → agentkernel-0.2.1}/pyproject.toml +1 -1
  4. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/adk/adk.py +12 -3
  5. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/api/restapi.py +12 -1
  6. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/config.py +1 -0
  7. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/module.py +13 -3
  8. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/crewai/crewai.py +14 -3
  9. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/langgraph/langgraph.py +13 -3
  10. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/openai/openai.py +13 -4
  11. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/__init__.py +0 -0
  12. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/a2a/__init__.py +0 -0
  13. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/a2a/a2a.py +0 -0
  14. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/adk/__init__.py +0 -0
  15. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/api/__init__.py +0 -0
  16. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/api/a2a.py +0 -0
  17. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/api/agent.py +0 -0
  18. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/aws/__init__.py +0 -0
  19. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/aws/aklambda.py +0 -0
  20. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/cli/__init__.py +0 -0
  21. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/cli/cli.py +0 -0
  22. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/__init__.py +0 -0
  23. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/base.py +0 -0
  24. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/runtime.py +0 -0
  25. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/service.py +0 -0
  26. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/sessions/__init__.py +0 -0
  27. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/sessions/base.py +0 -0
  28. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/sessions/in_memory.py +0 -0
  29. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/core/sessions/redis.py +0 -0
  30. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/crewai/__init__.py +0 -0
  31. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/langgraph/__init__.py +0 -0
  32. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/mcp/__init__.py +0 -0
  33. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/mcp/akmcp.py +0 -0
  34. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/openai/__init__.py +0 -0
  35. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/test/__init__.py +0 -0
  36. {agentkernel-0.2.0 → agentkernel-0.2.1}/src/agentkernel/test/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: agentkernel
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Agent Kernel - Unified AI Agents Runtime
5
5
  Author: Yaala Labs
6
6
  Author-email: Yaala Labs <info@yaalalabs.com>
@@ -317,6 +317,11 @@ Configure the REST API server (if using the API module).
317
317
  - **Default**: `8000`
318
318
  - **Environment Variable**: `AK_API_PORT`
319
319
 
320
+ - **Custom Router Prefix**
321
+ - **Field**: `api.custom_router_prefix`
322
+ - **Default**: `/custom`
323
+ - **Environment Variable**: `AK_API_CUSTOM_ROUTER_PREFIX`
324
+
320
325
  - **Enabled Routes**
321
326
  - **Field**: `api.enabled_routes.agents`
322
327
  - **Default**: `true`
@@ -274,6 +274,11 @@ Configure the REST API server (if using the API module).
274
274
  - **Default**: `8000`
275
275
  - **Environment Variable**: `AK_API_PORT`
276
276
 
277
+ - **Custom Router Prefix**
278
+ - **Field**: `api.custom_router_prefix`
279
+ - **Default**: `/custom`
280
+ - **Environment Variable**: `AK_API_CUSTOM_ROUTER_PREFIX`
281
+
277
282
  - **Enabled Routes**
278
283
  - **Field**: `api.enabled_routes.agents`
279
284
  - **Default**: `true`
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "agentkernel"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "Agent Kernel - Unified AI Agents Runtime"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -6,7 +6,7 @@ from google.adk.runners import Runner
6
6
  from google.adk.sessions import InMemorySessionService, Session as ADKSession
7
7
  from google.genai import types
8
8
 
9
- from agentkernel.core import Agent as AKBaseAgent, Module, Runner as BaseRunner, Session
9
+ from ..core import Agent as AKBaseAgent, Module, Runner as BaseRunner, Session, Runtime
10
10
 
11
11
  FRAMEWORK = "adk"
12
12
 
@@ -161,5 +161,14 @@ class GoogleADKModule(Module):
161
161
  Initializes a Google ADK Module instance.
162
162
  :param agents: List of agents in the module.
163
163
  """
164
- runner = GoogleADKRunner()
165
- super().__init__(list(map(lambda agent: GoogleADKAgent(agent.name, runner, agent), agents)))
164
+ self.runner = GoogleADKRunner()
165
+ super().__init__(list(map(lambda agent: GoogleADKAgent(agent.name, self.runner, agent), agents)))
166
+
167
+ def add(self, agent: BaseAgent):
168
+ """
169
+ Adds an agent to the module.
170
+ :param agent: The agent to add.
171
+ """
172
+ ak_agent = GoogleADKAgent(agent.name, self.runner, agent)
173
+ super().add(ak_agent)
174
+ Runtime.instance().register(ak_agent)
@@ -1,7 +1,7 @@
1
1
  import logging
2
2
 
3
3
  import uvicorn
4
- from fastapi import FastAPI
4
+ from fastapi import FastAPI, APIRouter
5
5
  from fastapi.middleware.cors import CORSMiddleware
6
6
  from fastapi.openapi.utils import get_openapi
7
7
 
@@ -21,6 +21,7 @@ class RESTAPI:
21
21
  Can run any FastAPI app instance or assemble one from routers.
22
22
  """
23
23
  _log = logging.getLogger("ak.api.restapi")
24
+ _custom_routers = []
24
25
 
25
26
  @classmethod
26
27
  def _create_app(cls, routers, lifespan=None) -> FastAPI:
@@ -52,6 +53,13 @@ class RESTAPI:
52
53
 
53
54
  return app
54
55
 
56
+ @classmethod
57
+ def add(cls, router: APIRouter):
58
+ cls._log.debug(f"Adding custom router")
59
+ for route in router.routes:
60
+ cls._log.debug(f"Route: {route.path} [{route.methods}]")
61
+ cls._custom_routers.append(router)
62
+
55
63
  @classmethod
56
64
  def run(cls):
57
65
  """
@@ -75,4 +83,7 @@ class RESTAPI:
75
83
  app.mount("/mcp", mcp_app)
76
84
  else:
77
85
  app = cls._create_app(routers=routers)
86
+ # Add custom routers
87
+ for router in cls._custom_routers:
88
+ app.include_router(router, prefix=AKConfig.get().api.custom_router_prefix)
78
89
  uvicorn.run(app=app, host=host, port=port, reload=False)
@@ -35,6 +35,7 @@ class _APIConfig(BaseModel):
35
35
  host: str = Field(default="0.0.0.0", description="API host")
36
36
  port: int = Field(default=8000, description="API port")
37
37
  enabled_routes: _RoutesConfig = Field(description="API route flags", default_factory=_RoutesConfig)
38
+ custom_router_prefix: str = Field(default="/custom", description="Custom router prefix")
38
39
 
39
40
 
40
41
  class _A2AConfig(BaseModel):
@@ -1,14 +1,16 @@
1
+ from abc import ABC, abstractmethod
2
+
1
3
  from .base import Agent
2
4
  from .runtime import Runtime
3
5
 
4
6
 
5
- class Module:
7
+ class Module(ABC):
6
8
  """
7
9
  Module is the base class for all agent modules.
8
-
10
+
9
11
  An agent module is a Python module containing a set of agents built using a supported agent
10
12
  framework. Agent Kernel provides an implementation of the Module class for each supported agent
11
- framework, allowing the agents to be registered and managed in a framework agnostic manner.
13
+ framework, allowing the agents to be registered and managed in a framework-agnostic manner.
12
14
  """
13
15
 
14
16
  def __init__(self, agents: list[Agent]):
@@ -26,3 +28,11 @@ class Module:
26
28
  Returns the list of agents in the module.
27
29
  """
28
30
  return self._agents
31
+
32
+ @abstractmethod
33
+ def add(self, agent: Agent):
34
+ """
35
+ Adds an agent to the module.
36
+ :param agent: The agent to add.
37
+ """
38
+ self._agents.append(agent)
@@ -5,7 +5,7 @@ from crewai import Agent, Crew, Task
5
5
  from crewai.memory.external.external_memory import ExternalMemory
6
6
  from crewai.memory.storage.interface import Storage
7
7
 
8
- from ..core import Agent as BaseAgent, Module, Runner, Session
8
+ from ..core import Agent as BaseAgent, Module, Runner, Session, Runtime
9
9
 
10
10
  FRAMEWORK = "crewai"
11
11
 
@@ -171,6 +171,17 @@ class CrewAIModule(Module):
171
171
  Initializes a CrewAIModule instance.
172
172
  :param agents: List of agents in the module.
173
173
  """
174
- runner = CrewAIRunner()
174
+ self.runner = CrewAIRunner()
175
+ self.crew = agents
175
176
  super().__init__(
176
- list(map(lambda agent: CrewAIAgent(agent.role, runner, agent, agents), agents)))
177
+ list(map(lambda agent: CrewAIAgent(agent.role, self.runner, agent, self.crew), self.crew)))
178
+
179
+ def add(self, agent: Agent):
180
+ """
181
+ Adds an agent to the module.
182
+ :param agent: The agent to add.
183
+ """
184
+ ak_agent = CrewAIAgent(agent.role, self.runner, agent, self.crew)
185
+ super().add(ak_agent)
186
+ self.crew.append(agent)
187
+ Runtime.instance().register(ak_agent)
@@ -6,7 +6,7 @@ from langgraph.checkpoint.base import BaseCheckpointSaver, Checkpoint, Checkpoin
6
6
  from langgraph.graph.state import CompiledStateGraph
7
7
  from pydantic import BaseModel
8
8
 
9
- from ..core import Agent as BaseAgent, Module as BaseModule, Runner as BaseRunner, Session as BaseSession
9
+ from ..core import Agent as BaseAgent, Module as BaseModule, Runner as BaseRunner, Session as BaseSession, Runtime
10
10
 
11
11
  FRAMEWORK = "langgraph"
12
12
 
@@ -294,5 +294,15 @@ class LangGraphModule(BaseModule):
294
294
  Initializes a LangGraphModule instance.
295
295
  :param agents: List of agents in the module.
296
296
  """
297
- runner = LangGraphRunner()
298
- super().__init__(list(map(lambda agent: LangGraphAgent(name=agent.name, runner=runner, agent=agent), agents)))
297
+ self.runner = LangGraphRunner()
298
+ super().__init__(
299
+ list(map(lambda agent: LangGraphAgent(name=agent.name, runner=self.runner, agent=agent), agents)))
300
+
301
+ def add(self, agent: CompiledStateGraph):
302
+ """
303
+ Adds an agent to the module.
304
+ :param agent: The agent to add.
305
+ """
306
+ ak_agent = LangGraphAgent(name=agent.name, runner=self.runner, agent=agent)
307
+ super().add(ak_agent)
308
+ Runtime.instance().register(ak_agent)
@@ -3,7 +3,7 @@ from typing import Any, List
3
3
  from agents import Agent, Runner
4
4
  from agents.memory.session import SessionABC
5
5
 
6
- from ..core import Agent as BaseAgent, Module, Runner as BaseRunner, Session
6
+ from ..core import Agent as BaseAgent, Module, Runner as BaseRunner, Session, Runtime
7
7
 
8
8
  FRAMEWORK = "openai"
9
9
 
@@ -136,7 +136,7 @@ class OpenAIAgent(BaseAgent):
136
136
 
137
137
  class OpenAIModule(Module):
138
138
  """
139
- OpenAIModule class provides a module for OpenAI Agent SDK based agents.
139
+ OpenAIModule class provides a module for OpenAI Agents SDK based agents.
140
140
  """
141
141
 
142
142
  def __init__(self, agents: list[Agent]):
@@ -144,5 +144,14 @@ class OpenAIModule(Module):
144
144
  Initializes an OpenAIModule instance.
145
145
  :param agents: List of agents in the module.
146
146
  """
147
- runner = OpenAIRunner()
148
- super().__init__(list(map(lambda agent: OpenAIAgent(agent.name, runner, agent), agents)))
147
+ self.runner = OpenAIRunner()
148
+ super().__init__(list(map(lambda agent: OpenAIAgent(agent.name, self.runner, agent), agents)))
149
+
150
+ def add(self, agent: Agent):
151
+ """
152
+ Adds an agent to the module.
153
+ :param agent: The agent to add.
154
+ """
155
+ ak_agent = OpenAIAgent(agent.name, self.runner, agent)
156
+ super().add(ak_agent)
157
+ Runtime.instance().register(ak_agent)