agentkernel 0.3.1__tar.gz → 0.3.2__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.3.1 → agentkernel-0.3.2}/PKG-INFO +1 -1
- {agentkernel-0.3.1 → agentkernel-0.3.2}/pyproject.toml +1 -1
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/__init__.py +1 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/core/sqs_handler.py +132 -5
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/akagentrunner.py +35 -33
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/core/default_endpoints.py +4 -12
- {agentkernel-0.3.1 → agentkernel-0.3.2}/README.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/adk.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/api/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/api/a2a/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/api/a2a/a2a.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/api/a2a/handler.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/api/handler.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/api/http.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/api/mcp/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/api/mcp/akmcp.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/auth/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/auth/handler.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/auth.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/aws.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/azure.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/cli/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/cli/ak.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/cli/cli.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/base.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/builder.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/config.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/hooks.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/model.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/module.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/factory.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/hooks.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/base.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/dynamodb.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/in_memory.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/redis.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/session_cache.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/storage_manager.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/tools.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/runtime.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/service.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/session/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/session/base.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/session/cosmosdb.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/session/dynamodb.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/session/in_memory.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/session/redis.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/session/serde.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/tool.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/util/config_yaml_util.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/util/key_value_cache.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/crewai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/core/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/core/response_store/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/core/response_store/dynamodb.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/core/response_store/handler.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/core/response_store/redis.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/akauthorizer.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/aklambda.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/akresponsehandler.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/core/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/core/sqs_consumer.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/azure/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/azure/akfunction.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/common/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/common/chat_service.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/common/response_store.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/framework/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/framework/adk/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/framework/adk/adk.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/framework/crewai/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/framework/crewai/crewai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/framework/langgraph/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/framework/langgraph/langgraph.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/framework/openai/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/framework/openai/openai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/gmail.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/guardrail/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/guardrail/bedrock.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/guardrail/guardrail.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/guardrail/openai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/guardrail/walledai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/instagram.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/gmail/README.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/gmail/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/gmail/gmail_chat.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/instagram/README.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/instagram/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/instagram/instagram_chat.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/messenger/README.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/messenger/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/messenger/messenger_chat.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/slack/README.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/slack/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/slack/slack_chat.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/teams/README.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/teams/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/teams/teams_chat.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/telegram/README.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/telegram/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/telegram/telegram_chat.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/whatsapp/README.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/whatsapp/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/whatsapp/whatsapp_chat.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/langgraph.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/mcp.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/messenger.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/openai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-add-capabilities/SKILL.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-add-capabilities/evals/evals.json +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-add-integration/SKILL.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-add-integration/evals/evals.json +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-build/SKILL.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-build/evals/evals.json +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-cloud-deploy/SKILL.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-cloud-deploy/evals/evals.json +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-init/SKILL.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-init/evals/evals.json +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-test/SKILL.md +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-test/evals/evals.json +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/skills.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/slack.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/teams.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/telegram.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/test/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/test/test.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/base.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/langfuse/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/langfuse/adk.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/langfuse/crewai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/langfuse/langfuse.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/langfuse/langgraph.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/langfuse/openai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/openllmetry/__init__.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/openllmetry/adk.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/openllmetry/crewai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/openllmetry/langgraph.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/openllmetry/openai.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/openllmetry/openllmetry.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/trace/trace.py +0 -0
- {agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/whatsapp.py +0 -0
|
@@ -11,5 +11,6 @@ try:
|
|
|
11
11
|
except importlib.metadata.PackageNotFoundError:
|
|
12
12
|
__version__ = "0.1.0"
|
|
13
13
|
|
|
14
|
+
from .core.sqs_handler import SQSHandler
|
|
14
15
|
from .serverless import APIGatewayAuthorizer, Lambda, ResponseHandler, ServerlessAgentRunner
|
|
15
16
|
from .serverless.core import LambdaSQSConsumer
|
|
@@ -7,9 +7,22 @@ from typing import Any, Dict, Mapping, Optional
|
|
|
7
7
|
import boto3
|
|
8
8
|
from pydantic import BaseModel, ConfigDict
|
|
9
9
|
|
|
10
|
+
from ....core.config import AKConfig
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
class SQSHandler:
|
|
12
|
-
"""Shared helper for building and sending SQS messages.
|
|
14
|
+
"""Shared helper for building and sending SQS messages.
|
|
15
|
+
|
|
16
|
+
When used in a Non-Agent Kernel lambda/environment, the following environment variables
|
|
17
|
+
must be exported:
|
|
18
|
+
- AK_EXECUTION__QUEUES__INPUT__URL
|
|
19
|
+
- AK_EXECUTION__QUEUES__OUTPUT__URL
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
_sqs_client = None
|
|
23
|
+
_config = None
|
|
24
|
+
_input_queue_url = None
|
|
25
|
+
_output_queue_url = None
|
|
13
26
|
|
|
14
27
|
class AttributeDataType(str, Enum):
|
|
15
28
|
STRING = "String"
|
|
@@ -33,10 +46,38 @@ class SQSHandler:
|
|
|
33
46
|
value: Any
|
|
34
47
|
datatype: "SQSHandler.AttributeDataType"
|
|
35
48
|
|
|
36
|
-
|
|
49
|
+
@classmethod
|
|
50
|
+
def _get_config(cls):
|
|
51
|
+
"""Return a cached AKConfig instance.
|
|
52
|
+
|
|
53
|
+
:return: A lazily created AKConfig instance.
|
|
54
|
+
"""
|
|
55
|
+
if cls._config is None:
|
|
56
|
+
cls._config = AKConfig.get()
|
|
57
|
+
return cls._config
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def get_input_queue_url(cls):
|
|
61
|
+
"""Return the cached input queue URL from config.
|
|
62
|
+
|
|
63
|
+
:return: The input queue URL string.
|
|
64
|
+
"""
|
|
65
|
+
if cls._input_queue_url is None:
|
|
66
|
+
cls._input_queue_url = cls._get_config().execution.queues.input.url
|
|
67
|
+
return cls._input_queue_url
|
|
68
|
+
|
|
69
|
+
@classmethod
|
|
70
|
+
def get_output_queue_url(cls):
|
|
71
|
+
"""Return the cached output queue URL from config.
|
|
72
|
+
|
|
73
|
+
:return: The output queue URL string.
|
|
74
|
+
"""
|
|
75
|
+
if cls._output_queue_url is None:
|
|
76
|
+
cls._output_queue_url = cls._get_config().execution.queues.output.url
|
|
77
|
+
return cls._output_queue_url
|
|
37
78
|
|
|
38
79
|
@classmethod
|
|
39
|
-
def
|
|
80
|
+
def get_sqs_client(cls):
|
|
40
81
|
"""Return a cached boto3 SQS client.
|
|
41
82
|
|
|
42
83
|
:return: A lazily created boto3 SQS client instance.
|
|
@@ -196,7 +237,7 @@ class SQSHandler:
|
|
|
196
237
|
message_attributes=message_attributes,
|
|
197
238
|
**extra_kwargs,
|
|
198
239
|
)
|
|
199
|
-
return cls.
|
|
240
|
+
return cls.get_sqs_client().send_message(QueueUrl=queue_url, **message_kwargs)
|
|
200
241
|
|
|
201
242
|
@classmethod
|
|
202
243
|
def send_prepared_message(cls, queue_url: str, message_kwargs: Mapping[str, Any]):
|
|
@@ -209,7 +250,93 @@ class SQSHandler:
|
|
|
209
250
|
:param message_kwargs: A mapping of boto3 send_message keyword arguments.
|
|
210
251
|
:return: The boto3 send_message response.
|
|
211
252
|
"""
|
|
212
|
-
return cls.
|
|
253
|
+
return cls.get_sqs_client().send_message(QueueUrl=queue_url, **dict(message_kwargs))
|
|
254
|
+
|
|
255
|
+
@classmethod
|
|
256
|
+
def send_message_to_input_queue(
|
|
257
|
+
cls,
|
|
258
|
+
message_group_id: Optional[str] = None,
|
|
259
|
+
message_deduplication_id: Optional[str] = None,
|
|
260
|
+
message_body: Optional[Any] = None,
|
|
261
|
+
request_id: Optional[str] = None,
|
|
262
|
+
user_id: Optional[str] = None,
|
|
263
|
+
**extra_kwargs: Any,
|
|
264
|
+
):
|
|
265
|
+
"""Send a message to the input queue with standard custom attributes.
|
|
266
|
+
|
|
267
|
+
This method handles the common pattern of sending messages to the input queue
|
|
268
|
+
with request_id and user_id as custom message attributes.
|
|
269
|
+
|
|
270
|
+
:param message_group_id: The FIFO message group id, if required.
|
|
271
|
+
:param message_deduplication_id: The FIFO deduplication id, if required.
|
|
272
|
+
:param message_body: The payload to send.
|
|
273
|
+
:param request_id: Optional request ID custom attribute.
|
|
274
|
+
:param user_id: Optional user ID custom attribute.
|
|
275
|
+
:param extra_kwargs: Additional send_message keyword arguments to include.
|
|
276
|
+
:return: The boto3 send_message response.
|
|
277
|
+
"""
|
|
278
|
+
queue_url = cls.get_input_queue_url()
|
|
279
|
+
if not queue_url:
|
|
280
|
+
raise ValueError("Input queue URL is not configured in AKConfig")
|
|
281
|
+
|
|
282
|
+
# Build custom message attributes
|
|
283
|
+
message_attributes = []
|
|
284
|
+
if request_id is not None:
|
|
285
|
+
message_attributes.append(cls.CustomAttribute(name="request_id", value=request_id, datatype=cls.AttributeDataType.STRING))
|
|
286
|
+
if user_id is not None:
|
|
287
|
+
message_attributes.append(cls.CustomAttribute(name="user_id", value=user_id, datatype=cls.AttributeDataType.STRING))
|
|
288
|
+
|
|
289
|
+
return cls.send_message(
|
|
290
|
+
queue_url=queue_url,
|
|
291
|
+
message_body=message_body,
|
|
292
|
+
message_group_id=message_group_id,
|
|
293
|
+
message_deduplication_id=message_deduplication_id,
|
|
294
|
+
message_attributes=message_attributes if message_attributes else None,
|
|
295
|
+
**extra_kwargs,
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
@classmethod
|
|
299
|
+
def send_message_to_output_queue(
|
|
300
|
+
cls,
|
|
301
|
+
message_group_id: Optional[str] = None,
|
|
302
|
+
message_deduplication_id: Optional[str] = None,
|
|
303
|
+
message_body: Optional[Any] = None,
|
|
304
|
+
request_id: Optional[str] = None,
|
|
305
|
+
user_id: Optional[str] = None,
|
|
306
|
+
**extra_kwargs: Any,
|
|
307
|
+
):
|
|
308
|
+
"""Send a message to the output queue with standard custom attributes.
|
|
309
|
+
|
|
310
|
+
This method handles the common pattern of sending messages to the output queue
|
|
311
|
+
with request_id and user_id as custom message attributes.
|
|
312
|
+
|
|
313
|
+
:param message_group_id: The FIFO message group id, if required.
|
|
314
|
+
:param message_deduplication_id: The FIFO deduplication id, if required.
|
|
315
|
+
:param message_body: The payload to send.
|
|
316
|
+
:param request_id: Optional request ID custom attribute.
|
|
317
|
+
:param user_id: Optional user ID custom attribute.
|
|
318
|
+
:param extra_kwargs: Additional send_message keyword arguments to include.
|
|
319
|
+
:return: The boto3 send_message response.
|
|
320
|
+
"""
|
|
321
|
+
queue_url = cls.get_output_queue_url()
|
|
322
|
+
if not queue_url:
|
|
323
|
+
raise ValueError("Output queue URL is not configured in AKConfig")
|
|
324
|
+
|
|
325
|
+
# Build custom message attributes
|
|
326
|
+
message_attributes = []
|
|
327
|
+
if request_id is not None:
|
|
328
|
+
message_attributes.append(cls.CustomAttribute(name="request_id", value=request_id, datatype=cls.AttributeDataType.STRING))
|
|
329
|
+
if user_id is not None:
|
|
330
|
+
message_attributes.append(cls.CustomAttribute(name="user_id", value=user_id, datatype=cls.AttributeDataType.STRING))
|
|
331
|
+
|
|
332
|
+
return cls.send_message(
|
|
333
|
+
queue_url=queue_url,
|
|
334
|
+
message_body=message_body,
|
|
335
|
+
message_group_id=message_group_id,
|
|
336
|
+
message_deduplication_id=message_deduplication_id,
|
|
337
|
+
message_attributes=message_attributes if message_attributes else None,
|
|
338
|
+
**extra_kwargs,
|
|
339
|
+
)
|
|
213
340
|
|
|
214
341
|
|
|
215
342
|
# Tell Pydantic to resolve the string annotation for CustomAttribute.datatype after the class is fully defined, which allows us to reference AttributeDataType before it's defined in the class body.
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/akagentrunner.py
RENAMED
|
@@ -20,34 +20,29 @@ class ServerlessAgentRunner(LambdaSQSConsumer):
|
|
|
20
20
|
return cls._chat_service
|
|
21
21
|
|
|
22
22
|
@classmethod
|
|
23
|
-
def
|
|
24
|
-
return AKConfig.get().execution.queues.output.url
|
|
25
|
-
|
|
26
|
-
@classmethod
|
|
27
|
-
def _construct_queue_input_message(cls, raw_queue_message: dict, queue_input_message_body: dict) -> dict:
|
|
23
|
+
def _get_record_attributes(cls, raw_queue_message: dict) -> dict:
|
|
28
24
|
"""
|
|
29
|
-
|
|
25
|
+
Extract attributes from the raw SQS message record.
|
|
30
26
|
:param raw_queue_message: Original SQS message (``dict``) received by the Lambda function.
|
|
31
|
-
:
|
|
32
|
-
:return: Dictionary (``dict``) of parameters for ``boto3`` ``send_message`` (excluding ``QueueUrl``).
|
|
27
|
+
:return: Dictionary (``dict``) containing extracted attributes.
|
|
33
28
|
"""
|
|
34
29
|
attributes = SQSHandler.get_message_system_attributes(raw_queue_message)
|
|
35
30
|
message_attributes = SQSHandler.get_message_custom_attributes(raw_queue_message)
|
|
36
31
|
request_id = message_attributes.get("request_id")
|
|
37
32
|
user_id = message_attributes.get("user_id")
|
|
33
|
+
|
|
38
34
|
if not request_id:
|
|
39
35
|
raise ValueError("request_id is required")
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
return queue_input_message
|
|
36
|
+
|
|
37
|
+
record_attributes = {
|
|
38
|
+
"message_group_id": attributes["MessageGroupId"],
|
|
39
|
+
"message_deduplication_id": attributes.get("MessageDeduplicationId"),
|
|
40
|
+
"request_id": request_id,
|
|
41
|
+
"user_id": user_id,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
cls._log.info(f"Extracted record attributes: {record_attributes}")
|
|
45
|
+
return record_attributes
|
|
51
46
|
|
|
52
47
|
@classmethod
|
|
53
48
|
def _construct_error_message_body(cls, error_msg: str) -> dict:
|
|
@@ -59,13 +54,20 @@ class ServerlessAgentRunner(LambdaSQSConsumer):
|
|
|
59
54
|
return {"error": error_msg}
|
|
60
55
|
|
|
61
56
|
@classmethod
|
|
62
|
-
def _send_to_output_queue(cls,
|
|
57
|
+
def _send_to_output_queue(cls, message_body: dict, record_attributes: dict) -> None:
|
|
63
58
|
"""
|
|
64
|
-
Send a prepared message to the configured response SQS queue.
|
|
65
|
-
:param
|
|
59
|
+
Send a prepared message to the configured response SQS queue using send_message_to_output_queue.
|
|
60
|
+
:param message_body: Message body (``dict``) to be sent to the response queue.
|
|
61
|
+
:param record_attributes: Extracted attributes (``dict``) from the record.
|
|
66
62
|
:return: None.
|
|
67
63
|
"""
|
|
68
|
-
SQSHandler.
|
|
64
|
+
SQSHandler.send_message_to_output_queue(
|
|
65
|
+
message_group_id=record_attributes["message_group_id"],
|
|
66
|
+
message_deduplication_id=record_attributes["message_deduplication_id"],
|
|
67
|
+
message_body=message_body,
|
|
68
|
+
request_id=record_attributes["request_id"],
|
|
69
|
+
user_id=record_attributes["user_id"],
|
|
70
|
+
)
|
|
69
71
|
|
|
70
72
|
@classmethod
|
|
71
73
|
def _parse_body(cls, record: dict) -> dict:
|
|
@@ -90,15 +92,15 @@ class ServerlessAgentRunner(LambdaSQSConsumer):
|
|
|
90
92
|
if session_id != message_group_id:
|
|
91
93
|
cls._log.info(f"Session ID mismatch: message body session_id {session_id} does not match MessageGroupId {message_group_id}")
|
|
92
94
|
error_message_body = cls._construct_error_message_body(error_msg="Session ID mismatch")
|
|
93
|
-
|
|
94
|
-
cls._send_to_output_queue(
|
|
95
|
-
cls._log.info(f"Sent Session ID Mismatch message to Output Queue: '{
|
|
95
|
+
record_attributes = cls._get_record_attributes(raw_queue_message=record)
|
|
96
|
+
cls._send_to_output_queue(message_body=error_message_body, record_attributes=record_attributes)
|
|
97
|
+
cls._log.info(f"Sent Session ID Mismatch message to Output Queue: '{SQSHandler.get_output_queue_url()}'")
|
|
96
98
|
return
|
|
97
99
|
_, agent_response = cls._get_chat_service().process_chat_request(body=body)
|
|
98
100
|
cls._log.info(f"Chat service response: '{agent_response}'")
|
|
99
|
-
|
|
100
|
-
cls._send_to_output_queue(
|
|
101
|
-
cls._log.info(f"Sent Response message to Output Queue: '{
|
|
101
|
+
record_attributes = cls._get_record_attributes(raw_queue_message=record)
|
|
102
|
+
cls._send_to_output_queue(message_body=agent_response, record_attributes=record_attributes)
|
|
103
|
+
cls._log.info(f"Sent Response message to Output Queue: '{SQSHandler.get_output_queue_url()}'")
|
|
102
104
|
|
|
103
105
|
@classmethod
|
|
104
106
|
def on_permanent_failure(cls, record: dict) -> None:
|
|
@@ -110,10 +112,10 @@ class ServerlessAgentRunner(LambdaSQSConsumer):
|
|
|
110
112
|
cls._log.info(f"Permanent failure: {record}: Retried message {cls.max_receive_count} times. Sending error message to Output Queue`")
|
|
111
113
|
try:
|
|
112
114
|
error_message_body = cls._construct_error_message_body(error_msg=f"Failed to process message. Retried {cls.max_receive_count} times")
|
|
113
|
-
|
|
114
|
-
cls._send_to_output_queue(
|
|
115
|
-
cls._log.info(f"Sent Permanent Failure message to Output Queue: '{
|
|
115
|
+
record_attributes = cls._get_record_attributes(raw_queue_message=record)
|
|
116
|
+
cls._send_to_output_queue(message_body=error_message_body, record_attributes=record_attributes)
|
|
117
|
+
cls._log.info(f"Sent Permanent Failure message to Output Queue: '{SQSHandler.get_output_queue_url()}'")
|
|
116
118
|
except Exception as e:
|
|
117
119
|
# Message comes to this function only if the message has reached its maximum no of retries
|
|
118
120
|
# Catching the error here so that this message will not be returned as batchItemFailures for another retry.
|
|
119
|
-
cls._log.info(f"Failed sending permanent failure message to Output Queue '{
|
|
121
|
+
cls._log.info(f"Failed sending permanent failure message to Output Queue '{SQSHandler.get_output_queue_url()}' due to error: '{str(e)}'")
|
|
@@ -30,10 +30,6 @@ class DefaultEndpointsHandler:
|
|
|
30
30
|
def _get_execution_mode(cls):
|
|
31
31
|
return cls._get_config().execution.mode
|
|
32
32
|
|
|
33
|
-
@classmethod
|
|
34
|
-
def _get_input_queue_url(cls):
|
|
35
|
-
return cls._get_config().execution.queues.input.url
|
|
36
|
-
|
|
37
33
|
@classmethod
|
|
38
34
|
def _get_default_user_polling_method(cls):
|
|
39
35
|
return "GET" if cls._get_execution_mode() == ExecutionMode.REST_ASYNC else None
|
|
@@ -69,7 +65,7 @@ class DefaultEndpointsHandler:
|
|
|
69
65
|
:return: Dictionary mapping paths → HTTP methods → handler functions
|
|
70
66
|
"""
|
|
71
67
|
|
|
72
|
-
input_queue_url =
|
|
68
|
+
input_queue_url = SQSHandler.get_input_queue_url()
|
|
73
69
|
exec_mode = cls._get_execution_mode()
|
|
74
70
|
|
|
75
71
|
if not input_queue_url:
|
|
@@ -158,16 +154,12 @@ class DefaultEndpointsHandler:
|
|
|
158
154
|
if not session_id:
|
|
159
155
|
raise ValueError("session_id is required")
|
|
160
156
|
|
|
161
|
-
|
|
162
|
-
if payload.user_id is not None:
|
|
163
|
-
message_attributes.append(SQSHandler.CustomAttribute(name="user_id", value=payload.user_id, datatype=SQSHandler.AttributeDataType.STRING))
|
|
164
|
-
|
|
165
|
-
response = SQSHandler.send_message(
|
|
166
|
-
queue_url=cls._get_input_queue_url(),
|
|
157
|
+
response = SQSHandler.send_message_to_input_queue(
|
|
167
158
|
message_body=request_body,
|
|
168
159
|
message_group_id=session_id,
|
|
169
160
|
message_deduplication_id=payload.request_id,
|
|
170
|
-
|
|
161
|
+
request_id=payload.request_id,
|
|
162
|
+
user_id=payload.user_id,
|
|
171
163
|
)
|
|
172
164
|
return response
|
|
173
165
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/in_memory.py
RENAMED
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/session_cache.py
RENAMED
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/core/multimodal/storage/storage_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/core/response_store/redis.py
RENAMED
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/__init__.py
RENAMED
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/akauthorizer.py
RENAMED
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/aklambda.py
RENAMED
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/deployment/aws/serverless/core/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/instagram/instagram_chat.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/messenger/messenger_chat.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/telegram/telegram_chat.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/integration/whatsapp/whatsapp_chat.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-add-capabilities/evals/evals.json
RENAMED
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-add-integration/evals/evals.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{agentkernel-0.3.1 → agentkernel-0.3.2}/src/agentkernel/skills/ak-cloud-deploy/evals/evals.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|