agentkernel 0.2.11__tar.gz → 0.2.13__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.
- {agentkernel-0.2.11 → agentkernel-0.2.13}/PKG-INFO +51 -11
- {agentkernel-0.2.11 → agentkernel-0.2.13}/README.md +42 -8
- {agentkernel-0.2.11 → agentkernel-0.2.13}/pyproject.toml +12 -3
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/api/handler.py +11 -21
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/api/http.py +56 -5
- agentkernel-0.2.13/src/agentkernel/auth/__init__.py +14 -0
- agentkernel-0.2.13/src/agentkernel/auth/handler.py +69 -0
- agentkernel-0.2.13/src/agentkernel/azure.py +8 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/__init__.py +1 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/base.py +156 -70
- agentkernel-0.2.13/src/agentkernel/core/builder.py +147 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/config.py +11 -1
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/runtime.py +74 -44
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/service.py +1 -4
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/session/__init__.py +1 -1
- agentkernel-0.2.13/src/agentkernel/core/session/cosmosdb.py +345 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/session/dynamodb.py +1 -4
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/session/redis.py +1 -4
- agentkernel-0.2.13/src/agentkernel/core/tool.py +156 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/deployment/aws/__init__.py +2 -1
- agentkernel-0.2.13/src/agentkernel/deployment/aws/akauthorizer.py +101 -0
- agentkernel-0.2.13/src/agentkernel/deployment/aws/aklambda.py +254 -0
- agentkernel-0.2.13/src/agentkernel/deployment/azure/__init__.py +12 -0
- agentkernel-0.2.13/src/agentkernel/deployment/azure/akfunction.py +149 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/framework/adk/__init__.py +1 -1
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/framework/adk/adk.py +115 -8
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/framework/crewai/__init__.py +1 -1
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/framework/crewai/crewai.py +69 -37
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/framework/langgraph/__init__.py +1 -1
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/framework/langgraph/langgraph.py +77 -29
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/framework/openai/__init__.py +1 -1
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/framework/openai/openai.py +43 -15
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/slack/slack_chat.py +1 -1
- agentkernel-0.2.11/src/agentkernel/core/builder.py +0 -119
- agentkernel-0.2.11/src/agentkernel/deployment/aws/aklambda.py +0 -101
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/adk.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/api/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/api/a2a/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/api/a2a/a2a.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/api/a2a/handler.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/api/mcp/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/api/mcp/akmcp.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/aws.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/cli/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/cli/cli.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/hooks.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/model.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/module.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/session/base.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/session/in_memory.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/session/serde.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/util/config_yaml_util.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/core/util/key_value_cache.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/crewai.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/deployment/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/framework/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/gmail.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/guardrail/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/guardrail/bedrock.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/guardrail/guardrail.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/guardrail/openai.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/instagram.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/gmail/README.md +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/gmail/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/gmail/gmail_chat.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/instagram/README.md +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/instagram/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/instagram/instagram_chat.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/messenger/README.md +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/messenger/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/messenger/messenger_chat.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/slack/README.md +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/slack/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/telegram/README.md +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/telegram/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/telegram/telegram_chat.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/whatsapp/README.md +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/whatsapp/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/integration/whatsapp/whatsapp_chat.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/langgraph.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/mcp.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/messenger.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/openai.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/slack.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/telegram.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/test/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/test/test.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/base.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/langfuse/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/langfuse/adk.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/langfuse/crewai.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/langfuse/langfuse.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/langfuse/langgraph.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/langfuse/openai.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/openllmetry/__init__.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/openllmetry/adk.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/openllmetry/crewai.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/openllmetry/langgraph.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/openllmetry/openai.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/openllmetry/openllmetry.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/trace/trace.py +0 -0
- {agentkernel-0.2.11 → agentkernel-0.2.13}/src/agentkernel/whatsapp.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: agentkernel
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.13
|
|
4
4
|
Summary: Agent Kernel - Unified AI Agents Runtime
|
|
5
5
|
Author: Yaala Labs
|
|
6
6
|
Author-email: Yaala Labs <agentkernel@yaalalabs.com>
|
|
7
|
-
License:
|
|
8
|
-
Requires-Dist: deprecated>=1.
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Requires-Dist: deprecated>=1.2.18
|
|
9
9
|
Requires-Dist: pydantic>=2.11.7
|
|
10
10
|
Requires-Dist: pydantic-settings>=2.10.1
|
|
11
11
|
Requires-Dist: pyyaml>=6.0.2
|
|
@@ -17,7 +17,11 @@ Requires-Dist: openinference-instrumentation-google-adk>=0.1.6 ; extra == 'adk'
|
|
|
17
17
|
Requires-Dist: fastapi>=0.118.0 ; extra == 'api'
|
|
18
18
|
Requires-Dist: uvicorn>=0.37.0 ; extra == 'api'
|
|
19
19
|
Requires-Dist: gunicorn>=23.0.0 ; extra == 'api'
|
|
20
|
+
Requires-Dist: pyjwt>=2.0.0 ; extra == 'auth'
|
|
20
21
|
Requires-Dist: boto3>=1.41.4 ; extra == 'aws'
|
|
22
|
+
Requires-Dist: azure-functions>=1.24.0 ; extra == 'azure'
|
|
23
|
+
Requires-Dist: azure-data-tables>=12.4.0 ; extra == 'azure'
|
|
24
|
+
Requires-Dist: azure-core>=1.26.0 ; extra == 'azure'
|
|
21
25
|
Requires-Dist: crewai>=0.150.0 ; extra == 'crewai'
|
|
22
26
|
Requires-Dist: openinference-instrumentation-crewai>=0.1.16 ; extra == 'crewai'
|
|
23
27
|
Requires-Dist: openinference-instrumentation-litellm>=0.1.28 ; extra == 'crewai'
|
|
@@ -57,7 +61,9 @@ Requires-Python: >=3.12, <3.14
|
|
|
57
61
|
Provides-Extra: a2a
|
|
58
62
|
Provides-Extra: adk
|
|
59
63
|
Provides-Extra: api
|
|
64
|
+
Provides-Extra: auth
|
|
60
65
|
Provides-Extra: aws
|
|
66
|
+
Provides-Extra: azure
|
|
61
67
|
Provides-Extra: cli
|
|
62
68
|
Provides-Extra: crewai
|
|
63
69
|
Provides-Extra: gmail
|
|
@@ -80,15 +86,18 @@ Description-Content-Type: text/markdown
|
|
|
80
86
|
[](https://badge.fury.io/py/agentkernel)
|
|
81
87
|
[](https://www.python.org/downloads/)
|
|
82
88
|
|
|
83
|
-
Agent Kernel is a lightweight runtime and adapter layer for building and running AI agents across multiple frameworks and
|
|
89
|
+
Agent Kernel is a lightweight **multi-cloud AI agent runtime** and adapter layer for building and running AI agents across multiple frameworks and cloud providers. Deploy the same agent code to **AWS or Azure** without modification. Migrate your existing agents to Agent Kernel and instantly utilize pre-built execution and testing capabilities.
|
|
90
|
+
|
|
91
|
+
**Supported Cloud Platforms:** AWS, Azure
|
|
84
92
|
|
|
85
93
|
## Features
|
|
86
94
|
|
|
87
95
|
- **Unified API**: Common abstractions (Agent, Runner, Session, Module, Runtime) across frameworks
|
|
88
96
|
- **Multi-Framework Support**: OpenAI Agents SDK, CrewAI, LangGraph, Google ADK
|
|
89
|
-
- **
|
|
90
|
-
- **
|
|
91
|
-
- **
|
|
97
|
+
- **Multi-Cloud Deployment**: Deploy to AWS (Lambda, ECS/Fargate) or Azure (Functions, Container Apps) with the same code
|
|
98
|
+
- **Session Management**: Built-in session abstraction with multi-cloud storage (Redis, DynamoDB, Cosmos DB)
|
|
99
|
+
- **Flexible Deployment**: Interactive CLI, REST API, serverless (AWS Lambda, Azure Functions), containerized (AWS ECS, Azure Container Apps)
|
|
100
|
+
- **Pluggable Architecture**: Easy to extend with custom framework adapters and cloud providers
|
|
92
101
|
- **MCP Server**: Built-in Model Context Protocol server for exposing agents as MCP tools and exposing any custom tool
|
|
93
102
|
- **A2A Server**: Built-in Agent-to-Agent communication server for exposing agents with a simple configuration change
|
|
94
103
|
- **REST API**: Built-in REST API server for agent interaction
|
|
@@ -231,7 +240,11 @@ Then interact with your agents:
|
|
|
231
240
|
(researcher) >> What is the latest news on AI?
|
|
232
241
|
```
|
|
233
242
|
|
|
234
|
-
##
|
|
243
|
+
## Multi-Cloud Deployment
|
|
244
|
+
|
|
245
|
+
Deploy your agents to AWS or Azure using the built-in cloud deployment handlers.
|
|
246
|
+
|
|
247
|
+
### AWS Lambda Deployment
|
|
235
248
|
|
|
236
249
|
Deploy your agents as serverless functions using the built-in Lambda handler.
|
|
237
250
|
|
|
@@ -248,6 +261,23 @@ OpenAIModule([assistant])
|
|
|
248
261
|
handler = Lambda.handler
|
|
249
262
|
```
|
|
250
263
|
|
|
264
|
+
### Azure Functions Deployment
|
|
265
|
+
|
|
266
|
+
Deploy your agents as Azure Functions using the built-in Azure handler.
|
|
267
|
+
|
|
268
|
+
```python
|
|
269
|
+
from openai import OpenAI
|
|
270
|
+
from agents import Agent as OpenAIAgent
|
|
271
|
+
from agentkernel.azure import AzureFunctions
|
|
272
|
+
from agentkernel.openai import OpenAIModule
|
|
273
|
+
|
|
274
|
+
client = OpenAI()
|
|
275
|
+
assistant = OpenAIAgent(name="assistant")
|
|
276
|
+
|
|
277
|
+
OpenAIModule([assistant])
|
|
278
|
+
handler = AzureFunctions.handler
|
|
279
|
+
```
|
|
280
|
+
|
|
251
281
|
**Request Format:**
|
|
252
282
|
|
|
253
283
|
```json
|
|
@@ -307,11 +337,11 @@ Supported formats: `.yaml`, `.yml`, `.json`
|
|
|
307
337
|
|
|
308
338
|
#### Session Store
|
|
309
339
|
|
|
310
|
-
Configure where agent sessions are stored.
|
|
340
|
+
Configure where agent sessions are stored (supports multi-cloud storage backends).
|
|
311
341
|
|
|
312
342
|
- **Field**: `session.type`
|
|
313
343
|
- **Type**: string
|
|
314
|
-
- **Options**: `in_memory`, `redis`
|
|
344
|
+
- **Options**: `in_memory`, `redis`, `dynamodb` (AWS), `cosmosdb` (Azure)
|
|
315
345
|
- **Default**: `in_memory`
|
|
316
346
|
- **Environment Variable**: `AK_SESSION__TYPE`
|
|
317
347
|
|
|
@@ -1034,7 +1064,17 @@ The project uses:
|
|
|
1034
1064
|
|
|
1035
1065
|
## License
|
|
1036
1066
|
|
|
1037
|
-
|
|
1067
|
+
Unless otherwise specified, all content, including all source code files and documentation files in this repository are:
|
|
1068
|
+
|
|
1069
|
+
Copyright (c) 2025-2026 Yaala Labs.
|
|
1070
|
+
|
|
1071
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
|
1072
|
+
|
|
1073
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
1074
|
+
|
|
1075
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
1076
|
+
|
|
1077
|
+
SPDX-License-Identifier: Apache-2.0
|
|
1038
1078
|
|
|
1039
1079
|
## Support
|
|
1040
1080
|
|
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
[](https://badge.fury.io/py/agentkernel)
|
|
4
4
|
[](https://www.python.org/downloads/)
|
|
5
5
|
|
|
6
|
-
Agent Kernel is a lightweight runtime and adapter layer for building and running AI agents across multiple frameworks and
|
|
6
|
+
Agent Kernel is a lightweight **multi-cloud AI agent runtime** and adapter layer for building and running AI agents across multiple frameworks and cloud providers. Deploy the same agent code to **AWS or Azure** without modification. Migrate your existing agents to Agent Kernel and instantly utilize pre-built execution and testing capabilities.
|
|
7
|
+
|
|
8
|
+
**Supported Cloud Platforms:** AWS, Azure
|
|
7
9
|
|
|
8
10
|
## Features
|
|
9
11
|
|
|
10
12
|
- **Unified API**: Common abstractions (Agent, Runner, Session, Module, Runtime) across frameworks
|
|
11
13
|
- **Multi-Framework Support**: OpenAI Agents SDK, CrewAI, LangGraph, Google ADK
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
14
|
+
- **Multi-Cloud Deployment**: Deploy to AWS (Lambda, ECS/Fargate) or Azure (Functions, Container Apps) with the same code
|
|
15
|
+
- **Session Management**: Built-in session abstraction with multi-cloud storage (Redis, DynamoDB, Cosmos DB)
|
|
16
|
+
- **Flexible Deployment**: Interactive CLI, REST API, serverless (AWS Lambda, Azure Functions), containerized (AWS ECS, Azure Container Apps)
|
|
17
|
+
- **Pluggable Architecture**: Easy to extend with custom framework adapters and cloud providers
|
|
15
18
|
- **MCP Server**: Built-in Model Context Protocol server for exposing agents as MCP tools and exposing any custom tool
|
|
16
19
|
- **A2A Server**: Built-in Agent-to-Agent communication server for exposing agents with a simple configuration change
|
|
17
20
|
- **REST API**: Built-in REST API server for agent interaction
|
|
@@ -154,7 +157,11 @@ Then interact with your agents:
|
|
|
154
157
|
(researcher) >> What is the latest news on AI?
|
|
155
158
|
```
|
|
156
159
|
|
|
157
|
-
##
|
|
160
|
+
## Multi-Cloud Deployment
|
|
161
|
+
|
|
162
|
+
Deploy your agents to AWS or Azure using the built-in cloud deployment handlers.
|
|
163
|
+
|
|
164
|
+
### AWS Lambda Deployment
|
|
158
165
|
|
|
159
166
|
Deploy your agents as serverless functions using the built-in Lambda handler.
|
|
160
167
|
|
|
@@ -171,6 +178,23 @@ OpenAIModule([assistant])
|
|
|
171
178
|
handler = Lambda.handler
|
|
172
179
|
```
|
|
173
180
|
|
|
181
|
+
### Azure Functions Deployment
|
|
182
|
+
|
|
183
|
+
Deploy your agents as Azure Functions using the built-in Azure handler.
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
from openai import OpenAI
|
|
187
|
+
from agents import Agent as OpenAIAgent
|
|
188
|
+
from agentkernel.azure import AzureFunctions
|
|
189
|
+
from agentkernel.openai import OpenAIModule
|
|
190
|
+
|
|
191
|
+
client = OpenAI()
|
|
192
|
+
assistant = OpenAIAgent(name="assistant")
|
|
193
|
+
|
|
194
|
+
OpenAIModule([assistant])
|
|
195
|
+
handler = AzureFunctions.handler
|
|
196
|
+
```
|
|
197
|
+
|
|
174
198
|
**Request Format:**
|
|
175
199
|
|
|
176
200
|
```json
|
|
@@ -230,11 +254,11 @@ Supported formats: `.yaml`, `.yml`, `.json`
|
|
|
230
254
|
|
|
231
255
|
#### Session Store
|
|
232
256
|
|
|
233
|
-
Configure where agent sessions are stored.
|
|
257
|
+
Configure where agent sessions are stored (supports multi-cloud storage backends).
|
|
234
258
|
|
|
235
259
|
- **Field**: `session.type`
|
|
236
260
|
- **Type**: string
|
|
237
|
-
- **Options**: `in_memory`, `redis`
|
|
261
|
+
- **Options**: `in_memory`, `redis`, `dynamodb` (AWS), `cosmosdb` (Azure)
|
|
238
262
|
- **Default**: `in_memory`
|
|
239
263
|
- **Environment Variable**: `AK_SESSION__TYPE`
|
|
240
264
|
|
|
@@ -957,7 +981,17 @@ The project uses:
|
|
|
957
981
|
|
|
958
982
|
## License
|
|
959
983
|
|
|
960
|
-
|
|
984
|
+
Unless otherwise specified, all content, including all source code files and documentation files in this repository are:
|
|
985
|
+
|
|
986
|
+
Copyright (c) 2025-2026 Yaala Labs.
|
|
987
|
+
|
|
988
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
|
989
|
+
|
|
990
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
991
|
+
|
|
992
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
993
|
+
|
|
994
|
+
SPDX-License-Identifier: Apache-2.0
|
|
961
995
|
|
|
962
996
|
## Support
|
|
963
997
|
|
|
@@ -4,16 +4,16 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "agentkernel"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.13"
|
|
8
8
|
description = "Agent Kernel - Unified AI Agents Runtime"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12,<3.14"
|
|
11
|
-
license = { text = "
|
|
11
|
+
license = { text = "Apache-2.0" }
|
|
12
12
|
authors = [
|
|
13
13
|
{ name = "Yaala Labs", email = "agentkernel@yaalalabs.com" }
|
|
14
14
|
]
|
|
15
15
|
dependencies = [
|
|
16
|
-
"deprecated>=1.
|
|
16
|
+
"deprecated>=1.2.18",
|
|
17
17
|
"pydantic>=2.11.7",
|
|
18
18
|
"pydantic-settings>=2.10.1",
|
|
19
19
|
"pyyaml>=6.0.2",
|
|
@@ -21,6 +21,9 @@ dependencies = [
|
|
|
21
21
|
]
|
|
22
22
|
|
|
23
23
|
[project.optional-dependencies]
|
|
24
|
+
auth = [
|
|
25
|
+
"PyJWT>=2.0.0",
|
|
26
|
+
]
|
|
24
27
|
langfuse = [
|
|
25
28
|
"langfuse>=3.9.2",
|
|
26
29
|
"nest-asyncio>=1.6.0",
|
|
@@ -45,6 +48,12 @@ cli = [
|
|
|
45
48
|
aws = [
|
|
46
49
|
"boto3>=1.41.4",
|
|
47
50
|
]
|
|
51
|
+
|
|
52
|
+
azure = [
|
|
53
|
+
"azure-functions>=1.24.0",
|
|
54
|
+
"azure-data-tables>=12.4.0",
|
|
55
|
+
"azure-core>=1.26.0"
|
|
56
|
+
]
|
|
48
57
|
redis = [
|
|
49
58
|
"redis>=7.1.0",
|
|
50
59
|
]
|
|
@@ -27,16 +27,11 @@ class RESTRequestHandler(ABC):
|
|
|
27
27
|
"""
|
|
28
28
|
Returns the APIRouter instance which has configured routes
|
|
29
29
|
E.g.:
|
|
30
|
-
- GET /
|
|
31
|
-
- GET /agents: List available agents
|
|
30
|
+
- GET /api/v1/agents: List available agents
|
|
32
31
|
|
|
33
32
|
router = APIRouter()
|
|
34
33
|
|
|
35
|
-
@router.get("/
|
|
36
|
-
def health():
|
|
37
|
-
return {"status": "ok"}
|
|
38
|
-
|
|
39
|
-
@router.get("/agents")
|
|
34
|
+
@router.get("/api/v1/agents")
|
|
40
35
|
def list_agents():
|
|
41
36
|
from ..core.runtime import Runtime
|
|
42
37
|
return {"agents": list(Runtime.current().agents().keys())}
|
|
@@ -49,9 +44,8 @@ class AgentRESTRequestHandler(RESTRequestHandler):
|
|
|
49
44
|
"""
|
|
50
45
|
API routers that expose endpoints to interact with Agent Kernel.
|
|
51
46
|
Endpoints:
|
|
52
|
-
- GET /
|
|
53
|
-
-
|
|
54
|
-
- POST /run: Run an agent with a prompt
|
|
47
|
+
- GET /api/v1/agents: List available agents
|
|
48
|
+
- POST /api/v1/chat: Run an agent with a prompt
|
|
55
49
|
Payload JSON: { "prompt": str, "agent": str | null, "session_id": str | null }
|
|
56
50
|
"""
|
|
57
51
|
|
|
@@ -89,19 +83,15 @@ class AgentRESTRequestHandler(RESTRequestHandler):
|
|
|
89
83
|
|
|
90
84
|
router = APIRouter()
|
|
91
85
|
|
|
92
|
-
@router.get("/
|
|
93
|
-
def health():
|
|
94
|
-
return {"status": "ok"}
|
|
95
|
-
|
|
96
|
-
@router.get("/agents")
|
|
86
|
+
@router.get("/api/v1/agents")
|
|
97
87
|
def list_agents():
|
|
98
88
|
return {"agents": list(Runtime.current().agents().keys())}
|
|
99
89
|
|
|
100
|
-
@router.post("/
|
|
90
|
+
@router.post("/api/v1/chat")
|
|
101
91
|
async def run(body: AgentRESTRequestHandler.RunRequest):
|
|
102
92
|
return await self.run(body)
|
|
103
93
|
|
|
104
|
-
@router.post("/
|
|
94
|
+
@router.post("/api/v1/chat-multipart")
|
|
105
95
|
async def run_multipart(
|
|
106
96
|
prompt: str = Form(...),
|
|
107
97
|
agent: Optional[str] = Form(None),
|
|
@@ -175,7 +165,7 @@ class AgentRESTRequestHandler(RESTRequestHandler):
|
|
|
175
165
|
except HTTPException:
|
|
176
166
|
raise
|
|
177
167
|
except ValueError as e:
|
|
178
|
-
self._log.error(f"POST /
|
|
168
|
+
self._log.error(f"POST /api/v1/chat error: {e}\n{traceback.format_exc()}")
|
|
179
169
|
raise HTTPException(
|
|
180
170
|
status_code=HTTPStatus.BAD_REQUEST,
|
|
181
171
|
detail={
|
|
@@ -184,7 +174,7 @@ class AgentRESTRequestHandler(RESTRequestHandler):
|
|
|
184
174
|
},
|
|
185
175
|
)
|
|
186
176
|
except Exception as e:
|
|
187
|
-
self._log.error(f"POST /
|
|
177
|
+
self._log.error(f"POST /api/v1/chat error: {e}\n{traceback.format_exc()}")
|
|
188
178
|
raise HTTPException(
|
|
189
179
|
status_code=HTTPStatus.INTERNAL_SERVER_ERROR,
|
|
190
180
|
detail={
|
|
@@ -295,7 +285,7 @@ class AgentRESTRequestHandler(RESTRequestHandler):
|
|
|
295
285
|
except HTTPException:
|
|
296
286
|
raise
|
|
297
287
|
except ValueError as e:
|
|
298
|
-
self._log.error(f"POST /
|
|
288
|
+
self._log.error(f"POST /api/v1/chat-multipart error: {e}\n{traceback.format_exc()}")
|
|
299
289
|
raise HTTPException(
|
|
300
290
|
status_code=HTTPStatus.BAD_REQUEST,
|
|
301
291
|
detail={
|
|
@@ -304,7 +294,7 @@ class AgentRESTRequestHandler(RESTRequestHandler):
|
|
|
304
294
|
},
|
|
305
295
|
)
|
|
306
296
|
except Exception as e:
|
|
307
|
-
self._log.error(f"POST /
|
|
297
|
+
self._log.error(f"POST /api/v1/chat-multipart error: {e}\n{traceback.format_exc()}")
|
|
308
298
|
raise HTTPException(
|
|
309
299
|
status_code=HTTPStatus.INTERNAL_SERVER_ERROR,
|
|
310
300
|
detail={
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
3
|
import uvicorn
|
|
4
|
-
from fastapi import APIRouter, FastAPI
|
|
4
|
+
from fastapi import APIRouter, Depends, FastAPI, HTTPException, Request
|
|
5
5
|
from fastapi.middleware.cors import CORSMiddleware
|
|
6
6
|
from fastapi.openapi.utils import get_openapi
|
|
7
7
|
|
|
8
|
+
from ..auth import AuthValidator, ValidationContext
|
|
8
9
|
from ..core.config import AKConfig
|
|
9
10
|
from .handler import AgentRESTRequestHandler, RESTRequestHandler
|
|
10
11
|
|
|
@@ -23,6 +24,14 @@ class RESTAPI:
|
|
|
23
24
|
|
|
24
25
|
_log = logging.getLogger("ak.api.http")
|
|
25
26
|
_custom_routers = []
|
|
27
|
+
_auth_token_validators = []
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def _get_router_dependencies(cls):
|
|
31
|
+
"""Get dependencies to apply to APIRouters.
|
|
32
|
+
:return: List of dependencies or None if no auth validators are configured
|
|
33
|
+
"""
|
|
34
|
+
return cls._auth_token_validators if cls._auth_token_validators else None
|
|
26
35
|
|
|
27
36
|
@classmethod
|
|
28
37
|
def _create_app(cls, routers, lifespan=None) -> FastAPI:
|
|
@@ -30,6 +39,10 @@ class RESTAPI:
|
|
|
30
39
|
Assembles a FastAPI app from routers.
|
|
31
40
|
:param routers: List of routers to include in the app.
|
|
32
41
|
:param lifespan: Optional lifespan handler.
|
|
42
|
+
|
|
43
|
+
Global endpoints:
|
|
44
|
+
- GET /health: Health check
|
|
45
|
+
- GET /openapi.json: OpenAPI specification
|
|
33
46
|
"""
|
|
34
47
|
app = FastAPI(title="Agent Kernel REST API", debug=True, lifespan=lifespan)
|
|
35
48
|
|
|
@@ -41,8 +54,12 @@ class RESTAPI:
|
|
|
41
54
|
allow_headers=["*"],
|
|
42
55
|
)
|
|
43
56
|
|
|
57
|
+
@app.get("/health")
|
|
58
|
+
def health():
|
|
59
|
+
return {"status": "ok"}
|
|
60
|
+
|
|
44
61
|
for r in routers or []:
|
|
45
|
-
app.include_router(r)
|
|
62
|
+
app.include_router(router=r, dependencies=cls._get_router_dependencies())
|
|
46
63
|
|
|
47
64
|
@app.get("/openapi.json")
|
|
48
65
|
async def get_openapi_endpoint():
|
|
@@ -56,6 +73,9 @@ class RESTAPI:
|
|
|
56
73
|
|
|
57
74
|
@classmethod
|
|
58
75
|
def add(cls, router: APIRouter):
|
|
76
|
+
"""Add a custom router to the REST API.
|
|
77
|
+
:param router: FastAPI router to add to the API
|
|
78
|
+
"""
|
|
59
79
|
cls._log.debug(f"Adding custom router")
|
|
60
80
|
for route in router.routes:
|
|
61
81
|
cls._log.debug(f"Route: {route.path} [{route.methods}]")
|
|
@@ -63,8 +83,8 @@ class RESTAPI:
|
|
|
63
83
|
|
|
64
84
|
@classmethod
|
|
65
85
|
def run(cls, handlers: list[RESTRequestHandler] = None):
|
|
66
|
-
"""
|
|
67
|
-
|
|
86
|
+
"""Start the REST API server.
|
|
87
|
+
:param handlers: List of REST request handlers to use (default: AgentRESTRequestHandler)
|
|
68
88
|
"""
|
|
69
89
|
if handlers is None:
|
|
70
90
|
handlers = [AgentRESTRequestHandler()]
|
|
@@ -92,5 +112,36 @@ class RESTAPI:
|
|
|
92
112
|
app = cls._create_app(routers=routers)
|
|
93
113
|
# Add custom routers
|
|
94
114
|
for router in cls._custom_routers:
|
|
95
|
-
app.include_router(router, prefix=AKConfig.get().api.custom_router_prefix)
|
|
115
|
+
app.include_router(router, prefix=AKConfig.get().api.custom_router_prefix, dependencies=cls._get_router_dependencies())
|
|
96
116
|
uvicorn.run(app=app, host=host, port=port, reload=False)
|
|
117
|
+
|
|
118
|
+
@classmethod
|
|
119
|
+
def add_auth_handlers(cls, auth_validators: list[AuthValidator]):
|
|
120
|
+
"""Add authentication validators to the REST API.
|
|
121
|
+
:param auth_validators: List of auth validators to add for token validation
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
def get_auth_function(token_validator: AuthValidator):
|
|
125
|
+
def verify_token(request: Request):
|
|
126
|
+
"""Verify authentication token for incoming requests.
|
|
127
|
+
:param request: FastAPI Request object
|
|
128
|
+
:return: ValidationResult if token is valid
|
|
129
|
+
:raises: HTTPException if authentication fails
|
|
130
|
+
"""
|
|
131
|
+
request_url = str(request.url)
|
|
132
|
+
cls._log.debug(f"Validating token for request: {request.method} {request_url}")
|
|
133
|
+
auth_token = request.headers.get("authorization")
|
|
134
|
+
if auth_token is None:
|
|
135
|
+
raise HTTPException(status_code=401, detail="Missing authorization header")
|
|
136
|
+
auth_token = auth_token.replace("Bearer ", "").strip()
|
|
137
|
+
result = token_validator.validate(
|
|
138
|
+
token=auth_token, context=ValidationContext(path=request_url, http_method=request.method, headers=dict(request.headers))
|
|
139
|
+
)
|
|
140
|
+
if not result.is_valid:
|
|
141
|
+
raise HTTPException(status_code=401, detail=result.error_msg or "Unauthorized")
|
|
142
|
+
return result
|
|
143
|
+
|
|
144
|
+
return verify_token
|
|
145
|
+
|
|
146
|
+
for token_validator in auth_validators:
|
|
147
|
+
cls._auth_token_validators.append(Depends(get_auth_function(token_validator)))
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Agent Kernel Auth package.
|
|
3
|
+
|
|
4
|
+
This package contains the Auth implementation for exposing Agents.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import importlib.metadata
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
__version__ = importlib.metadata.version("agentkernel")
|
|
11
|
+
except importlib.metadata.PackageNotFoundError:
|
|
12
|
+
__version__ = "0.1.0"
|
|
13
|
+
|
|
14
|
+
from .handler import AuthValidator, ValidationContext, ValidationResult
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import base64
|
|
2
|
+
import hashlib
|
|
3
|
+
import hmac
|
|
4
|
+
from abc import ABC, abstractmethod
|
|
5
|
+
from typing import Any, Dict, Optional
|
|
6
|
+
|
|
7
|
+
import jwt
|
|
8
|
+
from pydantic import BaseModel
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ValidationContext(BaseModel):
|
|
12
|
+
path: Optional[str] = None
|
|
13
|
+
http_method: Optional[str] = None
|
|
14
|
+
headers: Dict[str, str]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ValidationResult(BaseModel):
|
|
18
|
+
is_valid: bool
|
|
19
|
+
subject: Optional[str] = "user"
|
|
20
|
+
claims: Optional[Dict[str, Any]] = None
|
|
21
|
+
error_msg: Optional[str] = None
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class AuthValidator(ABC):
|
|
25
|
+
"""Base class for token validation.
|
|
26
|
+
The validate() method must be implemented by subclasses,
|
|
27
|
+
There are some basic built-in cryptographic validation helpers which can be used if needed."""
|
|
28
|
+
|
|
29
|
+
@abstractmethod
|
|
30
|
+
def validate(self, token: str, context: Optional[ValidationContext] = None) -> ValidationResult:
|
|
31
|
+
"""Main validation entry point. This is where the custom logic has to be written.
|
|
32
|
+
:param token: The authentication token to validate
|
|
33
|
+
:param context: Optional validation context containing request metadata
|
|
34
|
+
:return: ValidationResult indicating if token is valid and associated claims
|
|
35
|
+
"""
|
|
36
|
+
pass
|
|
37
|
+
|
|
38
|
+
def _validate_hmac(self, message: bytes, signature: str, secret: str, algorithm: str = "sha256") -> bool:
|
|
39
|
+
"""Basic HMAC signature validation.
|
|
40
|
+
:param message: The message bytes to verify
|
|
41
|
+
:param signature: The HMAC signature to validate against
|
|
42
|
+
:param secret: The secret key used for HMAC generation
|
|
43
|
+
:param algorithm: Hash algorithm to use (default: sha256)
|
|
44
|
+
:return: True if signature is valid, False otherwise
|
|
45
|
+
"""
|
|
46
|
+
mac = hmac.new(key=secret.encode(), msg=message, digestmod=getattr(hashlib, algorithm))
|
|
47
|
+
expected = base64.b64encode(mac.digest()).decode()
|
|
48
|
+
return hmac.compare_digest(expected, signature)
|
|
49
|
+
|
|
50
|
+
def _validate_rs256_jwt(
|
|
51
|
+
self, token: str, public_key: str, audience: Optional[str] = None, issuer: Optional[str] = None, options: Optional[Dict[str, Any]] = None
|
|
52
|
+
) -> Dict[str, Any]:
|
|
53
|
+
"""Basic RS256 JWT validation.
|
|
54
|
+
:param token: The JWT token to validate
|
|
55
|
+
:param public_key: The RSA public key for signature verification
|
|
56
|
+
:param audience: Optional expected audience claim
|
|
57
|
+
:param issuer: Optional expected issuer claim
|
|
58
|
+
:param options: Additional JWT validation options
|
|
59
|
+
:return: Decoded JWT claims dictionary
|
|
60
|
+
:raises: jwt exceptions if token is invalid
|
|
61
|
+
"""
|
|
62
|
+
return jwt.decode(
|
|
63
|
+
token,
|
|
64
|
+
public_key,
|
|
65
|
+
algorithms=["RS256"],
|
|
66
|
+
audience=audience,
|
|
67
|
+
issuer=issuer,
|
|
68
|
+
options=options or {},
|
|
69
|
+
)
|