agentkit-sdk-python 0.3.2__tar.gz → 0.3.3__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.3.2/agentkit_sdk_python.egg-info → agentkit_sdk_python-0.3.3}/PKG-INFO +2 -1
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/a2a_app/a2a_app.py +2 -1
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/agent_server_app/agent_server_app.py +1 -1
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/mcp_app/mcp_app.py +2 -1
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/simple_app/simple_app.py +2 -1
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/simple_app/simple_app_handlers.py +2 -1
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_config.py +43 -16
- agentkit_sdk_python-0.3.3/agentkit/toolkit/cli/cli_invoke.py +452 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/interactive_config.py +33 -2
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/config_validator.py +17 -1
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/global_config.py +8 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/executors/init_executor.py +17 -0
- agentkit_sdk_python-0.3.3/agentkit/toolkit/resources/samples/agent_server.py +67 -0
- agentkit_sdk_python-0.3.3/agentkit/toolkit/resources/samples/langchain_basic_stream.py +87 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/runners/base.py +4 -18
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/version.py +1 -1
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3/agentkit_sdk_python.egg-info}/PKG-INFO +2 -1
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit_sdk_python.egg-info/SOURCES.txt +2 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit_sdk_python.egg-info/requires.txt +1 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/pyproject.toml +3 -2
- agentkit_sdk_python-0.3.2/agentkit/toolkit/cli/cli_invoke.py +0 -262
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/LICENSE +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/MANIFEST.in +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/README.md +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/a2a_app/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/a2a_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/agent_server_app/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/agent_server_app/middleware.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/agent_server_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/base_app.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/mcp_app/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/mcp_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/simple_app/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/simple_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/apps/utils.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/client/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/client/base_agentkit_client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/client/base_iam_client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/client/base_service_client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/platform/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/platform/configuration.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/platform/constants.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/account/client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/account/types.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/identity/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/identity/auth.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/knowledge/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/knowledge/client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/knowledge/types.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/mcp/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/mcp/client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/mcp/types.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/memory/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/memory/client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/memory/types.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/runtime/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/runtime/client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/runtime/types.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/tools/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/tools/client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/sdk/tools/types.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/builders/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/builders/base.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/builders/local_docker.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/builders/ve_pipeline.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/__main__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_build.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_deploy.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_destroy.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_init.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_knowledge.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_launch.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_memory.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_runtime.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_status.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_tools.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/cli_version.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/console_reporter.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/utils.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/config.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/config_handler.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/constants.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/dataclass_utils.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/docker_build_config.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/region_resolver.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/strategy_configs.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/config/utils.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/context.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/docker/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/docker/container.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/docker/dockerfile/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/docker/dockerfile/manager.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/docker/dockerfile/metadata.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/docker/utils.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/errors.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/executors/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/executors/base_executor.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/executors/build_executor.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/executors/deploy_executor.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/executors/invoke_executor.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/executors/lifecycle_executor.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/executors/status_executor.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/models.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/reporter.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/__pycache__/customer_support_assistant.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/__pycache__/financial_analyst.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/__pycache__/simple_app_veadk.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/__pycache__/simple_mcp_veadk.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/a2a.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/basic.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/basic_stream.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/customer_support_assistant.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/eino_a2a/agent.go +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/eino_a2a/build.sh +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/eino_a2a/go.mod +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/eino_a2a/go.sum +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/eino_a2a/main.go +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/financial_analyst.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/simple_app_veadk.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/samples/simple_mcp_veadk.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/templates/code-pipeline-tos-cr-step.j2 +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/templates/golang/Dockerfile.j2 +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/templates/python/Dockerfile.j2 +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/wrappers/wrapper_basic.py.jinja2 +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/resources/wrappers/wrapper_stream.py.jinja2 +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/runners/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/runners/local_docker.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/runners/ve_agentkit.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/bindings/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/bindings/memory.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/builder.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/client.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/config.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/deployer.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/initializer.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/invoker.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/lifecycle.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/sdk/status.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/strategies/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/strategies/base_strategy.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/strategies/cloud_strategy.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/strategies/hybrid_strategy.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/strategies/local_strategy.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/utils/agent_parser.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/code_pipeline.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/cr.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/iam.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/services/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/services/cr_service.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/services/tos_service.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/sts.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/volcengine/utils/project_archiver.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/utils/global_config_io.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/utils/logging_config.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/utils/misc.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/utils/request.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/utils/template_utils.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/utils/ve_sign.py +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit_sdk_python.egg-info/dependency_links.txt +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit_sdk_python.egg-info/entry_points.txt +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit_sdk_python.egg-info/top_level.txt +0 -0
- {agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/setup.cfg +0 -0
{agentkit_sdk_python-0.3.2/agentkit_sdk_python.egg-info → agentkit_sdk_python-0.3.3}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentkit-sdk-python
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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
|
|
@@ -237,6 +237,7 @@ Requires-Dist: jinja2
|
|
|
237
237
|
Requires-Dist: tos>=2.8.7
|
|
238
238
|
Requires-Dist: volcengine
|
|
239
239
|
Requires-Dist: pyfiglet>=1.0.2
|
|
240
|
+
Requires-Dist: typing_extensions>=4.12
|
|
240
241
|
Requires-Dist: pyreadline3; sys_platform == "win32"
|
|
241
242
|
Provides-Extra: extensions
|
|
242
243
|
Provides-Extra: toolkit
|
|
@@ -17,7 +17,8 @@ import os
|
|
|
17
17
|
import uvicorn
|
|
18
18
|
import inspect
|
|
19
19
|
|
|
20
|
-
from typing import Callable
|
|
20
|
+
from typing import Callable
|
|
21
|
+
from typing_extensions import override
|
|
21
22
|
from a2a.server.agent_execution import AgentExecutor
|
|
22
23
|
from a2a.server.agent_execution.context import RequestContext
|
|
23
24
|
from a2a.server.apps import A2AStarletteApplication
|
|
@@ -17,7 +17,8 @@ import inspect
|
|
|
17
17
|
import logging
|
|
18
18
|
import os
|
|
19
19
|
from functools import wraps
|
|
20
|
-
from typing import Any, Callable
|
|
20
|
+
from typing import Any, Callable
|
|
21
|
+
from typing_extensions import override
|
|
21
22
|
|
|
22
23
|
from fastmcp import FastMCP
|
|
23
24
|
from fastmcp.server.server import Transport
|
|
@@ -19,7 +19,8 @@ import threading
|
|
|
19
19
|
import time
|
|
20
20
|
import uuid
|
|
21
21
|
from abc import ABC, abstractmethod
|
|
22
|
-
from typing import Any, Callable, Optional
|
|
22
|
+
from typing import Any, Callable, Optional
|
|
23
|
+
from typing_extensions import override
|
|
23
24
|
|
|
24
25
|
from starlette.requests import Request
|
|
25
26
|
from starlette.responses import JSONResponse, Response, StreamingResponse
|
|
@@ -319,6 +319,25 @@ def _interactive_config(config_file: Optional[str] = None):
|
|
|
319
319
|
console.print(f"[red]❌ Unknown launch type: {strategy_name}[/red]")
|
|
320
320
|
raise typer.Exit(1)
|
|
321
321
|
|
|
322
|
+
# When disabling strict region restrictions, default show global region
|
|
323
|
+
try:
|
|
324
|
+
from agentkit.toolkit.config.global_config import get_global_config
|
|
325
|
+
|
|
326
|
+
global_conf = get_global_config()
|
|
327
|
+
disabled = bool(
|
|
328
|
+
getattr(global_conf.defaults, "disable_region_strict_restrictions", False)
|
|
329
|
+
)
|
|
330
|
+
if disabled and isinstance(current_strategy_config_dict, dict):
|
|
331
|
+
global_region = (global_conf.region or "").strip()
|
|
332
|
+
if global_region:
|
|
333
|
+
if "region" in current_strategy_config_dict:
|
|
334
|
+
if not current_strategy_config_dict.get("region"):
|
|
335
|
+
current_strategy_config_dict["region"] = global_region
|
|
336
|
+
else:
|
|
337
|
+
current_strategy_config_dict["region"] = global_region
|
|
338
|
+
except Exception:
|
|
339
|
+
pass
|
|
340
|
+
|
|
322
341
|
# Generate new strategy config
|
|
323
342
|
strategy_config = generate_config_from_dataclass(
|
|
324
343
|
config_class, current_strategy_config_dict
|
|
@@ -472,6 +491,8 @@ def _show_global_config():
|
|
|
472
491
|
console.print(
|
|
473
492
|
f" Region: [yellow]{config.region or '[dim](not set)[/dim]'}[/yellow]"
|
|
474
493
|
)
|
|
494
|
+
if config.defaults.disable_region_strict_restrictions:
|
|
495
|
+
console.print(" Disable Region Restrictions: [yellow]True[/yellow]")
|
|
475
496
|
console.print()
|
|
476
497
|
|
|
477
498
|
# Display Volcengine credentials
|
|
@@ -581,22 +602,9 @@ def _set_global_field(field_value: str):
|
|
|
581
602
|
)
|
|
582
603
|
config_dict[section][field] = clean_value
|
|
583
604
|
elif field == "cr_public_endpoint_check":
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
if clean_value is None:
|
|
588
|
-
config_dict[section][field] = None
|
|
589
|
-
else:
|
|
590
|
-
truthy = {"true", "1", "yes", "y"}
|
|
591
|
-
falsy = {"false", "0", "no", "n"}
|
|
592
|
-
if clean_value in truthy:
|
|
593
|
-
config_dict[section][field] = True
|
|
594
|
-
elif clean_value in falsy:
|
|
595
|
-
config_dict[section][field] = False
|
|
596
|
-
else:
|
|
597
|
-
raise AttributeError(
|
|
598
|
-
f"Invalid boolean value for cr_public_endpoint_check: {value}"
|
|
599
|
-
)
|
|
605
|
+
_set_bool_field(config_dict[section], field, value)
|
|
606
|
+
elif field == "disable_region_strict_restrictions":
|
|
607
|
+
_set_bool_field(config_dict[section], field, value)
|
|
600
608
|
elif field == "iam_role_policies":
|
|
601
609
|
# Simple list parsing for CLI convenience
|
|
602
610
|
if not value:
|
|
@@ -631,3 +639,22 @@ def _set_global_field(field_value: str):
|
|
|
631
639
|
except Exception as e:
|
|
632
640
|
console.print(f"[red]❌ Failed to set config: {e}[/red]")
|
|
633
641
|
raise typer.Exit(code=1)
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
def _set_bool_field(target_dict: dict, field: str, value: str):
|
|
645
|
+
"""Helper to set boolean field from string value."""
|
|
646
|
+
clean_value = value.strip().lower() if value is not None else None
|
|
647
|
+
if clean_value == "":
|
|
648
|
+
clean_value = None
|
|
649
|
+
|
|
650
|
+
if clean_value is None:
|
|
651
|
+
target_dict[field] = None
|
|
652
|
+
else:
|
|
653
|
+
truthy = {"true", "1", "yes", "y"}
|
|
654
|
+
falsy = {"false", "0", "no", "n"}
|
|
655
|
+
if clean_value in truthy:
|
|
656
|
+
target_dict[field] = True
|
|
657
|
+
elif clean_value in falsy:
|
|
658
|
+
target_dict[field] = False
|
|
659
|
+
else:
|
|
660
|
+
raise AttributeError(f"Invalid boolean value for {field}: {value}")
|
|
@@ -0,0 +1,452 @@
|
|
|
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
|
+
"""AgentKit CLI - Invoke command implementation."""
|
|
16
|
+
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
from typing import Optional, Any
|
|
19
|
+
import json
|
|
20
|
+
import typer
|
|
21
|
+
from rich.console import Console
|
|
22
|
+
import time
|
|
23
|
+
import random
|
|
24
|
+
import uuid
|
|
25
|
+
from agentkit.toolkit.config import get_config
|
|
26
|
+
import logging
|
|
27
|
+
|
|
28
|
+
# Note: Avoid importing heavy packages at the top to keep CLI startup fast
|
|
29
|
+
logger = logging.getLogger(__name__)
|
|
30
|
+
console = Console()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _extract_text_chunks_from_langchain_event(event: dict) -> list[str]:
|
|
34
|
+
"""Extract incremental text chunks from LangChain message_to_dict-style events.
|
|
35
|
+
|
|
36
|
+
Expected shape (example):
|
|
37
|
+
{"type": "AIMessageChunk", "data": {"content": "今天", ...}}
|
|
38
|
+
"""
|
|
39
|
+
if not isinstance(event, dict):
|
|
40
|
+
return []
|
|
41
|
+
|
|
42
|
+
event_type = event.get("type")
|
|
43
|
+
data = event.get("data")
|
|
44
|
+
if not isinstance(event_type, str) or not isinstance(data, dict):
|
|
45
|
+
return []
|
|
46
|
+
|
|
47
|
+
# Most common streaming types: AIMessageChunk / HumanMessageChunk / ToolMessageChunk
|
|
48
|
+
if not (
|
|
49
|
+
event_type.endswith("MessageChunk")
|
|
50
|
+
or event_type in {"AIMessage", "HumanMessage", "ToolMessage"}
|
|
51
|
+
):
|
|
52
|
+
return []
|
|
53
|
+
|
|
54
|
+
content = data.get("content")
|
|
55
|
+
if content is None:
|
|
56
|
+
return []
|
|
57
|
+
|
|
58
|
+
# content can be a string, or a multimodal list like:
|
|
59
|
+
# [{"type":"text","text":"..."}, ...]
|
|
60
|
+
if isinstance(content, str):
|
|
61
|
+
return [content] if content else []
|
|
62
|
+
if isinstance(content, list):
|
|
63
|
+
chunks: list[str] = []
|
|
64
|
+
for item in content:
|
|
65
|
+
if isinstance(item, str) and item:
|
|
66
|
+
chunks.append(item)
|
|
67
|
+
elif isinstance(item, dict):
|
|
68
|
+
text = item.get("text")
|
|
69
|
+
if isinstance(text, str) and text:
|
|
70
|
+
chunks.append(text)
|
|
71
|
+
return chunks
|
|
72
|
+
|
|
73
|
+
return []
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _extract_reasoning_chunks_from_langchain_event(event: dict) -> list[str]:
|
|
77
|
+
"""Extract incremental reasoning chunks from LangChain events.
|
|
78
|
+
|
|
79
|
+
LangChain emit reasoning in:
|
|
80
|
+
event['data']['additional_kwargs']['reasoning_content']
|
|
81
|
+
while leaving event['data']['content'] empty.
|
|
82
|
+
"""
|
|
83
|
+
if not isinstance(event, dict):
|
|
84
|
+
return []
|
|
85
|
+
|
|
86
|
+
event_type = event.get("type")
|
|
87
|
+
data = event.get("data")
|
|
88
|
+
if not isinstance(event_type, str) or not isinstance(data, dict):
|
|
89
|
+
return []
|
|
90
|
+
|
|
91
|
+
if not (
|
|
92
|
+
event_type.endswith("MessageChunk")
|
|
93
|
+
or event_type in {"AIMessage", "HumanMessage", "ToolMessage"}
|
|
94
|
+
):
|
|
95
|
+
return []
|
|
96
|
+
|
|
97
|
+
additional_kwargs = data.get("additional_kwargs")
|
|
98
|
+
if not isinstance(additional_kwargs, dict):
|
|
99
|
+
return []
|
|
100
|
+
|
|
101
|
+
reasoning = additional_kwargs.get("reasoning_content")
|
|
102
|
+
if isinstance(reasoning, str):
|
|
103
|
+
return [reasoning] if reasoning else []
|
|
104
|
+
return []
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _extract_text_chunks_from_adk_event(event: dict) -> list[str]:
|
|
108
|
+
"""Extract incremental text chunks from Google ADK/AgentKit streaming events."""
|
|
109
|
+
if not isinstance(event, dict):
|
|
110
|
+
return []
|
|
111
|
+
|
|
112
|
+
parts: list[Any] = []
|
|
113
|
+
if isinstance(event.get("parts"), list):
|
|
114
|
+
parts = event.get("parts", [])
|
|
115
|
+
elif isinstance(event.get("message"), dict):
|
|
116
|
+
parts = event["message"].get("parts", [])
|
|
117
|
+
elif isinstance(event.get("content"), dict):
|
|
118
|
+
parts = event["content"].get("parts", [])
|
|
119
|
+
elif isinstance(event.get("status"), dict):
|
|
120
|
+
role = event["status"].get("message", {}).get("role")
|
|
121
|
+
if role == "agent":
|
|
122
|
+
parts = event["status"].get("message", {}).get("parts", [])
|
|
123
|
+
|
|
124
|
+
if not isinstance(parts, list) or not parts:
|
|
125
|
+
return []
|
|
126
|
+
|
|
127
|
+
chunks: list[str] = []
|
|
128
|
+
for part in parts:
|
|
129
|
+
text: Optional[str] = None
|
|
130
|
+
if isinstance(part, dict) and "text" in part:
|
|
131
|
+
val = part.get("text")
|
|
132
|
+
text = val if isinstance(val, str) else None
|
|
133
|
+
elif isinstance(part, str):
|
|
134
|
+
text = part
|
|
135
|
+
if text:
|
|
136
|
+
chunks.append(text)
|
|
137
|
+
return chunks
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _normalize_stream_event(event: Any) -> Optional[dict]:
|
|
141
|
+
"""Normalize an event yielded by InvokeResult.stream() to a dict.
|
|
142
|
+
|
|
143
|
+
- Runner normally yields dict (already JSON-decoded).
|
|
144
|
+
- CLI keeps a fallback path for raw SSE strings ("data: {...}").
|
|
145
|
+
"""
|
|
146
|
+
if isinstance(event, dict):
|
|
147
|
+
return event
|
|
148
|
+
if isinstance(event, str):
|
|
149
|
+
s = event.strip()
|
|
150
|
+
if not s.startswith("data: "):
|
|
151
|
+
return None
|
|
152
|
+
json_str = s[6:].strip()
|
|
153
|
+
if not json_str:
|
|
154
|
+
return None
|
|
155
|
+
try:
|
|
156
|
+
parsed = json.loads(json_str)
|
|
157
|
+
return parsed if isinstance(parsed, dict) else None
|
|
158
|
+
except json.JSONDecodeError:
|
|
159
|
+
return None
|
|
160
|
+
return None
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def build_standard_payload(message: Optional[str], payload: Optional[str]) -> dict:
|
|
164
|
+
if message:
|
|
165
|
+
return {"prompt": message}
|
|
166
|
+
else:
|
|
167
|
+
try:
|
|
168
|
+
parsed = json.loads(payload) if isinstance(payload, str) else payload
|
|
169
|
+
console.print(f"[blue]Using custom payload: {parsed}[/blue]")
|
|
170
|
+
return parsed
|
|
171
|
+
except json.JSONDecodeError as e:
|
|
172
|
+
console.print(f"[red]Error: Invalid JSON payload: {e}[/red]")
|
|
173
|
+
raise typer.Exit(1)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def build_a2a_payload(
|
|
177
|
+
message: Optional[str], payload: Optional[str], headers: dict
|
|
178
|
+
) -> dict:
|
|
179
|
+
parsed = None
|
|
180
|
+
if payload:
|
|
181
|
+
try:
|
|
182
|
+
parsed = json.loads(payload) if isinstance(payload, str) else payload
|
|
183
|
+
except json.JSONDecodeError:
|
|
184
|
+
parsed = None
|
|
185
|
+
|
|
186
|
+
if isinstance(parsed, dict) and parsed.get("jsonrpc"):
|
|
187
|
+
console.print("[blue]Using provided JSON-RPC payload for A2A[/blue]")
|
|
188
|
+
return parsed
|
|
189
|
+
|
|
190
|
+
if message:
|
|
191
|
+
text = message
|
|
192
|
+
elif parsed is not None:
|
|
193
|
+
text = json.dumps(parsed, ensure_ascii=False)
|
|
194
|
+
else:
|
|
195
|
+
text = payload if payload else ""
|
|
196
|
+
|
|
197
|
+
a2a = {
|
|
198
|
+
"jsonrpc": "2.0",
|
|
199
|
+
"method": "message/stream",
|
|
200
|
+
"params": {
|
|
201
|
+
"message": {
|
|
202
|
+
"role": "user",
|
|
203
|
+
"messageId": str(uuid.uuid4()),
|
|
204
|
+
"parts": [{"kind": "text", "text": text}],
|
|
205
|
+
},
|
|
206
|
+
"metadata": headers,
|
|
207
|
+
},
|
|
208
|
+
"id": random.randint(1, 999999),
|
|
209
|
+
}
|
|
210
|
+
return a2a
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def invoke_command(
|
|
214
|
+
config_file: Path = typer.Option("agentkit.yaml", help="Configuration file"),
|
|
215
|
+
message: str = typer.Argument(None, help="Simple message to send to agent"),
|
|
216
|
+
payload: str = typer.Option(
|
|
217
|
+
None, "--payload", "-p", help="JSON payload to send (advanced option)"
|
|
218
|
+
),
|
|
219
|
+
headers: str = typer.Option(
|
|
220
|
+
None, "--headers", "-h", help="JSON headers for request (advanced option)"
|
|
221
|
+
),
|
|
222
|
+
show_reasoning: bool = typer.Option(
|
|
223
|
+
False,
|
|
224
|
+
"--show-reasoning",
|
|
225
|
+
help="Print LangChain reasoning_content (if present) during streaming",
|
|
226
|
+
),
|
|
227
|
+
raw: bool = typer.Option(
|
|
228
|
+
False,
|
|
229
|
+
"--raw",
|
|
230
|
+
help="Print raw streaming events (and raw JSON response) for debugging",
|
|
231
|
+
),
|
|
232
|
+
apikey: str = typer.Option(
|
|
233
|
+
None, "--apikey", "-ak", help="API key for authentication"
|
|
234
|
+
),
|
|
235
|
+
) -> Any:
|
|
236
|
+
"""Send a test request to deployed Agent.
|
|
237
|
+
|
|
238
|
+
Examples:
|
|
239
|
+
# Simple message
|
|
240
|
+
agentkit invoke "What is the weather today?"
|
|
241
|
+
|
|
242
|
+
# Custom payload
|
|
243
|
+
agentkit invoke --payload '{"prompt": "What is the weather in Hangzhou?"}'
|
|
244
|
+
|
|
245
|
+
# With custom headers
|
|
246
|
+
agentkit invoke --payload '{"prompt": "What is the weather in Hangzhou?"}' --headers '{"user_id": "test123"}'
|
|
247
|
+
"""
|
|
248
|
+
from agentkit.toolkit.executors import InvokeExecutor
|
|
249
|
+
from agentkit.toolkit.cli.console_reporter import ConsoleReporter
|
|
250
|
+
|
|
251
|
+
console.print("[cyan]Invoking agent...[/cyan]")
|
|
252
|
+
|
|
253
|
+
# Validate parameters: message and payload cannot be provided simultaneously
|
|
254
|
+
if message and payload:
|
|
255
|
+
console.print(
|
|
256
|
+
"[red]Error: Cannot specify both message and payload. Use either message or --payload.[/red]"
|
|
257
|
+
)
|
|
258
|
+
raise typer.Exit(1)
|
|
259
|
+
# Validate parameters: must provide either message or payload
|
|
260
|
+
if not message and not payload:
|
|
261
|
+
console.print(
|
|
262
|
+
"[red]Error: Must provide either a message or --payload option.[/red]"
|
|
263
|
+
)
|
|
264
|
+
raise typer.Exit(1)
|
|
265
|
+
config = get_config(config_path=config_file)
|
|
266
|
+
common_config = config.get_common_config()
|
|
267
|
+
|
|
268
|
+
# Process headers
|
|
269
|
+
default_headers = {
|
|
270
|
+
"user_id": "agentkit_user",
|
|
271
|
+
"session_id": "agentkit_sample_session",
|
|
272
|
+
}
|
|
273
|
+
final_headers = default_headers.copy()
|
|
274
|
+
|
|
275
|
+
if headers:
|
|
276
|
+
try:
|
|
277
|
+
custom_headers = (
|
|
278
|
+
json.loads(headers) if isinstance(headers, str) else headers
|
|
279
|
+
)
|
|
280
|
+
except json.JSONDecodeError as e:
|
|
281
|
+
console.print(f"[red]Error: Invalid JSON headers: {e}[/red]")
|
|
282
|
+
raise typer.Exit(1)
|
|
283
|
+
if not isinstance(custom_headers, dict):
|
|
284
|
+
console.print(
|
|
285
|
+
'[red]Error: --headers must be a JSON object (e.g. \'{"user_id": "u1"}\').[/red]'
|
|
286
|
+
)
|
|
287
|
+
raise typer.Exit(1)
|
|
288
|
+
final_headers.update(custom_headers)
|
|
289
|
+
console.print(f"[blue]Using merged headers: {final_headers}[/blue]")
|
|
290
|
+
else:
|
|
291
|
+
console.print(f"[blue]Using default headers: {final_headers}[/blue]")
|
|
292
|
+
|
|
293
|
+
final_payload = build_standard_payload(message, payload)
|
|
294
|
+
agent_type = getattr(common_config, "agent_type", "") or getattr(
|
|
295
|
+
common_config, "template_type", ""
|
|
296
|
+
)
|
|
297
|
+
is_a2a = isinstance(agent_type, str) and "a2a" in agent_type.lower()
|
|
298
|
+
|
|
299
|
+
# If it's an A2A Agent, reconstruct payload using A2A constructor
|
|
300
|
+
if is_a2a:
|
|
301
|
+
console.print(
|
|
302
|
+
"[cyan]Detected A2A agent type - constructing A2A JSON-RPC envelope[/cyan]"
|
|
303
|
+
)
|
|
304
|
+
final_payload = build_a2a_payload(message, payload, final_headers)
|
|
305
|
+
|
|
306
|
+
if apikey:
|
|
307
|
+
final_headers["Authorization"] = f"Bearer {apikey}"
|
|
308
|
+
|
|
309
|
+
from agentkit.toolkit.context import ExecutionContext
|
|
310
|
+
|
|
311
|
+
reporter = ConsoleReporter()
|
|
312
|
+
ExecutionContext.set_reporter(reporter)
|
|
313
|
+
|
|
314
|
+
executor = InvokeExecutor(reporter=reporter)
|
|
315
|
+
result = executor.execute(
|
|
316
|
+
payload=final_payload,
|
|
317
|
+
config_file=str(config_file),
|
|
318
|
+
headers=final_headers,
|
|
319
|
+
stream=None, # Automatically determined by Runner
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
if not result.success:
|
|
323
|
+
console.print(f"[red]❌ Invocation failed: {result.error}[/red]")
|
|
324
|
+
raise typer.Exit(1)
|
|
325
|
+
console.print("[green]✅ Invocation successful[/green]")
|
|
326
|
+
|
|
327
|
+
# Get response
|
|
328
|
+
response = result.response
|
|
329
|
+
|
|
330
|
+
# Handle streaming response (generator)
|
|
331
|
+
if result.is_streaming:
|
|
332
|
+
console.print("[cyan]📡 Streaming response detected...[/cyan]\n")
|
|
333
|
+
if raw:
|
|
334
|
+
console.print(
|
|
335
|
+
"[yellow]Raw mode enabled: printing raw stream events[/yellow]\n"
|
|
336
|
+
)
|
|
337
|
+
result_list = []
|
|
338
|
+
complete_text = []
|
|
339
|
+
printed_reasoning_header = False
|
|
340
|
+
printed_answer_header = False
|
|
341
|
+
printed_hidden_reasoning_hint = False
|
|
342
|
+
printed_heartbeat = False
|
|
343
|
+
last_heartbeat_ts = time.monotonic()
|
|
344
|
+
|
|
345
|
+
for event in result.stream():
|
|
346
|
+
result_list.append(event)
|
|
347
|
+
|
|
348
|
+
if raw:
|
|
349
|
+
# Print the event as received (before normalization), to help debugging.
|
|
350
|
+
if isinstance(event, dict):
|
|
351
|
+
console.print(json.dumps(event, ensure_ascii=False))
|
|
352
|
+
elif isinstance(event, str):
|
|
353
|
+
console.print(event.rstrip("\n"))
|
|
354
|
+
else:
|
|
355
|
+
console.print(repr(event))
|
|
356
|
+
|
|
357
|
+
normalized = _normalize_stream_event(event)
|
|
358
|
+
if normalized is None:
|
|
359
|
+
continue
|
|
360
|
+
|
|
361
|
+
# Handle A2A JSON-RPC wrapper (unwrap to the underlying result payload)
|
|
362
|
+
if normalized.get("jsonrpc") and "result" in normalized:
|
|
363
|
+
result_payload = normalized.get("result")
|
|
364
|
+
normalized = result_payload if isinstance(result_payload, dict) else {}
|
|
365
|
+
|
|
366
|
+
# Keep existing partial-event behavior for ADK style streams.
|
|
367
|
+
# (LangChain message events typically don't carry this field.)
|
|
368
|
+
if not normalized.get("partial", True):
|
|
369
|
+
logger.info("Partial event: %s", normalized)
|
|
370
|
+
continue
|
|
371
|
+
|
|
372
|
+
# In raw mode, we still keep termination/error handling, but skip
|
|
373
|
+
# extracted text printing to avoid mixing structured debug output.
|
|
374
|
+
if not raw:
|
|
375
|
+
# LangChain: reasoning_content
|
|
376
|
+
reasoning_chunks = _extract_reasoning_chunks_from_langchain_event(
|
|
377
|
+
normalized
|
|
378
|
+
)
|
|
379
|
+
if reasoning_chunks:
|
|
380
|
+
if show_reasoning:
|
|
381
|
+
if not printed_reasoning_header:
|
|
382
|
+
console.print("[cyan]🧠 Reasoning:[/cyan]")
|
|
383
|
+
printed_reasoning_header = True
|
|
384
|
+
for text in reasoning_chunks:
|
|
385
|
+
console.print(text, end="", style="yellow")
|
|
386
|
+
else:
|
|
387
|
+
# Default behavior: do not print reasoning, but keep the CLI responsive
|
|
388
|
+
# with a one-time hint and a periodic heartbeat.
|
|
389
|
+
if not printed_hidden_reasoning_hint:
|
|
390
|
+
console.print(
|
|
391
|
+
"[cyan]🤔 Model is thinking... (use --show-reasoning to view)[/cyan]"
|
|
392
|
+
)
|
|
393
|
+
printed_hidden_reasoning_hint = True
|
|
394
|
+
now = time.monotonic()
|
|
395
|
+
if now - last_heartbeat_ts >= 1.5:
|
|
396
|
+
console.print(".", end="", style="cyan")
|
|
397
|
+
printed_heartbeat = True
|
|
398
|
+
last_heartbeat_ts = now
|
|
399
|
+
|
|
400
|
+
# Extract and print incremental answer text chunks
|
|
401
|
+
text_chunks: list[str] = []
|
|
402
|
+
text_chunks.extend(
|
|
403
|
+
_extract_text_chunks_from_langchain_event(normalized)
|
|
404
|
+
)
|
|
405
|
+
if not text_chunks:
|
|
406
|
+
text_chunks.extend(_extract_text_chunks_from_adk_event(normalized))
|
|
407
|
+
|
|
408
|
+
if text_chunks:
|
|
409
|
+
# If we printed a hidden reasoning hint / heartbeat dots, separate answer on a new line.
|
|
410
|
+
if printed_hidden_reasoning_hint or printed_heartbeat:
|
|
411
|
+
console.print("")
|
|
412
|
+
printed_hidden_reasoning_hint = False
|
|
413
|
+
printed_heartbeat = False
|
|
414
|
+
if printed_reasoning_header and not printed_answer_header:
|
|
415
|
+
console.print("\n[cyan]📝 Answer:[/cyan]")
|
|
416
|
+
printed_answer_header = True
|
|
417
|
+
for text in text_chunks:
|
|
418
|
+
complete_text.append(text)
|
|
419
|
+
console.print(text, end="", style="green")
|
|
420
|
+
|
|
421
|
+
# Display error information in event (if any)
|
|
422
|
+
if "error" in normalized:
|
|
423
|
+
console.print(f"\n[red]Error: {normalized['error']}[/red]")
|
|
424
|
+
|
|
425
|
+
# Handle status updates (e.g., final flag or completed status)
|
|
426
|
+
if normalized.get("final") is True:
|
|
427
|
+
break
|
|
428
|
+
|
|
429
|
+
status = normalized.get("status")
|
|
430
|
+
if isinstance(status, dict) and status.get("state") == "completed":
|
|
431
|
+
console.print("\n[cyan]Status indicates completed[/cyan]")
|
|
432
|
+
break
|
|
433
|
+
|
|
434
|
+
# Display complete response (commented out for now)
|
|
435
|
+
# if complete_text:
|
|
436
|
+
# console.print("\n\n[cyan]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[/cyan]")
|
|
437
|
+
# console.print(f"[cyan]📝 Complete response:[/cyan] {''.join(complete_text)}")
|
|
438
|
+
console.print("") # Line break
|
|
439
|
+
|
|
440
|
+
return str(result_list)
|
|
441
|
+
|
|
442
|
+
# Handle non-streaming response
|
|
443
|
+
console.print("[cyan]📝 Response:[/cyan]")
|
|
444
|
+
if isinstance(response, dict):
|
|
445
|
+
if raw:
|
|
446
|
+
console.print(json.dumps(response, ensure_ascii=False))
|
|
447
|
+
else:
|
|
448
|
+
console.print(json.dumps(response, indent=2, ensure_ascii=False))
|
|
449
|
+
else:
|
|
450
|
+
console.print(response)
|
|
451
|
+
|
|
452
|
+
return str(response)
|
{agentkit_sdk_python-0.3.2 → agentkit_sdk_python-0.3.3}/agentkit/toolkit/cli/interactive_config.py
RENAMED
|
@@ -107,6 +107,7 @@ class AutoPromptGenerator:
|
|
|
107
107
|
dict: self._handle_dict,
|
|
108
108
|
Dict: self._handle_dict,
|
|
109
109
|
}
|
|
110
|
+
self.current_dataclass_type = None
|
|
110
111
|
|
|
111
112
|
def _safe_input(self, prompt_text, default: str = "") -> str:
|
|
112
113
|
"""Safe input method that protects prompt text from being deleted by Backspace.
|
|
@@ -175,6 +176,7 @@ class AutoPromptGenerator:
|
|
|
175
176
|
def generate_config(
|
|
176
177
|
self, dataclass_type: type, existing_config: Optional[Dict[str, Any]] = None
|
|
177
178
|
) -> Dict[str, Any]:
|
|
179
|
+
self.current_dataclass_type = dataclass_type
|
|
178
180
|
if not is_dataclass(dataclass_type):
|
|
179
181
|
raise ValueError(f"{dataclass_type} must be a dataclass")
|
|
180
182
|
|
|
@@ -270,6 +272,7 @@ class AutoPromptGenerator:
|
|
|
270
272
|
if not isinstance(value, type(MISSING)):
|
|
271
273
|
filtered_config[key] = value
|
|
272
274
|
|
|
275
|
+
self.current_dataclass_type = None
|
|
273
276
|
return filtered_config
|
|
274
277
|
|
|
275
278
|
def _prompt_for_field(
|
|
@@ -326,7 +329,35 @@ class AutoPromptGenerator:
|
|
|
326
329
|
default = None
|
|
327
330
|
|
|
328
331
|
choices = metadata.get("choices")
|
|
329
|
-
|
|
332
|
+
# Allow free region input when global defaults disable strict restrictions
|
|
333
|
+
allow_free_region = False
|
|
334
|
+
try:
|
|
335
|
+
from agentkit.toolkit.config.global_config import get_global_config
|
|
336
|
+
|
|
337
|
+
global_conf = get_global_config()
|
|
338
|
+
disabled = bool(
|
|
339
|
+
getattr(
|
|
340
|
+
global_conf.defaults, "disable_region_strict_restrictions", False
|
|
341
|
+
)
|
|
342
|
+
)
|
|
343
|
+
if disabled and name == "region":
|
|
344
|
+
# Limit to Cloud/Hybrid strategy types only
|
|
345
|
+
try:
|
|
346
|
+
from agentkit.toolkit.config.strategy_configs import (
|
|
347
|
+
CloudStrategyConfig,
|
|
348
|
+
HybridStrategyConfig,
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
allow_free_region = self.current_dataclass_type in (
|
|
352
|
+
CloudStrategyConfig,
|
|
353
|
+
HybridStrategyConfig,
|
|
354
|
+
)
|
|
355
|
+
except Exception:
|
|
356
|
+
allow_free_region = False
|
|
357
|
+
except Exception:
|
|
358
|
+
allow_free_region = False
|
|
359
|
+
|
|
360
|
+
if choices and not allow_free_region:
|
|
330
361
|
return self._handle_choice_selection(
|
|
331
362
|
description, default, choices, metadata, current, total
|
|
332
363
|
)
|
|
@@ -830,8 +861,8 @@ class AutoPromptGenerator:
|
|
|
830
861
|
# Add environment variable hints (if description contains 'env')
|
|
831
862
|
if "env" in description.lower():
|
|
832
863
|
console.print("Common environment variables:")
|
|
864
|
+
console.print(" - MODEL_AGENT_NAME=your_model_name")
|
|
833
865
|
console.print(" - MODEL_AGENT_API_KEY=your_api_key")
|
|
834
|
-
console.print(" - DEBUG=true")
|
|
835
866
|
console.print(" - LOG_LEVEL=info")
|
|
836
867
|
|
|
837
868
|
console.print("Input format: KEY=VALUE")
|