agentkit-sdk-python 0.1.15__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentkit_sdk_python-0.1.15/agentkit_sdk_python.egg-info → agentkit_sdk_python-0.2.1}/PKG-INFO +7 -6
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/a2a_app/a2a_app.py +78 -3
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/agent_server_app/agent_server_app.py +21 -2
- agentkit_sdk_python-0.2.1/agentkit/apps/agent_server_app/middleware.py +75 -0
- agentkit_sdk_python-0.2.1/agentkit/apps/agent_server_app/telemetry.py +130 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/mcp_app/mcp_app.py +19 -1
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/client/base_agentkit_client.py +3 -6
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/client/base_iam_client.py +3 -5
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/client/base_service_client.py +15 -3
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/knowledge/__init__.py +1 -1
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/knowledge/types.py +105 -108
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/mcp/types.py +401 -361
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/memory/types.py +144 -147
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/runtime/client.py +63 -39
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/runtime/types.py +322 -270
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/tools/types.py +197 -135
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/builders/local_docker.py +2 -2
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/builders/ve_pipeline.py +11 -6
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli.py +13 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli_config.py +24 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli_init.py +12 -0
- agentkit_sdk_python-0.2.1/agentkit/toolkit/cli/cli_knowledge.py +635 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli_launch.py +47 -1
- agentkit_sdk_python-0.2.1/agentkit/toolkit/cli/cli_memory.py +914 -0
- agentkit_sdk_python-0.2.1/agentkit/toolkit/cli/cli_runtime.py +720 -0
- agentkit_sdk_python-0.2.1/agentkit/toolkit/cli/cli_tools.py +1025 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/interactive_config.py +43 -10
- agentkit_sdk_python-0.2.1/agentkit/toolkit/cli/utils.py +269 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/config/__init__.py +4 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/config/config.py +2 -2
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/config/config_handler.py +42 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/config/config_validator.py +61 -8
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/config/constants.py +3 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/config/global_config.py +12 -29
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/config/strategy_configs.py +108 -0
- agentkit_sdk_python-0.2.1/agentkit/toolkit/config/utils.py +173 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/docker/__init__.py +1 -8
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/docker/dockerfile/__init__.py +0 -2
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/executors/init_executor.py +19 -1
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/executors/lifecycle_executor.py +0 -17
- agentkit_sdk_python-0.2.1/agentkit/toolkit/resources/samples/__pycache__/customer_support_assistant.cpython-312.pyc +0 -0
- agentkit_sdk_python-0.2.1/agentkit/toolkit/resources/samples/__pycache__/financial_analyst.cpython-312.pyc +0 -0
- agentkit_sdk_python-0.2.1/agentkit/toolkit/resources/samples/__pycache__/simple_app_veadk.cpython-312.pyc +0 -0
- agentkit_sdk_python-0.2.1/agentkit/toolkit/resources/samples/__pycache__/simple_mcp_veadk.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/a2a.py +6 -3
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/runners/local_docker.py +1 -1
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/runners/ve_agentkit.py +191 -33
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/strategies/cloud_strategy.py +12 -2
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/strategies/hybrid_strategy.py +12 -2
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/strategies/local_strategy.py +9 -2
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/utils/__init__.py +1 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/__init__.py +3 -3
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/cr.py +0 -1
- agentkit_sdk_python-0.2.1/agentkit/utils/global_config_io.py +118 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/utils/misc.py +18 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/utils/ve_sign.py +106 -27
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/version.py +1 -1
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1/agentkit_sdk_python.egg-info}/PKG-INFO +7 -6
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit_sdk_python.egg-info/SOURCES.txt +11 -0
- agentkit_sdk_python-0.2.1/agentkit_sdk_python.egg-info/requires.txt +29 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/pyproject.toml +8 -7
- agentkit_sdk_python-0.1.15/agentkit/toolkit/cli/utils.py +0 -69
- agentkit_sdk_python-0.1.15/agentkit/toolkit/config/utils.py +0 -54
- agentkit_sdk_python-0.1.15/agentkit_sdk_python.egg-info/requires.txt +0 -26
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/LICENSE +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/MANIFEST.in +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/README.md +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/a2a_app/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/a2a_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/agent_server_app/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/base_app.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/mcp_app/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/mcp_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/simple_app/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/simple_app/simple_app.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/simple_app/simple_app_handlers.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/simple_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/apps/utils.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/client/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/account/client.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/account/types.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/identity/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/identity/auth.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/knowledge/client.py +29 -29
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/mcp/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/mcp/client.py +50 -50
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/memory/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/memory/client.py +32 -32
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/runtime/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/tools/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/sdk/tools/client.py +32 -32
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/builders/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/builders/base.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/__main__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli_build.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli_deploy.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli_destroy.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli_invoke.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli_status.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/cli_version.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/cli/console_reporter.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/config/dataclass_utils.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/config/docker_build_config.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/context.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/docker/container.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/docker/dockerfile/manager.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/docker/dockerfile/metadata.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/errors.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/executors/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/executors/base_executor.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/executors/build_executor.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/executors/deploy_executor.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/executors/invoke_executor.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/executors/status_executor.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/models.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/reporter.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/basic.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/basic_stream.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/customer_support_assistant.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/eino_a2a/agent.go +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/eino_a2a/build.sh +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/eino_a2a/go.mod +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/eino_a2a/go.sum +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/eino_a2a/main.go +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/financial_analyst.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/simple_app_veadk.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/samples/simple_mcp_veadk.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/templates/code-pipeline-tos-cr-step.j2 +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/templates/golang/Dockerfile.j2 +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/templates/python/Dockerfile.j2 +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/wrappers/wrapper_basic.py.jinja2 +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/resources/wrappers/wrapper_stream.py.jinja2 +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/runners/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/runners/base.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/bindings/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/bindings/memory.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/builder.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/client.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/config.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/deployer.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/initializer.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/invoker.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/lifecycle.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/sdk/status.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/strategies/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/strategies/base_strategy.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/utils/agent_parser.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/code_pipeline.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/iam.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/services/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/services/cr_service.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/services/tos_service.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/sts.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/toolkit/volcengine/utils/project_archiver.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/utils/credential.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/utils/logging_config.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/utils/request.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/utils/template_utils.py +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit_sdk_python.egg-info/dependency_links.txt +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit_sdk_python.egg-info/entry_points.txt +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit_sdk_python.egg-info/top_level.txt +0 -0
- {agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/setup.cfg +0 -0
{agentkit_sdk_python-0.1.15/agentkit_sdk_python.egg-info → agentkit_sdk_python-0.2.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentkit-sdk-python
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Python SDK for transforming any AI agent into a production-ready application. Framework-agnostic primitives for runtime, memory, authentication, and tools with volcengine-managed infrastructure.
|
|
5
5
|
Author-email: Xiangrui Cheng <innsdcc@gmail.com>, Yumeng Bao <baoyumeng.123@gmail.com>, Yaozheng Fang <fangyozheng@gmail.com>, Guodong Li <cu.eric.lee@gmail.com>
|
|
6
6
|
License: Apache License
|
|
@@ -220,14 +220,15 @@ License-File: LICENSE
|
|
|
220
220
|
Requires-Dist: a2a-sdk>=0.3.7
|
|
221
221
|
Requires-Dist: fastapi>=0.117.1
|
|
222
222
|
Requires-Dist: fastmcp>=2.12.3
|
|
223
|
-
Requires-Dist: opentelemetry-api
|
|
224
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-common
|
|
225
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc
|
|
226
|
-
Requires-Dist: opentelemetry-sdk
|
|
223
|
+
Requires-Dist: opentelemetry-api<=1.37.0,>=1.32.1
|
|
224
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-common<=1.37.0,>=1.32.1
|
|
225
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc<=1.37.0,>=1.32.1
|
|
226
|
+
Requires-Dist: opentelemetry-sdk<=1.37.0,>=1.32.1
|
|
227
227
|
Requires-Dist: pydantic>=2.11.9
|
|
228
228
|
Requires-Dist: requests>=2.32.5
|
|
229
229
|
Requires-Dist: uvicorn>=0.37.0
|
|
230
230
|
Requires-Dist: pyyaml
|
|
231
|
+
Requires-Dist: python-dotenv>=1.1.0
|
|
231
232
|
Requires-Dist: prompt_toolkit
|
|
232
233
|
Requires-Dist: typer
|
|
233
234
|
Requires-Dist: rich
|
|
@@ -236,7 +237,7 @@ Requires-Dist: jinja2
|
|
|
236
237
|
Requires-Dist: tos>=2.8.7
|
|
237
238
|
Requires-Dist: volcengine
|
|
238
239
|
Requires-Dist: pyfiglet>=1.0.2
|
|
239
|
-
Requires-Dist:
|
|
240
|
+
Requires-Dist: pyreadline3; sys_platform == "win32"
|
|
240
241
|
Provides-Extra: extensions
|
|
241
242
|
Provides-Extra: toolkit
|
|
242
243
|
Provides-Extra: dev
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
15
|
import logging
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
import os
|
|
18
17
|
import uvicorn
|
|
18
|
+
import inspect
|
|
19
|
+
|
|
20
|
+
from typing import Callable, override
|
|
19
21
|
from a2a.server.agent_execution import AgentExecutor
|
|
20
22
|
from a2a.server.agent_execution.context import RequestContext
|
|
21
23
|
from a2a.server.apps import A2AStarletteApplication
|
|
@@ -24,9 +26,13 @@ from a2a.server.request_handlers import DefaultRequestHandler
|
|
|
24
26
|
from a2a.server.tasks import InMemoryTaskStore
|
|
25
27
|
from a2a.server.tasks.task_store import TaskStore
|
|
26
28
|
from a2a.types import AgentCard
|
|
29
|
+
from starlette.applications import Starlette
|
|
30
|
+
from starlette.responses import JSONResponse, Response
|
|
31
|
+
from starlette.routing import Route
|
|
32
|
+
from starlette.requests import Request
|
|
27
33
|
|
|
28
|
-
from agentkit.apps.base_app import BaseAgentkitApp
|
|
29
34
|
from agentkit.apps.a2a_app.telemetry import telemetry
|
|
35
|
+
from agentkit.apps.base_app import BaseAgentkitApp
|
|
30
36
|
|
|
31
37
|
logger = logging.getLogger(__name__)
|
|
32
38
|
|
|
@@ -69,6 +75,7 @@ class AgentkitA2aApp(BaseAgentkitApp):
|
|
|
69
75
|
|
|
70
76
|
self._agent_executor: AgentExecutor | None = None
|
|
71
77
|
self._task_store: TaskStore | None = None
|
|
78
|
+
self._ping_func: Callable | None = None
|
|
72
79
|
|
|
73
80
|
def agent_executor(self, **kwargs) -> Callable:
|
|
74
81
|
"""Wrap an AgentExecutor class, init it, then bind it to the app instance."""
|
|
@@ -111,6 +118,70 @@ class AgentkitA2aApp(BaseAgentkitApp):
|
|
|
111
118
|
|
|
112
119
|
return wrapper
|
|
113
120
|
|
|
121
|
+
def ping(self, func: Callable) -> Callable:
|
|
122
|
+
"""Register a zero-argument health check function and expose it via GET /ping.
|
|
123
|
+
|
|
124
|
+
The function must accept no arguments and should return either a string or a dict.
|
|
125
|
+
The response shape mirrors SimpleApp: {"status": <str|dict>}.
|
|
126
|
+
"""
|
|
127
|
+
# Ensure zero-argument function similar to SimpleApp
|
|
128
|
+
if len(list(inspect.signature(func).parameters.keys())) != 0:
|
|
129
|
+
raise AssertionError(
|
|
130
|
+
f"Health check function `{func.__name__}` should not receive any arguments."
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
self._ping_func = func
|
|
134
|
+
return func
|
|
135
|
+
|
|
136
|
+
def _format_ping_status(self, result: str | dict) -> dict:
|
|
137
|
+
# Align behavior with SimpleApp: always wrap into {"status": result}
|
|
138
|
+
if isinstance(result, (str, dict)):
|
|
139
|
+
return {"status": result}
|
|
140
|
+
logger.error(
|
|
141
|
+
f"Health check function {getattr(self._ping_func, '__name__', 'unknown')} must return `dict` or `str` type."
|
|
142
|
+
)
|
|
143
|
+
return {"status": "error", "message": "Invalid response type."}
|
|
144
|
+
|
|
145
|
+
async def ping_endpoint(self, request: Request) -> Response:
|
|
146
|
+
if not self._ping_func:
|
|
147
|
+
logger.error("Ping handler function is not set")
|
|
148
|
+
return Response(status_code=404)
|
|
149
|
+
|
|
150
|
+
try:
|
|
151
|
+
result = (
|
|
152
|
+
await self._ping_func()
|
|
153
|
+
if inspect.iscoroutinefunction(self._ping_func)
|
|
154
|
+
else self._ping_func()
|
|
155
|
+
)
|
|
156
|
+
payload = self._format_ping_status(result)
|
|
157
|
+
return JSONResponse(content=payload)
|
|
158
|
+
except Exception as e:
|
|
159
|
+
logger.exception("Ping handler function failed: %s", e)
|
|
160
|
+
return JSONResponse(
|
|
161
|
+
content={"status": "error", "message": str(e)},
|
|
162
|
+
status_code=500,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
def add_env_detect_route(self, app: Starlette):
|
|
166
|
+
def is_agentkit_runtime() -> bool:
|
|
167
|
+
if os.getenv("RUNTIME_IAM_ROLE_TRN", ""):
|
|
168
|
+
return True
|
|
169
|
+
else:
|
|
170
|
+
return False
|
|
171
|
+
|
|
172
|
+
route = Route(
|
|
173
|
+
"/env",
|
|
174
|
+
endpoint=lambda request: JSONResponse(
|
|
175
|
+
{"env": "agentkit" if is_agentkit_runtime() else "veadk"}
|
|
176
|
+
),
|
|
177
|
+
methods=["GET"],
|
|
178
|
+
name="env_detect",
|
|
179
|
+
)
|
|
180
|
+
app.routes.append(route)
|
|
181
|
+
|
|
182
|
+
def add_ping_route(self, app: Starlette):
|
|
183
|
+
app.add_route("/ping", self.ping_endpoint, methods=["GET"])
|
|
184
|
+
|
|
114
185
|
@override
|
|
115
186
|
def run(self, agent_card: AgentCard, host: str, port: int = 8000):
|
|
116
187
|
if not self._agent_executor:
|
|
@@ -130,4 +201,8 @@ class AgentkitA2aApp(BaseAgentkitApp):
|
|
|
130
201
|
),
|
|
131
202
|
).build()
|
|
132
203
|
|
|
204
|
+
# Register routes in the same style
|
|
205
|
+
self.add_ping_route(a2a_app)
|
|
206
|
+
self.add_env_detect_route(a2a_app)
|
|
207
|
+
|
|
133
208
|
uvicorn.run(a2a_app, host=host, port=port)
|
|
@@ -19,6 +19,7 @@ import json
|
|
|
19
19
|
from fastapi import Request
|
|
20
20
|
from fastapi import HTTPException
|
|
21
21
|
from fastapi.responses import StreamingResponse
|
|
22
|
+
from opentelemetry import trace
|
|
22
23
|
from google.adk.agents.base_agent import BaseAgent
|
|
23
24
|
from google.adk.artifacts.in_memory_artifact_service import (
|
|
24
25
|
InMemoryArtifactService,
|
|
@@ -41,6 +42,8 @@ from veadk import Agent
|
|
|
41
42
|
from veadk.memory.short_term_memory import ShortTermMemory
|
|
42
43
|
|
|
43
44
|
from agentkit.apps.base_app import BaseAgentkitApp
|
|
45
|
+
from agentkit.apps.agent_server_app.telemetry import telemetry
|
|
46
|
+
from agentkit.apps.agent_server_app.middleware import AgentkitTelemetryHTTPMiddleware
|
|
44
47
|
|
|
45
48
|
|
|
46
49
|
class AgentKitAgentLoader(BaseAgentLoader):
|
|
@@ -87,7 +90,13 @@ class AgentkitAgentServerApp(BaseAgentkitApp):
|
|
|
87
90
|
|
|
88
91
|
self.app = self.server.get_fast_api_app()
|
|
89
92
|
|
|
93
|
+
# Attach ASGI middleware for unified telemetry across all routes
|
|
94
|
+
self.app.add_middleware(AgentkitTelemetryHTTPMiddleware)
|
|
95
|
+
|
|
90
96
|
async def _invoke_compat(request: Request):
|
|
97
|
+
# Use current request span from middleware for telemetry
|
|
98
|
+
span = trace.get_current_span()
|
|
99
|
+
|
|
91
100
|
# Extract headers (fallback keys supported)
|
|
92
101
|
headers = request.headers
|
|
93
102
|
user_id = (
|
|
@@ -95,8 +104,7 @@ class AgentkitAgentServerApp(BaseAgentkitApp):
|
|
|
95
104
|
)
|
|
96
105
|
session_id = (
|
|
97
106
|
headers.get("session_id")
|
|
98
|
-
or
|
|
99
|
-
or "agentkit_sample_session"
|
|
107
|
+
or ""
|
|
100
108
|
)
|
|
101
109
|
|
|
102
110
|
# Determine app_name from loader
|
|
@@ -126,6 +134,14 @@ class AgentkitAgentServerApp(BaseAgentkitApp):
|
|
|
126
134
|
text = ""
|
|
127
135
|
content = types.UserContent(parts=[types.Part(text=text or "")])
|
|
128
136
|
|
|
137
|
+
# trace request attributes on current span
|
|
138
|
+
telemetry.trace_agent_server(
|
|
139
|
+
func_name="_invoke_compat",
|
|
140
|
+
span=span,
|
|
141
|
+
headers=dict(headers),
|
|
142
|
+
text=text or "",
|
|
143
|
+
)
|
|
144
|
+
|
|
129
145
|
# Ensure session exists
|
|
130
146
|
session = await self.server.session_service.get_session(
|
|
131
147
|
app_name=app_name, user_id=user_id, session_id=session_id
|
|
@@ -154,8 +170,11 @@ class AgentkitAgentServerApp(BaseAgentkitApp):
|
|
|
154
170
|
)
|
|
155
171
|
+ "\n\n"
|
|
156
172
|
)
|
|
173
|
+
# finish span on successful end of stream handled by middleware
|
|
174
|
+
pass
|
|
157
175
|
except Exception as e:
|
|
158
176
|
yield f'data: {{"error": "{str(e)}"}}\n\n'
|
|
177
|
+
telemetry.trace_agent_server_finish(func_result="", exception=e)
|
|
159
178
|
|
|
160
179
|
return StreamingResponse(
|
|
161
180
|
event_generator(),
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from typing import Callable
|
|
16
|
+
|
|
17
|
+
from opentelemetry import trace
|
|
18
|
+
from opentelemetry import context as context_api
|
|
19
|
+
|
|
20
|
+
from agentkit.apps.agent_server_app.telemetry import telemetry
|
|
21
|
+
|
|
22
|
+
_EXCLUDED_HEADERS = {"authorization", "token"}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class AgentkitTelemetryHTTPMiddleware:
|
|
26
|
+
def __init__(self, app: Callable):
|
|
27
|
+
self.app = app
|
|
28
|
+
|
|
29
|
+
async def __call__(self, scope, receive, send):
|
|
30
|
+
print(f"test: {scope}")
|
|
31
|
+
if scope["type"] != "http":
|
|
32
|
+
return await self.app(scope, receive, send)
|
|
33
|
+
|
|
34
|
+
method = scope.get("method", "")
|
|
35
|
+
path = scope.get("path", "")
|
|
36
|
+
headers_list = scope.get("headers", [])
|
|
37
|
+
headers = {k.decode("latin-1"): v.decode("latin-1") for k, v in headers_list}
|
|
38
|
+
span = telemetry.tracer.start_span(name="agent_server_request")
|
|
39
|
+
ctx = trace.set_span_in_context(span)
|
|
40
|
+
context_api.attach(ctx)
|
|
41
|
+
headers = {
|
|
42
|
+
k: v for k, v in headers.items() if k.lower() not in _EXCLUDED_HEADERS
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
# Currently unable to retrieve user_id and session_id from headers; keep logic for future use
|
|
46
|
+
user_id = headers.get("user_id")
|
|
47
|
+
session_id = headers.get("session_id")
|
|
48
|
+
headers["user_id"] = user_id
|
|
49
|
+
headers["session_id"] = session_id
|
|
50
|
+
telemetry.trace_agent_server(
|
|
51
|
+
func_name=f"{method} {path}",
|
|
52
|
+
span=span,
|
|
53
|
+
headers=headers,
|
|
54
|
+
text="", # do not consume body in middleware
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
async def send_wrapper(message):
|
|
58
|
+
try:
|
|
59
|
+
if message.get("type") == "http.response.body":
|
|
60
|
+
more_body = message.get("more_body", False)
|
|
61
|
+
if not more_body:
|
|
62
|
+
telemetry.trace_agent_server_finish(
|
|
63
|
+
path=path, func_result="", exception=None
|
|
64
|
+
)
|
|
65
|
+
elif message.get("type") == "http.response.start":
|
|
66
|
+
# could record status code if needed
|
|
67
|
+
pass
|
|
68
|
+
finally:
|
|
69
|
+
await send(message)
|
|
70
|
+
|
|
71
|
+
try:
|
|
72
|
+
await self.app(scope, receive, send_wrapper)
|
|
73
|
+
except Exception as e:
|
|
74
|
+
telemetry.trace_agent_server_finish(path=path, func_result="", exception=e)
|
|
75
|
+
raise
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
import logging
|
|
16
|
+
import time
|
|
17
|
+
from typing import Optional
|
|
18
|
+
|
|
19
|
+
from opentelemetry import trace
|
|
20
|
+
from opentelemetry.trace import get_tracer
|
|
21
|
+
from opentelemetry.metrics import get_meter
|
|
22
|
+
from opentelemetry.trace.span import Span
|
|
23
|
+
|
|
24
|
+
from agentkit.apps.utils import safe_serialize_to_json_string
|
|
25
|
+
|
|
26
|
+
_INVOKE_PATH = ["/run_sse", "/run", "/invoke"]
|
|
27
|
+
|
|
28
|
+
_GEN_AI_CLIENT_OPERATION_DURATION_BUCKETS = [
|
|
29
|
+
0.01,
|
|
30
|
+
0.02,
|
|
31
|
+
0.04,
|
|
32
|
+
0.08,
|
|
33
|
+
0.16,
|
|
34
|
+
0.32,
|
|
35
|
+
0.64,
|
|
36
|
+
1.28,
|
|
37
|
+
2.56,
|
|
38
|
+
5.12,
|
|
39
|
+
10.24,
|
|
40
|
+
20.48,
|
|
41
|
+
40.96,
|
|
42
|
+
81.92,
|
|
43
|
+
163.84,
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
logger = logging.getLogger("agentkit." + __name__)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Telemetry:
|
|
50
|
+
def __init__(self):
|
|
51
|
+
self.tracer = get_tracer("agentkit.agent_server_app")
|
|
52
|
+
self.meter = get_meter("agentkit.agent_server_app")
|
|
53
|
+
self.latency_histogram = self.meter.create_histogram(
|
|
54
|
+
name="agentkit_runtime_operation_latency",
|
|
55
|
+
description="operation latency",
|
|
56
|
+
unit="s",
|
|
57
|
+
explicit_bucket_boundaries_advisory=_GEN_AI_CLIENT_OPERATION_DURATION_BUCKETS,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
def trace_agent_server(
|
|
61
|
+
self,
|
|
62
|
+
func_name: str,
|
|
63
|
+
span: Span,
|
|
64
|
+
headers: dict,
|
|
65
|
+
text: str,
|
|
66
|
+
) -> None:
|
|
67
|
+
span.set_attribute(key="gen_ai.system", value="agentkit")
|
|
68
|
+
span.set_attribute(key="gen_ai.func_name", value=func_name)
|
|
69
|
+
|
|
70
|
+
span.set_attribute(
|
|
71
|
+
key="gen_ai.request.headers",
|
|
72
|
+
value=safe_serialize_to_json_string(headers),
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
session_id = headers.get("session_id")
|
|
76
|
+
if session_id:
|
|
77
|
+
span.set_attribute(key="gen_ai.session.id", value=session_id)
|
|
78
|
+
user_id = headers.get("user_id")
|
|
79
|
+
if user_id:
|
|
80
|
+
span.set_attribute(key="gen_ai.user.id", value=user_id)
|
|
81
|
+
|
|
82
|
+
# Currently unable to retrieve input
|
|
83
|
+
# span.set_attribute(
|
|
84
|
+
# key="gen_ai.input", value=safe_serialize_to_json_string(text)
|
|
85
|
+
# )
|
|
86
|
+
|
|
87
|
+
span.set_attribute(key="gen_ai.span.kind", value="agent_server")
|
|
88
|
+
span.set_attribute(key="gen_ai.operation.name", value="invoke_agent")
|
|
89
|
+
span.set_attribute(key="gen_ai.operation.type", value="agent_server")
|
|
90
|
+
|
|
91
|
+
def trace_agent_server_finish(
|
|
92
|
+
self,
|
|
93
|
+
path: str,
|
|
94
|
+
func_result: str,
|
|
95
|
+
exception: Optional[Exception],
|
|
96
|
+
) -> None:
|
|
97
|
+
span = trace.get_current_span()
|
|
98
|
+
if span and span.is_recording():
|
|
99
|
+
# Currently unable to retrieve output
|
|
100
|
+
# span.set_attribute(key="gen_ai.output", value=func_result)
|
|
101
|
+
|
|
102
|
+
attributes = {
|
|
103
|
+
"gen_ai_operation_name": "invoke_agent",
|
|
104
|
+
"gen_ai_operation_type": "agent_server",
|
|
105
|
+
}
|
|
106
|
+
if exception:
|
|
107
|
+
self.handle_exception(span, exception)
|
|
108
|
+
attributes["error_type"] = exception.__class__.__name__
|
|
109
|
+
|
|
110
|
+
# only record invoke request latency metrics
|
|
111
|
+
if (
|
|
112
|
+
hasattr(span, "start_time")
|
|
113
|
+
and self.latency_histogram
|
|
114
|
+
and path in _INVOKE_PATH
|
|
115
|
+
):
|
|
116
|
+
duration = (time.time_ns() - span.start_time) / 1e9 # type: ignore
|
|
117
|
+
self.latency_histogram.record(duration, attributes)
|
|
118
|
+
span.end()
|
|
119
|
+
|
|
120
|
+
@staticmethod
|
|
121
|
+
def handle_exception(span: trace.Span, exception: Exception) -> None:
|
|
122
|
+
status = trace.Status(
|
|
123
|
+
status_code=trace.StatusCode.ERROR,
|
|
124
|
+
description=f"{type(exception).__name__}: {exception}",
|
|
125
|
+
)
|
|
126
|
+
span.set_status(status)
|
|
127
|
+
span.record_exception(exception)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
telemetry = Telemetry()
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import inspect
|
|
17
17
|
import logging
|
|
18
|
+
import os
|
|
18
19
|
from functools import wraps
|
|
19
20
|
from typing import Any, Callable, override
|
|
20
21
|
|
|
@@ -142,8 +143,25 @@ class AgentkitMCPApp(BaseAgentkitApp):
|
|
|
142
143
|
|
|
143
144
|
return func
|
|
144
145
|
|
|
146
|
+
def add_env_detect_tool(self):
|
|
147
|
+
def is_agentkit_runtime() -> bool:
|
|
148
|
+
if os.getenv("RUNTIME_IAM_ROLE_TRN", ""):
|
|
149
|
+
return True
|
|
150
|
+
else:
|
|
151
|
+
return False
|
|
152
|
+
|
|
153
|
+
def get_env() -> dict:
|
|
154
|
+
return {"env": "agentkit" if is_agentkit_runtime() else "veadk"}
|
|
155
|
+
|
|
156
|
+
self._mcp_server.tool(get_env)
|
|
157
|
+
|
|
145
158
|
@override
|
|
146
159
|
def run(
|
|
147
|
-
self,
|
|
160
|
+
self,
|
|
161
|
+
host: str,
|
|
162
|
+
port: int = 8000,
|
|
163
|
+
transport: Transport = "streamable-http",
|
|
148
164
|
) -> None:
|
|
165
|
+
self.add_env_detect_tool()
|
|
166
|
+
|
|
149
167
|
self._mcp_server.run(host=host, port=port, transport=transport)
|
{agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/client/base_agentkit_client.py
RENAMED
|
@@ -20,8 +20,7 @@ Provides common initialization and API invocation logic.
|
|
|
20
20
|
from typing import Any, Dict, Union, Optional
|
|
21
21
|
|
|
22
22
|
from agentkit.client.base_service_client import BaseServiceClient, ApiConfig
|
|
23
|
-
from agentkit.utils.ve_sign import get_volc_agentkit_host_info
|
|
24
|
-
from agentkit.toolkit.config.global_config import get_global_config
|
|
23
|
+
from agentkit.utils.ve_sign import get_volc_agentkit_host_info, get_volc_agentkit_scheme
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
class BaseAgentkitClient(BaseServiceClient):
|
|
@@ -78,13 +77,11 @@ class BaseAgentkitClient(BaseServiceClient):
|
|
|
78
77
|
Dictionary with host, api_version, and service
|
|
79
78
|
"""
|
|
80
79
|
host, api_version, service = get_volc_agentkit_host_info()
|
|
81
|
-
gc = get_global_config()
|
|
82
|
-
scheme = gc.agentkit_schema or "https"
|
|
83
80
|
return {
|
|
84
|
-
"host":
|
|
81
|
+
"host": host,
|
|
85
82
|
"api_version": api_version,
|
|
86
83
|
"service": service,
|
|
87
|
-
"scheme":
|
|
84
|
+
"scheme": get_volc_agentkit_scheme(),
|
|
88
85
|
}
|
|
89
86
|
|
|
90
87
|
def _get(self, api_action: str, params: Dict[str, Any] = None) -> str:
|
|
@@ -20,7 +20,7 @@ Uses the same volcengine.base.Service approach as AgentKit services.
|
|
|
20
20
|
from typing import Dict, Union
|
|
21
21
|
|
|
22
22
|
from agentkit.client.base_service_client import BaseServiceClient, ApiConfig
|
|
23
|
-
from agentkit.
|
|
23
|
+
from agentkit.utils.ve_sign import get_volc_iam_host_scheme
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class BaseIAMClient(BaseServiceClient):
|
|
@@ -79,11 +79,9 @@ class BaseIAMClient(BaseServiceClient):
|
|
|
79
79
|
Returns:
|
|
80
80
|
Dictionary with host, api_version, and service
|
|
81
81
|
"""
|
|
82
|
-
|
|
83
|
-
scheme = gc.iam_schema or "https"
|
|
84
|
-
host = gc.iam_host or self.IAM_HOST
|
|
82
|
+
host, scheme = get_volc_iam_host_scheme()
|
|
85
83
|
return {
|
|
86
|
-
"host": host,
|
|
84
|
+
"host": host or self.IAM_HOST,
|
|
87
85
|
"api_version": self.IAM_API_VERSION,
|
|
88
86
|
"service": self.IAM_SERVICE_CODE,
|
|
89
87
|
"scheme": scheme,
|
{agentkit_sdk_python-0.1.15 → agentkit_sdk_python-0.2.1}/agentkit/client/base_service_client.py
RENAMED
|
@@ -26,7 +26,10 @@ from volcengine.base.Service import Service
|
|
|
26
26
|
from volcengine.Credentials import Credentials
|
|
27
27
|
from volcengine.ServiceInfo import ServiceInfo
|
|
28
28
|
|
|
29
|
-
from agentkit.utils.ve_sign import
|
|
29
|
+
from agentkit.utils.ve_sign import (
|
|
30
|
+
get_volc_ak_sk_region,
|
|
31
|
+
ensure_x_custom_source_header,
|
|
32
|
+
)
|
|
30
33
|
|
|
31
34
|
T = TypeVar("T")
|
|
32
35
|
|
|
@@ -73,7 +76,7 @@ class BaseServiceClient(Service):
|
|
|
73
76
|
session_token: str = "",
|
|
74
77
|
service_name: str = "",
|
|
75
78
|
credential_env_prefix: str = "",
|
|
76
|
-
header: Optional[Dict[str, Any]] =
|
|
79
|
+
header: Optional[Dict[str, Any]] = None,
|
|
77
80
|
) -> None:
|
|
78
81
|
"""
|
|
79
82
|
Initialize the service client.
|
|
@@ -105,6 +108,15 @@ class BaseServiceClient(Service):
|
|
|
105
108
|
self.session_token = session_token
|
|
106
109
|
self.service_name = service_name
|
|
107
110
|
|
|
111
|
+
if header is None:
|
|
112
|
+
effective_header: Dict[str, Any] = {"Accept": "application/json"}
|
|
113
|
+
else:
|
|
114
|
+
effective_header = header.copy()
|
|
115
|
+
if "Accept" not in effective_header:
|
|
116
|
+
effective_header = {"Accept": "application/json", **effective_header}
|
|
117
|
+
|
|
118
|
+
effective_header = ensure_x_custom_source_header(effective_header)
|
|
119
|
+
|
|
108
120
|
# Get service-specific configuration from subclass
|
|
109
121
|
config = self._get_service_config()
|
|
110
122
|
self.host = config["host"]
|
|
@@ -115,7 +127,7 @@ class BaseServiceClient(Service):
|
|
|
115
127
|
# Create ServiceInfo
|
|
116
128
|
self.service_info = ServiceInfo(
|
|
117
129
|
host=self.host,
|
|
118
|
-
header=
|
|
130
|
+
header=effective_header,
|
|
119
131
|
credentials=Credentials(
|
|
120
132
|
ak=self.access_key,
|
|
121
133
|
sk=self.secret_key,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
from .client import
|
|
14
|
+
from .client import AgentkitKnowledgeClient
|
|
15
15
|
from .types import (
|
|
16
16
|
ListKnowledgeBasesRequest,
|
|
17
17
|
ListKnowledgeBasesResponse,
|