agentkit-sdk-python 0.7.3__tar.gz → 0.7.4__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.7.3/agentkit_sdk_python.egg-info → agentkit_sdk_python-0.7.4}/PKG-INFO +8 -1
- agentkit_sdk_python-0.7.4/agentkit/frameworks/__init__.py +29 -0
- agentkit_sdk_python-0.7.4/agentkit/frameworks/_common.py +136 -0
- agentkit_sdk_python-0.7.4/agentkit/frameworks/langchain.py +170 -0
- agentkit_sdk_python-0.7.4/agentkit/frameworks/langgraph.py +349 -0
- agentkit_sdk_python-0.7.4/agentkit/frameworks/serving/__init__.py +6 -0
- agentkit_sdk_python-0.7.4/agentkit/frameworks/serving/fastapi_mount.py +65 -0
- agentkit_sdk_python-0.7.4/agentkit/frameworks/serving/langserve.py +502 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/version.py +1 -1
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4/agentkit_sdk_python.egg-info}/PKG-INFO +8 -1
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/SOURCES.txt +7 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/requires.txt +10 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/pyproject.toml +4 -1
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/LICENSE +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/MANIFEST.in +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/README.md +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/a2a_app/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/a2a_app/a2a_app.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/a2a_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/agent_server_app.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/middleware.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/origin.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/agent_server_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/base_app.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/mcp_app/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/mcp_app/mcp_app.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/mcp_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/simple_app/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/simple_app/simple_app.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/simple_app/simple_app_handlers.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/simple_app/telemetry.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/apps/utils.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/_openapi.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/_redact.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/_sigv4.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/admin.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/credential_hosting.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/errors.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/model_login.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/oauth.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/profile.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/providers.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/resolve.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/session.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/ssl_trust.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/sso.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/store.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/auth/sts.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/client/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/client/base_agentkit_client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/client/base_iam_client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/client/base_service_client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/errors.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/platform/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/platform/configuration.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/platform/console_urls.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/platform/constants.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/platform/context.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/platform/provider.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/account/client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/account/types.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/identity/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/identity/auth.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/identity/client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/identity/types.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/knowledge/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/knowledge/client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/knowledge/types.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/mcp/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/mcp/client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/mcp/types.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/memory/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/memory/client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/memory/types.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/runtime/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/runtime/client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/runtime/types.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/skills/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/skills/client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/skills/types.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/tools/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/tools/client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/sdk/tools/types.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/builders/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/builders/base.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/builders/local_docker.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/builders/ve_pipeline.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/__main__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_add.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_auth.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_build.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_delete.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_deploy.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_destroy.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_init.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_invoke.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_knowledge.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_launch.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_list.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_logs.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_memory.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_runtime.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_skill.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_skills.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_skills_workflow.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_status.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_tools.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/cli_version.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/console_reporter.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/interactive_config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/a2a_client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/agentkit_client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_create.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_exec.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_file.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_get.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_invoke.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_model_login.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_mount.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_run.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_shell.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/cli_web.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/env_config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/git_config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/model_config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/sandbox_client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/session_create.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/session_sync.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/tool_resolve.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/sandbox/tos_config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/cli/utils.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/choice_resolvers.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/cloud_provider.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/config_handler.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/config_validator.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/constants.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/dataclass_utils.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/docker_build_config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/global_config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/region_defaults.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/region_resolver.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/strategy_configs.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/config/utils.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/context.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/base_images.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/container.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/dockerfile/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/dockerfile/manager.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/dockerfile/metadata.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/docker/utils.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/errors.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/base_executor.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/build_executor.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/deploy_executor.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/init_executor.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/invoke_executor.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/lifecycle_executor.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/executors/status_executor.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/harness/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/harness/config_builder.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/harness/deploy.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/harness/env_mapping.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/models.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/reporter.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/__pycache__/customer_support_assistant.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/__pycache__/financial_analyst.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/__pycache__/simple_app_veadk.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/__pycache__/simple_mcp_veadk.cpython-312.pyc +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/a2a.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/agent_server.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/basic.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/basic_stream.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/customer_support_assistant.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/agent.go +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/build.sh +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/go.mod +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/go.sum +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/eino_a2a/main.go +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/financial_analyst.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/langchain_basic_stream.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/simple_app_veadk.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/simple_mcp_veadk.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/agent.go +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/build.sh +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/go.mod +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/go.sum +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_a2a/main.go +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/agent.go +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/build.sh +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/go.mod +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/go.sum +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/samples/veadk_go_basic/main.go +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/templates/code-pipeline-tos-cr-step.j2 +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/templates/golang/Dockerfile.j2 +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/templates/python/Dockerfile.j2 +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/wrappers/wrapper_basic.py.jinja2 +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/resources/wrappers/wrapper_stream.py.jinja2 +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/runners/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/runners/base.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/runners/local_docker.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/runners/ve_agentkit.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/bindings/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/bindings/memory.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/builder.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/client.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/deployer.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/initializer.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/invoker.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/lifecycle.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/sdk/status.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/base_strategy.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/cloud_strategy.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/hybrid_strategy.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/strategies/local_strategy.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/utils/agent_parser.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/apmplus_logs.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/code_pipeline.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/cr.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/iam.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/services/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/services/cr_service.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/services/tos_service.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/sts.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/toolkit/volcengine/utils/project_archiver.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/utils/__init__.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/utils/global_config_io.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/utils/http_defaults.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/utils/logging_config.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/utils/misc.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/utils/redact.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/utils/request.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/utils/template_utils.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit/utils/ve_sign.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/dependency_links.txt +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/entry_points.txt +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/agentkit_sdk_python.egg-info/top_level.txt +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/setup.cfg +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/tests/test_client_uses_platform_context.py +0 -0
- {agentkit_sdk_python-0.7.3 → agentkit_sdk_python-0.7.4}/tests/test_error_hierarchy.py +0 -0
{agentkit_sdk_python-0.7.3/agentkit_sdk_python.egg-info → agentkit_sdk_python-0.7.4}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentkit-sdk-python
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.4
|
|
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
|
|
@@ -244,6 +244,13 @@ Requires-Dist: pyreadline3; sys_platform == "win32"
|
|
|
244
244
|
Provides-Extra: extensions
|
|
245
245
|
Provides-Extra: toolkit
|
|
246
246
|
Provides-Extra: dev
|
|
247
|
+
Provides-Extra: langchain
|
|
248
|
+
Requires-Dist: langchain; extra == "langchain"
|
|
249
|
+
Provides-Extra: langgraph
|
|
250
|
+
Requires-Dist: langgraph; extra == "langgraph"
|
|
251
|
+
Provides-Extra: frameworks
|
|
252
|
+
Requires-Dist: langchain; extra == "frameworks"
|
|
253
|
+
Requires-Dist: langgraph; extra == "frameworks"
|
|
247
254
|
Dynamic: license-file
|
|
248
255
|
|
|
249
256
|
<div align="center">
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Framework adapters for running third-party agents in AgentKit apps."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from agentkit.frameworks._common import (
|
|
8
|
+
FrameworkBridgeError,
|
|
9
|
+
UnsupportedFrameworkAgentError,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"FrameworkBridgeError",
|
|
14
|
+
"LangChainAgentkitBridge",
|
|
15
|
+
"LangGraphAgentkitBridge",
|
|
16
|
+
"UnsupportedFrameworkAgentError",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def __getattr__(name: str) -> Any:
|
|
21
|
+
if name == "LangChainAgentkitBridge":
|
|
22
|
+
from agentkit.frameworks.langchain import LangChainAgentkitBridge
|
|
23
|
+
|
|
24
|
+
return LangChainAgentkitBridge
|
|
25
|
+
if name == "LangGraphAgentkitBridge":
|
|
26
|
+
from agentkit.frameworks.langgraph import LangGraphAgentkitBridge
|
|
27
|
+
|
|
28
|
+
return LangGraphAgentkitBridge
|
|
29
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"""Shared helpers for framework-to-ADK adapters."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import inspect
|
|
6
|
+
import json
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from google.adk.agents.invocation_context import InvocationContext
|
|
10
|
+
from google.adk.events import Event
|
|
11
|
+
from google.genai import types
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class FrameworkBridgeError(RuntimeError):
|
|
15
|
+
"""Base error raised by AgentKit framework adapters."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class UnsupportedFrameworkAgentError(FrameworkBridgeError):
|
|
19
|
+
"""Raised when an entry object does not expose a supported agent protocol."""
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def user_text(ctx: InvocationContext) -> str:
|
|
23
|
+
content = ctx.user_content
|
|
24
|
+
if content is None or not content.parts:
|
|
25
|
+
return ""
|
|
26
|
+
texts: list[str] = []
|
|
27
|
+
for part in content.parts:
|
|
28
|
+
text = getattr(part, "text", None)
|
|
29
|
+
if text:
|
|
30
|
+
texts.append(text)
|
|
31
|
+
return "\n".join(texts)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def json_text(value: Any) -> str:
|
|
35
|
+
try:
|
|
36
|
+
return json.dumps(value, ensure_ascii=False, default=str)
|
|
37
|
+
except Exception:
|
|
38
|
+
return str(value)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def content_to_text(content: Any) -> str:
|
|
42
|
+
if content is None:
|
|
43
|
+
return ""
|
|
44
|
+
if isinstance(content, str):
|
|
45
|
+
return content
|
|
46
|
+
if isinstance(content, dict):
|
|
47
|
+
for key in ("text", "content", "output", "answer"):
|
|
48
|
+
if key in content:
|
|
49
|
+
text = content_to_text(content[key])
|
|
50
|
+
if text:
|
|
51
|
+
return text
|
|
52
|
+
return json_text(content)
|
|
53
|
+
if isinstance(content, list):
|
|
54
|
+
return "".join(content_to_text(item) for item in content)
|
|
55
|
+
text = getattr(content, "text", None)
|
|
56
|
+
if isinstance(text, str):
|
|
57
|
+
return text
|
|
58
|
+
return str(content)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def chunk_to_text(value: Any) -> str:
|
|
62
|
+
if value is None:
|
|
63
|
+
return ""
|
|
64
|
+
if isinstance(value, str):
|
|
65
|
+
return value
|
|
66
|
+
content = getattr(value, "content", None)
|
|
67
|
+
if content is not None:
|
|
68
|
+
return content_to_text(content)
|
|
69
|
+
text = getattr(value, "text", None)
|
|
70
|
+
if isinstance(text, str):
|
|
71
|
+
return text
|
|
72
|
+
if isinstance(value, dict):
|
|
73
|
+
for key in ("output", "answer", "text", "content"):
|
|
74
|
+
if key in value:
|
|
75
|
+
text = chunk_to_text(value[key])
|
|
76
|
+
if text:
|
|
77
|
+
return text
|
|
78
|
+
messages = value.get("messages")
|
|
79
|
+
if isinstance(messages, (list, tuple)) and messages:
|
|
80
|
+
return chunk_to_text(messages[-1])
|
|
81
|
+
for nested in value.values():
|
|
82
|
+
text = chunk_to_text(nested)
|
|
83
|
+
if text:
|
|
84
|
+
return text
|
|
85
|
+
return json_text(value)
|
|
86
|
+
if isinstance(value, (list, tuple)):
|
|
87
|
+
for item in reversed(value):
|
|
88
|
+
text = chunk_to_text(item)
|
|
89
|
+
if text:
|
|
90
|
+
return text
|
|
91
|
+
return ""
|
|
92
|
+
return str(value)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def adk_event(
|
|
96
|
+
ctx: InvocationContext,
|
|
97
|
+
author: str,
|
|
98
|
+
text: str,
|
|
99
|
+
*,
|
|
100
|
+
partial: bool,
|
|
101
|
+
) -> Event:
|
|
102
|
+
return Event(
|
|
103
|
+
invocation_id=ctx.invocation_id,
|
|
104
|
+
author=author,
|
|
105
|
+
branch=ctx.branch,
|
|
106
|
+
partial=partial,
|
|
107
|
+
content=types.Content(role="model", parts=[types.Part(text=text)]),
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
async def maybe_await(value: Any) -> Any:
|
|
112
|
+
if inspect.isawaitable(value):
|
|
113
|
+
return await value
|
|
114
|
+
return value
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def is_input_shape_error(exc: Exception) -> bool:
|
|
118
|
+
message = str(exc)
|
|
119
|
+
name = exc.__class__.__name__
|
|
120
|
+
return (
|
|
121
|
+
name == "InvalidUpdateError"
|
|
122
|
+
or "Invalid input type" in message
|
|
123
|
+
or "Must be a PromptValue, str, or list of BaseMessages" in message
|
|
124
|
+
or "Expected dict" in message
|
|
125
|
+
or "string indices must be integers" in message
|
|
126
|
+
or "'str' object is not subscriptable" in message
|
|
127
|
+
or "Input to ChatPromptTemplate is missing variables" in message
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def chunk_delta(accumulated: str, text: str) -> str:
|
|
132
|
+
if not accumulated:
|
|
133
|
+
return text
|
|
134
|
+
if text.startswith(accumulated):
|
|
135
|
+
return text[len(accumulated) :]
|
|
136
|
+
return text
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"""LangChain adapter for AgentKit apps."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import AsyncGenerator
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from google.adk.agents.base_agent import BaseAgent
|
|
9
|
+
from google.adk.agents.invocation_context import InvocationContext
|
|
10
|
+
from google.adk.events import Event
|
|
11
|
+
from pydantic import PrivateAttr
|
|
12
|
+
|
|
13
|
+
from agentkit.frameworks._common import (
|
|
14
|
+
UnsupportedFrameworkAgentError,
|
|
15
|
+
adk_event,
|
|
16
|
+
chunk_delta,
|
|
17
|
+
chunk_to_text,
|
|
18
|
+
is_input_shape_error,
|
|
19
|
+
maybe_await,
|
|
20
|
+
user_text,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
try:
|
|
25
|
+
from langchain_core.messages import HumanMessage
|
|
26
|
+
except ImportError: # pragma: no cover - depends on optional packages.
|
|
27
|
+
HumanMessage = None # type: ignore[assignment]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class LangChainAgentkitBridge(BaseAgent):
|
|
31
|
+
"""Adapt a LangChain Runnable or callable to AgentKit's ADK runtime boundary."""
|
|
32
|
+
|
|
33
|
+
_runnable: Any = PrivateAttr()
|
|
34
|
+
_input_key: str = PrivateAttr(default="input")
|
|
35
|
+
|
|
36
|
+
def __init__(
|
|
37
|
+
self,
|
|
38
|
+
runnable: Any,
|
|
39
|
+
*,
|
|
40
|
+
name: str = "langchain_agent",
|
|
41
|
+
description: str = "LangChain agent adapted for AgentKit runtime",
|
|
42
|
+
input_key: str = "input",
|
|
43
|
+
) -> None:
|
|
44
|
+
super().__init__(name=name, description=description)
|
|
45
|
+
self._runnable = runnable
|
|
46
|
+
self._input_key = input_key
|
|
47
|
+
|
|
48
|
+
def _input_candidates(self, payload: dict[str, Any], text_input: str) -> list[Any]:
|
|
49
|
+
candidates: list[Any] = [payload, text_input]
|
|
50
|
+
if HumanMessage is not None:
|
|
51
|
+
message = HumanMessage(content=text_input)
|
|
52
|
+
candidates.extend(([message], {"messages": [message]}))
|
|
53
|
+
return candidates
|
|
54
|
+
|
|
55
|
+
async def _call_once(self, payload: dict[str, Any], text_input: str) -> Any:
|
|
56
|
+
candidates = self._input_candidates(payload, text_input)
|
|
57
|
+
ainvoke = getattr(self._runnable, "ainvoke", None)
|
|
58
|
+
if callable(ainvoke):
|
|
59
|
+
last_error: Exception | None = None
|
|
60
|
+
for candidate in candidates:
|
|
61
|
+
try:
|
|
62
|
+
return await ainvoke(candidate)
|
|
63
|
+
except Exception as exc:
|
|
64
|
+
if not is_input_shape_error(exc):
|
|
65
|
+
raise
|
|
66
|
+
last_error = exc
|
|
67
|
+
if last_error is not None:
|
|
68
|
+
raise last_error
|
|
69
|
+
|
|
70
|
+
invoke = getattr(self._runnable, "invoke", None)
|
|
71
|
+
if callable(invoke):
|
|
72
|
+
last_error = None
|
|
73
|
+
for candidate in candidates:
|
|
74
|
+
try:
|
|
75
|
+
return invoke(candidate)
|
|
76
|
+
except Exception as exc:
|
|
77
|
+
if not is_input_shape_error(exc):
|
|
78
|
+
raise
|
|
79
|
+
last_error = exc
|
|
80
|
+
if last_error is not None:
|
|
81
|
+
raise last_error
|
|
82
|
+
|
|
83
|
+
if callable(self._runnable):
|
|
84
|
+
last_error = None
|
|
85
|
+
for candidate in candidates:
|
|
86
|
+
try:
|
|
87
|
+
return await maybe_await(self._runnable(candidate))
|
|
88
|
+
except Exception as exc:
|
|
89
|
+
if not is_input_shape_error(exc):
|
|
90
|
+
raise
|
|
91
|
+
last_error = exc
|
|
92
|
+
if last_error is not None:
|
|
93
|
+
raise last_error
|
|
94
|
+
|
|
95
|
+
raise UnsupportedFrameworkAgentError(
|
|
96
|
+
"LangChain entry must be a Runnable-like object exposing "
|
|
97
|
+
"astream, stream, ainvoke, or invoke, or a callable that accepts the user input."
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
async def _stream_chunks(self, payload: dict[str, Any], text_input: str):
|
|
101
|
+
astream = getattr(self._runnable, "astream", None)
|
|
102
|
+
if callable(astream):
|
|
103
|
+
last_error: Exception | None = None
|
|
104
|
+
for candidate in self._input_candidates(payload, text_input):
|
|
105
|
+
emitted = False
|
|
106
|
+
try:
|
|
107
|
+
async for chunk in astream(candidate):
|
|
108
|
+
emitted = True
|
|
109
|
+
yield chunk
|
|
110
|
+
return
|
|
111
|
+
except Exception as exc:
|
|
112
|
+
if emitted:
|
|
113
|
+
raise
|
|
114
|
+
if not is_input_shape_error(exc):
|
|
115
|
+
raise
|
|
116
|
+
last_error = exc
|
|
117
|
+
if last_error is not None:
|
|
118
|
+
raise last_error
|
|
119
|
+
return
|
|
120
|
+
|
|
121
|
+
stream = getattr(self._runnable, "stream", None)
|
|
122
|
+
if callable(stream):
|
|
123
|
+
last_error = None
|
|
124
|
+
for candidate in self._input_candidates(payload, text_input):
|
|
125
|
+
emitted = False
|
|
126
|
+
try:
|
|
127
|
+
for chunk in stream(candidate):
|
|
128
|
+
emitted = True
|
|
129
|
+
yield chunk
|
|
130
|
+
return
|
|
131
|
+
except Exception as exc:
|
|
132
|
+
if emitted:
|
|
133
|
+
raise
|
|
134
|
+
if not is_input_shape_error(exc):
|
|
135
|
+
raise
|
|
136
|
+
last_error = exc
|
|
137
|
+
if last_error is not None:
|
|
138
|
+
raise last_error
|
|
139
|
+
|
|
140
|
+
async def _run_async_impl(
|
|
141
|
+
self,
|
|
142
|
+
ctx: InvocationContext,
|
|
143
|
+
) -> AsyncGenerator[Event, None]:
|
|
144
|
+
text_input = user_text(ctx)
|
|
145
|
+
payload = {self._input_key: text_input}
|
|
146
|
+
accumulated_text = ""
|
|
147
|
+
has_output = False
|
|
148
|
+
last_text = ""
|
|
149
|
+
streamed = False
|
|
150
|
+
|
|
151
|
+
async for chunk in self._stream_chunks(payload, text_input):
|
|
152
|
+
streamed = True
|
|
153
|
+
text = chunk_to_text(chunk)
|
|
154
|
+
if not text:
|
|
155
|
+
continue
|
|
156
|
+
delta = chunk_delta(accumulated_text, text)
|
|
157
|
+
if not delta:
|
|
158
|
+
continue
|
|
159
|
+
accumulated_text += delta
|
|
160
|
+
has_output = True
|
|
161
|
+
last_text = accumulated_text
|
|
162
|
+
yield adk_event(ctx, self.name, delta, partial=True)
|
|
163
|
+
|
|
164
|
+
if not streamed:
|
|
165
|
+
result = await self._call_once(payload, text_input)
|
|
166
|
+
last_text = chunk_to_text(result)
|
|
167
|
+
|
|
168
|
+
final_text = accumulated_text if has_output else last_text
|
|
169
|
+
if final_text:
|
|
170
|
+
yield adk_event(ctx, self.name, final_text, partial=False)
|