agentkernel 0.2.14__tar.gz → 0.3.0__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.14 → agentkernel-0.3.0}/PKG-INFO +125 -3
- {agentkernel-0.2.14 → agentkernel-0.3.0}/README.md +122 -2
- {agentkernel-0.2.14 → agentkernel-0.3.0}/pyproject.toml +4 -1
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/api/handler.py +2 -4
- agentkernel-0.3.0/src/agentkernel/auth.py +1 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/__init__.py +1 -1
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/base.py +36 -69
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/config.py +92 -1
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/model.py +64 -2
- agentkernel-0.3.0/src/agentkernel/core/multimodal/__init__.py +11 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/factory.py +32 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/hooks.py +244 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/storage/__init__.py +8 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/storage/base.py +59 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/storage/dynamodb.py +186 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/storage/in_memory.py +80 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/storage/redis.py +159 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/storage/session_cache.py +74 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/storage/storage_manager.py +155 -0
- agentkernel-0.3.0/src/agentkernel/core/multimodal/tools.py +84 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/runtime.py +2 -59
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/tool.py +45 -4
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/deployment/aws/__init__.py +1 -2
- agentkernel-0.3.0/src/agentkernel/deployment/aws/core/__init__.py +3 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/core/response_store/__init__.py +1 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/core/response_store/dynamodb.py +39 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/core/response_store/handler.py +88 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/core/response_store/redis.py +41 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/core/sqs_handler.py +216 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/serverless/__init__.py +4 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/serverless/akagentrunner.py +119 -0
- {agentkernel-0.2.14/src/agentkernel/deployment/aws → agentkernel-0.3.0/src/agentkernel/deployment/aws/serverless}/akauthorizer.py +1 -1
- {agentkernel-0.2.14/src/agentkernel/deployment/aws → agentkernel-0.3.0/src/agentkernel/deployment/aws/serverless}/aklambda.py +47 -103
- agentkernel-0.3.0/src/agentkernel/deployment/aws/serverless/akresponsehandler.py +88 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/serverless/core/__init__.py +1 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/serverless/core/default_endpoints.py +295 -0
- agentkernel-0.3.0/src/agentkernel/deployment/aws/serverless/core/sqs_consumer.py +72 -0
- agentkernel-0.3.0/src/agentkernel/deployment/azure/akfunction.py +72 -0
- agentkernel-0.3.0/src/agentkernel/deployment/common/chat_service.py +142 -0
- agentkernel-0.3.0/src/agentkernel/deployment/common/response_store.py +63 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/framework/adk/adk.py +25 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/framework/crewai/crewai.py +24 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/framework/langgraph/langgraph.py +46 -4
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/framework/openai/openai.py +25 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/gmail/README.md +5 -3
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/instagram/README.md +31 -5
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/instagram/instagram_chat.py +101 -11
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/messenger/README.md +75 -22
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/messenger/messenger_chat.py +107 -11
- agentkernel-0.3.0/src/agentkernel/integration/teams/README.md +102 -0
- agentkernel-0.3.0/src/agentkernel/integration/teams/__init__.py +14 -0
- agentkernel-0.3.0/src/agentkernel/integration/teams/teams_chat.py +300 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/telegram/README.md +60 -4
- agentkernel-0.3.0/src/agentkernel/integration/telegram/telegram_chat.py +497 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/whatsapp/README.md +13 -6
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-add-capabilities/SKILL.md +99 -8
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-add-capabilities/evals/evals.json +39 -1
- agentkernel-0.3.0/src/agentkernel/teams.py +8 -0
- agentkernel-0.3.0/src/agentkernel/trace/openllmetry/__init__.py +0 -0
- agentkernel-0.2.14/src/agentkernel/deployment/azure/akfunction.py +0 -149
- agentkernel-0.2.14/src/agentkernel/integration/telegram/telegram_chat.py +0 -297
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/adk.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/api/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/api/a2a/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/api/a2a/a2a.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/api/a2a/handler.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/api/http.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/api/mcp/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/api/mcp/akmcp.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/auth/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/auth/handler.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/aws.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/azure.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/cli/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/cli/ak.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/cli/cli.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/builder.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/hooks.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/module.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/service.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/session/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/session/base.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/session/cosmosdb.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/session/dynamodb.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/session/in_memory.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/session/redis.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/session/serde.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/util/config_yaml_util.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/core/util/key_value_cache.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/crewai.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/deployment/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/deployment/azure/__init__.py +0 -0
- {agentkernel-0.2.14/src/agentkernel/framework → agentkernel-0.3.0/src/agentkernel/deployment/common}/__init__.py +0 -0
- {agentkernel-0.2.14/src/agentkernel/guardrail → agentkernel-0.3.0/src/agentkernel/framework}/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/framework/adk/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/framework/crewai/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/framework/langgraph/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/framework/openai/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/gmail.py +0 -0
- {agentkernel-0.2.14/src/agentkernel/trace/langfuse → agentkernel-0.3.0/src/agentkernel/guardrail}/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/guardrail/bedrock.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/guardrail/guardrail.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/guardrail/openai.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/guardrail/walledai.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/instagram.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/gmail/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/gmail/gmail_chat.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/instagram/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/messenger/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/slack/README.md +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/slack/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/slack/slack_chat.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/telegram/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/whatsapp/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/integration/whatsapp/whatsapp_chat.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/langgraph.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/mcp.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/messenger.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/openai.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-add-integration/SKILL.md +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-add-integration/evals/evals.json +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-build/SKILL.md +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-build/evals/evals.json +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-cloud-deploy/SKILL.md +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-cloud-deploy/evals/evals.json +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-init/SKILL.md +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-init/evals/evals.json +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-test/SKILL.md +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/ak-test/evals/evals.json +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/skills/skills.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/slack.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/telegram.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/test/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/test/test.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/base.py +0 -0
- {agentkernel-0.2.14/src/agentkernel/trace/openllmetry → agentkernel-0.3.0/src/agentkernel/trace/langfuse}/__init__.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/langfuse/adk.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/langfuse/crewai.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/langfuse/langfuse.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/langfuse/langgraph.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/langfuse/openai.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/openllmetry/adk.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/openllmetry/crewai.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/openllmetry/langgraph.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/openllmetry/openai.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/openllmetry/openllmetry.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/trace/trace.py +0 -0
- {agentkernel-0.2.14 → agentkernel-0.3.0}/src/agentkernel/whatsapp.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: agentkernel
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Agent Kernel - Unified AI Agents Runtime
|
|
5
5
|
Author: Yaala Labs
|
|
6
6
|
Author-email: Yaala Labs <agentkernel@yaalalabs.com>
|
|
@@ -38,6 +38,7 @@ Requires-Dist: langchain-community~=0.4.1 ; extra == 'langgraph'
|
|
|
38
38
|
Requires-Dist: litellm~=1.74.9 ; extra == 'langgraph'
|
|
39
39
|
Requires-Dist: fastmcp>=2.12.4 ; extra == 'mcp'
|
|
40
40
|
Requires-Dist: httpx>=0.27.0 ; extra == 'messenger'
|
|
41
|
+
Requires-Dist: litellm>=1.74.9 ; extra == 'multimodal'
|
|
41
42
|
Requires-Dist: openai-agents>=0.6.5 ; extra == 'openai'
|
|
42
43
|
Requires-Dist: openinference-instrumentation-openai-agents>=1.4.0 ; extra == 'openai'
|
|
43
44
|
Requires-Dist: openai-guardrails>=0.2.1 ; extra == 'openai'
|
|
@@ -73,6 +74,7 @@ Provides-Extra: langfuse
|
|
|
73
74
|
Provides-Extra: langgraph
|
|
74
75
|
Provides-Extra: mcp
|
|
75
76
|
Provides-Extra: messenger
|
|
77
|
+
Provides-Extra: multimodal
|
|
76
78
|
Provides-Extra: openai
|
|
77
79
|
Provides-Extra: openllmetry
|
|
78
80
|
Provides-Extra: redis
|
|
@@ -263,6 +265,32 @@ OpenAIModule([assistant])
|
|
|
263
265
|
handler = Lambda.handler
|
|
264
266
|
```
|
|
265
267
|
|
|
268
|
+
**Note that this is just the simple serverless version. A more advanced serverless deployment mode, which uses queues for scalability, is also available. For queue-backed execution modes and response-store configuration, see the [AWS Serverless Deployment](https://github.com/yaalalabs/agent-kernel/tree/develop/docs/docs/deployment/aws-serverless.md) guide.**
|
|
269
|
+
|
|
270
|
+
The AWS serverless handler accepts both a direct `BaseRunRequest` payload and the normalized `BaseRequest` envelope. If a flat run payload is provided, Agent Kernel generates a `request_id` and normalizes it before processing.
|
|
271
|
+
|
|
272
|
+
Accepted payloads:
|
|
273
|
+
|
|
274
|
+
```json
|
|
275
|
+
{
|
|
276
|
+
"prompt": "Hello agent",
|
|
277
|
+
"agent": "assistant",
|
|
278
|
+
"session_id": "user-123"
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
```json
|
|
283
|
+
{
|
|
284
|
+
"request_id": "req-123",
|
|
285
|
+
"user_id": "user-123",
|
|
286
|
+
"body": {
|
|
287
|
+
"prompt": "Hello agent",
|
|
288
|
+
"agent": "assistant",
|
|
289
|
+
"session_id": "user-123"
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
266
294
|
### Azure Functions Deployment
|
|
267
295
|
|
|
268
296
|
Deploy your agents as Azure Functions using the built-in Azure handler.
|
|
@@ -284,11 +312,18 @@ handler = AzureFunctions.handler
|
|
|
284
312
|
|
|
285
313
|
```json
|
|
286
314
|
{
|
|
287
|
-
"
|
|
288
|
-
"
|
|
315
|
+
"request_id": "req-123",
|
|
316
|
+
"user_id": "user-123",
|
|
317
|
+
"body": {
|
|
318
|
+
"prompt": "Hello agent",
|
|
319
|
+
"agent": "assistant",
|
|
320
|
+
"session_id": "user-123"
|
|
321
|
+
}
|
|
289
322
|
}
|
|
290
323
|
```
|
|
291
324
|
|
|
325
|
+
Azure Functions also accepts the normalized envelope, and flat run payloads are normalized in the same way before the request reaches the agent runtime.
|
|
326
|
+
|
|
292
327
|
**Response Format:**
|
|
293
328
|
|
|
294
329
|
```json
|
|
@@ -369,6 +404,72 @@ Required when `session.type=redis`:
|
|
|
369
404
|
- **Description**: Key prefix for session storage
|
|
370
405
|
- **Environment Variable**: `AK_SESSION__REDIS__PREFIX`
|
|
371
406
|
|
|
407
|
+
#### Execution Configuration
|
|
408
|
+
|
|
409
|
+
Configure queue-backed and serverless execution behavior.
|
|
410
|
+
|
|
411
|
+
- **Execution Mode**
|
|
412
|
+
- **Field**: `execution.mode`
|
|
413
|
+
- **Options**: `rest_sync`, `rest_async`, `stream`, `async`
|
|
414
|
+
- **Default**: `None`
|
|
415
|
+
- **Description**: Selects the Lambda execution mode
|
|
416
|
+
- **Environment Variable**: `AK_EXECUTION__MODE`
|
|
417
|
+
|
|
418
|
+
- **Queues**
|
|
419
|
+
- **Field**: `execution.queues`
|
|
420
|
+
- **Description**: Queue settings used by serverless execution modes
|
|
421
|
+
|
|
422
|
+
- **Input Queue URL**
|
|
423
|
+
- **Field**: `execution.queues.input.url`
|
|
424
|
+
- **Default**: `None`
|
|
425
|
+
- **Environment Variable**: `AK_EXECUTION__QUEUES__INPUT__URL`
|
|
426
|
+
|
|
427
|
+
- **Output Queue URL**
|
|
428
|
+
- **Field**: `execution.queues.output.url`
|
|
429
|
+
- **Default**: `None`
|
|
430
|
+
- **Environment Variable**: `AK_EXECUTION__QUEUES__OUTPUT__URL`
|
|
431
|
+
|
|
432
|
+
- **Input Queue Max Receive Count**
|
|
433
|
+
- **Field**: `execution.queues.input.max_receive_count`
|
|
434
|
+
- **Default**: `3`
|
|
435
|
+
- **Environment Variable**: `AK_EXECUTION__QUEUES__INPUT__MAX_RECEIVE_COUNT`
|
|
436
|
+
|
|
437
|
+
- **Output Queue Max Receive Count**
|
|
438
|
+
- **Field**: `execution.queues.output.max_receive_count`
|
|
439
|
+
- **Default**: `3`
|
|
440
|
+
- **Environment Variable**: `AK_EXECUTION__QUEUES__OUTPUT__MAX_RECEIVE_COUNT`
|
|
441
|
+
|
|
442
|
+
- **Response Store**
|
|
443
|
+
- **Field**: `execution.response_store`
|
|
444
|
+
- **Description**: Response persistence settings used by the serverless response handler
|
|
445
|
+
|
|
446
|
+
- **Type**
|
|
447
|
+
- **Field**: `execution.response_store.type`
|
|
448
|
+
- **Description**: Response store backend selector configured in `config.yaml`; this value is not exported as an environment variable
|
|
449
|
+
|
|
450
|
+
- **Retry Count**
|
|
451
|
+
- **Field**: `execution.response_store.retry_count`
|
|
452
|
+
- **Default**: `5`
|
|
453
|
+
- **Description**: Number of lookup attempts when polling for a response
|
|
454
|
+
- **Environment Variable**: `AK_EXECUTION__RESPONSE_STORE__RETRY_COUNT`
|
|
455
|
+
|
|
456
|
+
- **Delay**
|
|
457
|
+
- **Field**: `execution.response_store.delay`
|
|
458
|
+
- **Default**: `5`
|
|
459
|
+
- **Description**: Delay in seconds between response lookup attempts
|
|
460
|
+
- **Environment Variable**: `AK_EXECUTION__RESPONSE_STORE__DELAY`
|
|
461
|
+
|
|
462
|
+
- **Redis Backend**
|
|
463
|
+
- **Field**: `execution.response_store.redis`
|
|
464
|
+
- **Environment Variables**: `AK_EXECUTION__RESPONSE_STORE__REDIS__URL`, `AK_EXECUTION__RESPONSE_STORE__REDIS__PREFIX`, `AK_EXECUTION__RESPONSE_STORE__REDIS__TTL`
|
|
465
|
+
|
|
466
|
+
- **DynamoDB Backend**
|
|
467
|
+
- **Field**: `execution.response_store.dynamodb`
|
|
468
|
+
- **Environment Variables**: `AK_EXECUTION__RESPONSE_STORE__DYNAMODB__TABLE_NAME`, `AK_EXECUTION__RESPONSE_STORE__DYNAMODB__TTL`
|
|
469
|
+
- **Description**: DynamoDB-backed response storage with table name and TTL
|
|
470
|
+
|
|
471
|
+
Use either Redis or DynamoDB for the response store backend. The runtime accepts `BaseRunRequest` payloads directly, normalizes them internally when queueing is required, and uses `request_id` plus optional `user_id` as SQS message attributes.
|
|
472
|
+
|
|
372
473
|
#### API Configuration
|
|
373
474
|
|
|
374
475
|
Configure the REST API server (if using the API module).
|
|
@@ -862,6 +963,27 @@ session:
|
|
|
862
963
|
url: redis://localhost:6379
|
|
863
964
|
ttl: 604800
|
|
864
965
|
prefix: "ak:sessions:"
|
|
966
|
+
execution:
|
|
967
|
+
mode: rest_sync
|
|
968
|
+
queues:
|
|
969
|
+
input:
|
|
970
|
+
url: https://sqs.<region>.amazonaws.com/<accountno>/<queuename>
|
|
971
|
+
max_receive_count: 3
|
|
972
|
+
output:
|
|
973
|
+
url: https://sqs.<region>.amazonaws.com/<accountno>/<queuename>
|
|
974
|
+
max_receive_count: 3
|
|
975
|
+
response_store:
|
|
976
|
+
type: redis
|
|
977
|
+
retry_count: 5
|
|
978
|
+
delay: 5
|
|
979
|
+
redis: # if this is given, then dynamodb response store part cannot be given
|
|
980
|
+
url: redis://localhost:6379
|
|
981
|
+
prefix: "ak:responses:"
|
|
982
|
+
ttl: 3600
|
|
983
|
+
dynamodb: # if this is given, then redis response store part cannot be given
|
|
984
|
+
table_name: table-name
|
|
985
|
+
table_arn: table-arn
|
|
986
|
+
ttl: 3600
|
|
865
987
|
api:
|
|
866
988
|
host: 0.0.0.0
|
|
867
989
|
port: 8000
|
|
@@ -178,6 +178,32 @@ OpenAIModule([assistant])
|
|
|
178
178
|
handler = Lambda.handler
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
+
**Note that this is just the simple serverless version. A more advanced serverless deployment mode, which uses queues for scalability, is also available. For queue-backed execution modes and response-store configuration, see the [AWS Serverless Deployment](https://github.com/yaalalabs/agent-kernel/tree/develop/docs/docs/deployment/aws-serverless.md) guide.**
|
|
182
|
+
|
|
183
|
+
The AWS serverless handler accepts both a direct `BaseRunRequest` payload and the normalized `BaseRequest` envelope. If a flat run payload is provided, Agent Kernel generates a `request_id` and normalizes it before processing.
|
|
184
|
+
|
|
185
|
+
Accepted payloads:
|
|
186
|
+
|
|
187
|
+
```json
|
|
188
|
+
{
|
|
189
|
+
"prompt": "Hello agent",
|
|
190
|
+
"agent": "assistant",
|
|
191
|
+
"session_id": "user-123"
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"request_id": "req-123",
|
|
198
|
+
"user_id": "user-123",
|
|
199
|
+
"body": {
|
|
200
|
+
"prompt": "Hello agent",
|
|
201
|
+
"agent": "assistant",
|
|
202
|
+
"session_id": "user-123"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
181
207
|
### Azure Functions Deployment
|
|
182
208
|
|
|
183
209
|
Deploy your agents as Azure Functions using the built-in Azure handler.
|
|
@@ -199,11 +225,18 @@ handler = AzureFunctions.handler
|
|
|
199
225
|
|
|
200
226
|
```json
|
|
201
227
|
{
|
|
202
|
-
"
|
|
203
|
-
"
|
|
228
|
+
"request_id": "req-123",
|
|
229
|
+
"user_id": "user-123",
|
|
230
|
+
"body": {
|
|
231
|
+
"prompt": "Hello agent",
|
|
232
|
+
"agent": "assistant",
|
|
233
|
+
"session_id": "user-123"
|
|
234
|
+
}
|
|
204
235
|
}
|
|
205
236
|
```
|
|
206
237
|
|
|
238
|
+
Azure Functions also accepts the normalized envelope, and flat run payloads are normalized in the same way before the request reaches the agent runtime.
|
|
239
|
+
|
|
207
240
|
**Response Format:**
|
|
208
241
|
|
|
209
242
|
```json
|
|
@@ -284,6 +317,72 @@ Required when `session.type=redis`:
|
|
|
284
317
|
- **Description**: Key prefix for session storage
|
|
285
318
|
- **Environment Variable**: `AK_SESSION__REDIS__PREFIX`
|
|
286
319
|
|
|
320
|
+
#### Execution Configuration
|
|
321
|
+
|
|
322
|
+
Configure queue-backed and serverless execution behavior.
|
|
323
|
+
|
|
324
|
+
- **Execution Mode**
|
|
325
|
+
- **Field**: `execution.mode`
|
|
326
|
+
- **Options**: `rest_sync`, `rest_async`, `stream`, `async`
|
|
327
|
+
- **Default**: `None`
|
|
328
|
+
- **Description**: Selects the Lambda execution mode
|
|
329
|
+
- **Environment Variable**: `AK_EXECUTION__MODE`
|
|
330
|
+
|
|
331
|
+
- **Queues**
|
|
332
|
+
- **Field**: `execution.queues`
|
|
333
|
+
- **Description**: Queue settings used by serverless execution modes
|
|
334
|
+
|
|
335
|
+
- **Input Queue URL**
|
|
336
|
+
- **Field**: `execution.queues.input.url`
|
|
337
|
+
- **Default**: `None`
|
|
338
|
+
- **Environment Variable**: `AK_EXECUTION__QUEUES__INPUT__URL`
|
|
339
|
+
|
|
340
|
+
- **Output Queue URL**
|
|
341
|
+
- **Field**: `execution.queues.output.url`
|
|
342
|
+
- **Default**: `None`
|
|
343
|
+
- **Environment Variable**: `AK_EXECUTION__QUEUES__OUTPUT__URL`
|
|
344
|
+
|
|
345
|
+
- **Input Queue Max Receive Count**
|
|
346
|
+
- **Field**: `execution.queues.input.max_receive_count`
|
|
347
|
+
- **Default**: `3`
|
|
348
|
+
- **Environment Variable**: `AK_EXECUTION__QUEUES__INPUT__MAX_RECEIVE_COUNT`
|
|
349
|
+
|
|
350
|
+
- **Output Queue Max Receive Count**
|
|
351
|
+
- **Field**: `execution.queues.output.max_receive_count`
|
|
352
|
+
- **Default**: `3`
|
|
353
|
+
- **Environment Variable**: `AK_EXECUTION__QUEUES__OUTPUT__MAX_RECEIVE_COUNT`
|
|
354
|
+
|
|
355
|
+
- **Response Store**
|
|
356
|
+
- **Field**: `execution.response_store`
|
|
357
|
+
- **Description**: Response persistence settings used by the serverless response handler
|
|
358
|
+
|
|
359
|
+
- **Type**
|
|
360
|
+
- **Field**: `execution.response_store.type`
|
|
361
|
+
- **Description**: Response store backend selector configured in `config.yaml`; this value is not exported as an environment variable
|
|
362
|
+
|
|
363
|
+
- **Retry Count**
|
|
364
|
+
- **Field**: `execution.response_store.retry_count`
|
|
365
|
+
- **Default**: `5`
|
|
366
|
+
- **Description**: Number of lookup attempts when polling for a response
|
|
367
|
+
- **Environment Variable**: `AK_EXECUTION__RESPONSE_STORE__RETRY_COUNT`
|
|
368
|
+
|
|
369
|
+
- **Delay**
|
|
370
|
+
- **Field**: `execution.response_store.delay`
|
|
371
|
+
- **Default**: `5`
|
|
372
|
+
- **Description**: Delay in seconds between response lookup attempts
|
|
373
|
+
- **Environment Variable**: `AK_EXECUTION__RESPONSE_STORE__DELAY`
|
|
374
|
+
|
|
375
|
+
- **Redis Backend**
|
|
376
|
+
- **Field**: `execution.response_store.redis`
|
|
377
|
+
- **Environment Variables**: `AK_EXECUTION__RESPONSE_STORE__REDIS__URL`, `AK_EXECUTION__RESPONSE_STORE__REDIS__PREFIX`, `AK_EXECUTION__RESPONSE_STORE__REDIS__TTL`
|
|
378
|
+
|
|
379
|
+
- **DynamoDB Backend**
|
|
380
|
+
- **Field**: `execution.response_store.dynamodb`
|
|
381
|
+
- **Environment Variables**: `AK_EXECUTION__RESPONSE_STORE__DYNAMODB__TABLE_NAME`, `AK_EXECUTION__RESPONSE_STORE__DYNAMODB__TTL`
|
|
382
|
+
- **Description**: DynamoDB-backed response storage with table name and TTL
|
|
383
|
+
|
|
384
|
+
Use either Redis or DynamoDB for the response store backend. The runtime accepts `BaseRunRequest` payloads directly, normalizes them internally when queueing is required, and uses `request_id` plus optional `user_id` as SQS message attributes.
|
|
385
|
+
|
|
287
386
|
#### API Configuration
|
|
288
387
|
|
|
289
388
|
Configure the REST API server (if using the API module).
|
|
@@ -777,6 +876,27 @@ session:
|
|
|
777
876
|
url: redis://localhost:6379
|
|
778
877
|
ttl: 604800
|
|
779
878
|
prefix: "ak:sessions:"
|
|
879
|
+
execution:
|
|
880
|
+
mode: rest_sync
|
|
881
|
+
queues:
|
|
882
|
+
input:
|
|
883
|
+
url: https://sqs.<region>.amazonaws.com/<accountno>/<queuename>
|
|
884
|
+
max_receive_count: 3
|
|
885
|
+
output:
|
|
886
|
+
url: https://sqs.<region>.amazonaws.com/<accountno>/<queuename>
|
|
887
|
+
max_receive_count: 3
|
|
888
|
+
response_store:
|
|
889
|
+
type: redis
|
|
890
|
+
retry_count: 5
|
|
891
|
+
delay: 5
|
|
892
|
+
redis: # if this is given, then dynamodb response store part cannot be given
|
|
893
|
+
url: redis://localhost:6379
|
|
894
|
+
prefix: "ak:responses:"
|
|
895
|
+
ttl: 3600
|
|
896
|
+
dynamodb: # if this is given, then redis response store part cannot be given
|
|
897
|
+
table_name: table-name
|
|
898
|
+
table_arn: table-arn
|
|
899
|
+
ttl: 3600
|
|
780
900
|
api:
|
|
781
901
|
host: 0.0.0.0
|
|
782
902
|
port: 8000
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "agentkernel"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.0"
|
|
8
8
|
description = "Agent Kernel - Unified AI Agents Runtime"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12,<3.14"
|
|
@@ -115,6 +115,9 @@ a2a = [
|
|
|
115
115
|
mcp = [
|
|
116
116
|
"fastmcp>=2.12.4",
|
|
117
117
|
]
|
|
118
|
+
multimodal = [
|
|
119
|
+
"litellm>=1.74.9",
|
|
120
|
+
]
|
|
118
121
|
|
|
119
122
|
[project.scripts]
|
|
120
123
|
ak = "agentkernel.cli.ak:main"
|
|
@@ -15,6 +15,7 @@ from agentkernel.core.model import (
|
|
|
15
15
|
AgentRequestFile,
|
|
16
16
|
AgentRequestImage,
|
|
17
17
|
AgentRequestText,
|
|
18
|
+
BaseRunRequest,
|
|
18
19
|
)
|
|
19
20
|
|
|
20
21
|
from ..core import AgentService, Config
|
|
@@ -67,12 +68,9 @@ class AgentRESTRequestHandler(RESTRequestHandler):
|
|
|
67
68
|
name: str
|
|
68
69
|
mime_type: Optional[str] = None
|
|
69
70
|
|
|
70
|
-
class RunRequest(
|
|
71
|
+
class RunRequest(BaseRunRequest):
|
|
71
72
|
model_config = ConfigDict(extra="allow")
|
|
72
73
|
|
|
73
|
-
prompt: str
|
|
74
|
-
agent: Optional[str] = None
|
|
75
|
-
session_id: Optional[str] = None
|
|
76
74
|
files: Optional[List["AgentRESTRequestHandler.FileData"]] = None
|
|
77
75
|
images: Optional[List["AgentRESTRequestHandler.ImageData"]] = None
|
|
78
76
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .auth import *
|
|
@@ -24,7 +24,7 @@ from .model import (
|
|
|
24
24
|
)
|
|
25
25
|
from .config import AKConfig as Config
|
|
26
26
|
from .module import Module
|
|
27
|
-
from .runtime import Runtime
|
|
27
|
+
from .runtime import Runtime
|
|
28
28
|
from .service import AgentService
|
|
29
29
|
from .hooks import PreHook, PostHook
|
|
30
30
|
from .tool import ToolContext, ToolBuilder
|
|
@@ -6,8 +6,6 @@ from collections.abc import Iterator
|
|
|
6
6
|
from enum import Enum
|
|
7
7
|
from typing import Any, ClassVar, Self, cast
|
|
8
8
|
|
|
9
|
-
from deprecated import deprecated
|
|
10
|
-
|
|
11
9
|
from .hooks import PostHook, PreHook
|
|
12
10
|
from .model import AgentReply, AgentRequest
|
|
13
11
|
from .util.key_value_cache import KeyValueCache
|
|
@@ -42,12 +40,6 @@ class Session:
|
|
|
42
40
|
VOLATILE_CACHE = "v_cache"
|
|
43
41
|
NON_VOLATILE_CACHE = "nv_cache"
|
|
44
42
|
|
|
45
|
-
VOLATILE_CACHE_KEY: str = Keys.VOLATILE_CACHE.value
|
|
46
|
-
"""Deprecated since 0.2.12, use Session.Keys.VOLATILE_CACHE.value instead."""
|
|
47
|
-
|
|
48
|
-
NON_VOLATILE_CACHE_KEY: str = Keys.NON_VOLATILE_CACHE.value
|
|
49
|
-
"""Deprecated since 0.2.12, use Session.Keys.NON_VOLATILE_CACHE.value instead."""
|
|
50
|
-
|
|
51
43
|
current_session: ClassVar[contextvars.ContextVar[Self | None]] = contextvars.ContextVar("current_session", default=None)
|
|
52
44
|
|
|
53
45
|
@classmethod
|
|
@@ -58,16 +50,6 @@ class Session:
|
|
|
58
50
|
"""
|
|
59
51
|
return cls.current_session.get()
|
|
60
52
|
|
|
61
|
-
@classmethod
|
|
62
|
-
@deprecated(version="0.2.12", reason="Use Session.current() instead.")
|
|
63
|
-
def get_current_session_id(cls) -> str:
|
|
64
|
-
"""
|
|
65
|
-
Returns the current session identifier from the context variable.
|
|
66
|
-
:return: The current session identifier.
|
|
67
|
-
"""
|
|
68
|
-
session = cls.current()
|
|
69
|
-
return session.id if session else ""
|
|
70
|
-
|
|
71
53
|
def __init__(self, id: str):
|
|
72
54
|
"""
|
|
73
55
|
Initializes a Session instance.
|
|
@@ -150,14 +132,6 @@ class Session:
|
|
|
150
132
|
self._log.debug(f"Retrieved session data object for key {key}: {result}")
|
|
151
133
|
return result
|
|
152
134
|
|
|
153
|
-
@deprecated(version="0.2.12", reason="Use get_all() instead.")
|
|
154
|
-
def get_all_keys(self):
|
|
155
|
-
"""
|
|
156
|
-
Returns a list of all keys in the session data.
|
|
157
|
-
:return: A list of all keys in the session data.
|
|
158
|
-
"""
|
|
159
|
-
return self._data.keys()
|
|
160
|
-
|
|
161
135
|
def get_all(self, durable: bool = True, volatile: bool = True) -> Iterator[tuple[str, Any]]:
|
|
162
136
|
"""
|
|
163
137
|
Returns all session data objects.
|
|
@@ -214,22 +188,6 @@ class Session:
|
|
|
214
188
|
self.get_volatile_cache().clear()
|
|
215
189
|
self.get_non_volatile_cache().clear()
|
|
216
190
|
|
|
217
|
-
@deprecated(version="0.2.12", reason="Use async with on the session to acquire it.")
|
|
218
|
-
def set_context(self):
|
|
219
|
-
"""
|
|
220
|
-
Sets the current session context variable to this session.
|
|
221
|
-
"""
|
|
222
|
-
self._token = Session.current_session.set(self)
|
|
223
|
-
|
|
224
|
-
@deprecated(version="0.2.12", reason="Use async with on the session to acquire it.")
|
|
225
|
-
def reset_context(self):
|
|
226
|
-
"""
|
|
227
|
-
Resets the current session context variable to the previous value.
|
|
228
|
-
"""
|
|
229
|
-
if self._token:
|
|
230
|
-
Session.current_session.reset(self._token)
|
|
231
|
-
self._token = None
|
|
232
|
-
|
|
233
191
|
|
|
234
192
|
class Runner(ABC):
|
|
235
193
|
"""
|
|
@@ -330,42 +288,32 @@ class Agent(ABC):
|
|
|
330
288
|
"""
|
|
331
289
|
return self._post_hooks
|
|
332
290
|
|
|
333
|
-
@
|
|
334
|
-
|
|
335
|
-
reason="Use Agent.pre_hooks.extend() instead. Note that unlike attach_pre_hooks(), extend() does not perform duplicate checking.",
|
|
336
|
-
)
|
|
337
|
-
def attach_pre_hooks(self, hooks: list[PreHook]):
|
|
291
|
+
@abstractmethod
|
|
292
|
+
def get_description(self) -> str:
|
|
338
293
|
"""
|
|
339
|
-
|
|
340
|
-
Duplicate hook objects are ignored to prevent multiple registrations
|
|
341
|
-
of the same hook.
|
|
342
|
-
:param hooks: List of pre-execution hooks to attach.
|
|
294
|
+
Returns the description of the agent.
|
|
343
295
|
"""
|
|
344
|
-
|
|
345
|
-
if hook not in self._pre_hooks:
|
|
346
|
-
self._pre_hooks.append(hook)
|
|
296
|
+
pass
|
|
347
297
|
|
|
348
|
-
@
|
|
349
|
-
|
|
350
|
-
reason="Use Agent.post_hooks.extend() instead. Note that unlike attach_post_hooks(), extend() does not perform duplicate checking.",
|
|
351
|
-
)
|
|
352
|
-
def attach_post_hooks(self, hooks: list[PostHook]):
|
|
298
|
+
@abstractmethod
|
|
299
|
+
def override_system_prompt(self, prompt: str) -> None:
|
|
353
300
|
"""
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
301
|
+
Appends additional instructions to the agent's system prompt.
|
|
302
|
+
|
|
303
|
+
Called by ``_setup_system_prompt()`` at init time to inject system-level
|
|
304
|
+
tool instructions (e.g., multimodal attachment analysis guidance).
|
|
305
|
+
|
|
306
|
+
:param prompt: The instruction text to append.
|
|
358
307
|
"""
|
|
359
|
-
|
|
360
|
-
if hook not in self._post_hooks:
|
|
361
|
-
self._post_hooks.append(hook)
|
|
308
|
+
raise NotImplementedError()
|
|
362
309
|
|
|
363
310
|
@abstractmethod
|
|
364
|
-
def
|
|
311
|
+
def attach_tool(self, tool: Any) -> None:
|
|
365
312
|
"""
|
|
366
|
-
|
|
313
|
+
Attaches a tool to the agent.
|
|
314
|
+
:param tool: The tool to attach.
|
|
367
315
|
"""
|
|
368
|
-
|
|
316
|
+
raise NotImplementedError()
|
|
369
317
|
|
|
370
318
|
@abstractmethod
|
|
371
319
|
def get_a2a_card(self) -> Any:
|
|
@@ -373,3 +321,22 @@ class Agent(ABC):
|
|
|
373
321
|
Returns the A2A AgentCard associated with the agent.
|
|
374
322
|
"""
|
|
375
323
|
pass
|
|
324
|
+
|
|
325
|
+
def _setup_system_prompt(self) -> None:
|
|
326
|
+
"""
|
|
327
|
+
Appends system-defined instructions to the agent's prompt during initialization.
|
|
328
|
+
Should be invoked by subclasses in their initialization process after configuration.
|
|
329
|
+
"""
|
|
330
|
+
from agentkernel.core.tool import SystemToolFactory
|
|
331
|
+
|
|
332
|
+
suffix = SystemToolFactory.get_system_prompt_suffix()
|
|
333
|
+
self.override_system_prompt(prompt=suffix)
|
|
334
|
+
|
|
335
|
+
def _attach_system_tools(self) -> None:
|
|
336
|
+
"""
|
|
337
|
+
Attaches system-level tools to the agent during initialization.
|
|
338
|
+
"""
|
|
339
|
+
from agentkernel.core.tool import SystemToolFactory
|
|
340
|
+
|
|
341
|
+
for tool in SystemToolFactory.get_all():
|
|
342
|
+
self.attach_tool(tool.func)
|
|
@@ -3,6 +3,7 @@ from typing import List, Optional
|
|
|
3
3
|
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
6
|
+
from .model import ExecutionMode
|
|
6
7
|
from .util.config_yaml_util import YamlBaseSettingsModified
|
|
7
8
|
|
|
8
9
|
|
|
@@ -62,7 +63,7 @@ class _APIConfig(BaseModel):
|
|
|
62
63
|
port: int = Field(default=8000, description="API port")
|
|
63
64
|
enabled_routes: _RoutesConfig = Field(description="API route flags", default_factory=_RoutesConfig)
|
|
64
65
|
custom_router_prefix: str = Field(default="/custom", description="Custom router prefix")
|
|
65
|
-
max_file_size: int = Field(default=
|
|
66
|
+
max_file_size: int = Field(default=20971520, description="Maximum file size in bytes (default: 20 MB)")
|
|
66
67
|
|
|
67
68
|
|
|
68
69
|
class _A2AConfig(BaseModel):
|
|
@@ -131,6 +132,43 @@ class _GmailConfig(BaseModel):
|
|
|
131
132
|
label_filter: str = Field(default="INBOX", description="Gmail label to monitor (e.g., INBOX, UNREAD)")
|
|
132
133
|
|
|
133
134
|
|
|
135
|
+
class _MultimodalStorageRedisConfig(BaseModel):
|
|
136
|
+
url: str = Field(default="redis://localhost:6379", description="Redis connection URL")
|
|
137
|
+
ttl: int = Field(default=604800, description="Attachment TTL in seconds")
|
|
138
|
+
prefix: str = Field(default="ak:attachments:", description="Key prefix for attachment keys")
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class _MultimodalStorageDynamoDBConfig(BaseModel):
|
|
142
|
+
table_name: str = Field(default="ak-attachments", description="DynamoDB table name for attachment storage")
|
|
143
|
+
ttl: int = Field(default=604800, description="Attachment TTL in seconds (0 disables)")
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class _MultimodalConfig(BaseModel):
|
|
147
|
+
"""Configuration for multimodal attachment memory."""
|
|
148
|
+
|
|
149
|
+
enabled: bool = Field(
|
|
150
|
+
default=False,
|
|
151
|
+
description="Enable multimodal memory for images and files.",
|
|
152
|
+
)
|
|
153
|
+
storage_type: str = Field(
|
|
154
|
+
default="in_memory",
|
|
155
|
+
pattern="^(session_cache|in_memory|redis|dynamodb)$",
|
|
156
|
+
description="Storage backend for multimodal attachments. Options: session_cache, in_memory, redis, dynamodb",
|
|
157
|
+
)
|
|
158
|
+
max_attachments: int = Field(default=20, description="Maximum number of attachments to keep per session")
|
|
159
|
+
description_max_length: int = Field(default=200, description="Maximum length of attachment description text")
|
|
160
|
+
description_model: str = Field(
|
|
161
|
+
default="gpt-4o",
|
|
162
|
+
description="LiteLLM model used to generate brief descriptions when an attachment is first received (called by the pre-hook)",
|
|
163
|
+
)
|
|
164
|
+
analysis_model: str = Field(
|
|
165
|
+
default="gpt-4o",
|
|
166
|
+
description="LiteLLM model used by the analyze_attachments tool when the agent requests a full analysis of an attachment",
|
|
167
|
+
)
|
|
168
|
+
redis: Optional[_MultimodalStorageRedisConfig] = None
|
|
169
|
+
dynamodb: Optional[_MultimodalStorageDynamoDBConfig] = None
|
|
170
|
+
|
|
171
|
+
|
|
134
172
|
class _TraceConfig(BaseModel):
|
|
135
173
|
enabled: bool = Field(default=False, description="Enable tracing")
|
|
136
174
|
type: str = Field(default="langfuse", pattern="^(langfuse|openllmetry)$")
|
|
@@ -162,6 +200,57 @@ class _GuardrailConfig(BaseModel):
|
|
|
162
200
|
output: _GuardrailParamConfig = Field(description="Output Guardrail configuration", default_factory=_GuardrailParamConfig)
|
|
163
201
|
|
|
164
202
|
|
|
203
|
+
class _ResponseStoreRedisConfig(_RedisConfig):
|
|
204
|
+
prefix: str = Field(default="ak:responses:", description="Key prefix for Redis response storage")
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
class _ResponseStoreDynamoDBConfig(_DynamoDBConfig):
|
|
208
|
+
table_name: Optional[str] = Field(
|
|
209
|
+
default=None,
|
|
210
|
+
description="DynamoDB table name for session storage.",
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
class _ResponseStoreConfig(BaseModel):
|
|
215
|
+
type: str = Field(default=None, pattern="^(redis|dynamodb)$")
|
|
216
|
+
retry_count: int = Field(default=5, description="Number of retry attempts for response store reads")
|
|
217
|
+
delay: float = Field(default=5, description="Delay in seconds between response store reads retry attempts")
|
|
218
|
+
redis: Optional[_ResponseStoreRedisConfig] = None
|
|
219
|
+
dynamodb: Optional[_ResponseStoreDynamoDBConfig] = None
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
class _InputQueueConfig(BaseModel):
|
|
223
|
+
url: str = Field(default="", description="Input SQS queue URL for async execution mode")
|
|
224
|
+
max_receive_count: int = Field(
|
|
225
|
+
default=3, description="Maximum number of times a message can be received from input queue before being treated as permanently failed"
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
class _OutputQueueConfig(BaseModel):
|
|
230
|
+
url: str = Field(default="", description="Output SQS queue URL for async execution mode")
|
|
231
|
+
max_receive_count: int = Field(
|
|
232
|
+
default=3, description="Maximum number of times a message can be received from output queue before being treated as permanently failed"
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
class _QueuesConfig(BaseModel):
|
|
237
|
+
input: _InputQueueConfig = Field(default_factory=_InputQueueConfig, description="Input SQS queue configuration for async execution mode")
|
|
238
|
+
output: _OutputQueueConfig = Field(default_factory=_OutputQueueConfig, description="Output SQS queue configuration for async execution mode")
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
class _ExecutionConfig(BaseModel):
|
|
242
|
+
mode: Optional[ExecutionMode] = Field(
|
|
243
|
+
default=None,
|
|
244
|
+
description="Execution mode: rest_sync for synchronous REST, rest_async for asynchronous REST",
|
|
245
|
+
)
|
|
246
|
+
queues: Optional[_QueuesConfig] = Field(default_factory=_QueuesConfig, description="Queue URLs for async execution mode")
|
|
247
|
+
# websocket_connection_table: Optional[str] = Field(default=None, description="DynamoDB table name for storing WebSocket connections")
|
|
248
|
+
response_store: Optional[_ResponseStoreConfig] = Field(
|
|
249
|
+
default=None,
|
|
250
|
+
description="Response storage configuration for async execution mode",
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
|
|
165
254
|
class AKConfig(YamlBaseSettingsModified):
|
|
166
255
|
debug: bool = Field(default=False, description="Enable debug mode")
|
|
167
256
|
session: _SessionStoreConfig = Field(
|
|
@@ -180,10 +269,12 @@ class AKConfig(YamlBaseSettingsModified):
|
|
|
180
269
|
instagram: _InstagramConfig = Field(description="Instagram Business API related configurations", default_factory=_InstagramConfig)
|
|
181
270
|
telegram: _TelegramConfig = Field(description="Telegram Bot related configurations", default_factory=_TelegramConfig)
|
|
182
271
|
gmail: _GmailConfig = Field(description="Gmail related configurations", default_factory=_GmailConfig)
|
|
272
|
+
multimodal: _MultimodalConfig = Field(description="Multimodal attachment memory configurations", default_factory=_MultimodalConfig)
|
|
183
273
|
|
|
184
274
|
trace: _TraceConfig = Field(description="Tracing related configurations", default_factory=_TraceConfig)
|
|
185
275
|
test: _TestConfig = Field(description="Test related configurations", default_factory=_TestConfig)
|
|
186
276
|
guardrail: _GuardrailConfig = Field(description="Guardrail related configurations", default_factory=_GuardrailConfig)
|
|
277
|
+
execution: _ExecutionConfig = Field(description="Execution mode and queue related configurations", default_factory=_ExecutionConfig)
|
|
187
278
|
library_version: str = Field(default=_get_ak_version(), description="Library version")
|
|
188
279
|
|
|
189
280
|
@classmethod
|