google-adk 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google_adk-0.3.0 → google_adk-0.4.0}/PKG-INFO +2 -6
- {google_adk-0.3.0 → google_adk-0.4.0}/README.md +1 -5
- {google_adk-0.3.0 → google_adk-0.4.0}/pyproject.toml +12 -8
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/base_agent.py +7 -7
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/llm_agent.py +3 -8
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/cli.py +54 -47
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/cli_tools_click.py +50 -1
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/events/event_actions.py +9 -4
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/contents.py +9 -5
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/functions.py +37 -15
- google_adk-0.4.0/src/google/adk/sessions/_session_util.py +29 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/sessions/database_session_service.py +57 -44
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/sessions/vertex_ai_session_service.py +7 -5
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/application_integration_tool/__init__.py +2 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/application_integration_tool/application_integration_toolset.py +48 -26
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/application_integration_tool/clients/connections_client.py +26 -54
- google_adk-0.4.0/src/google/adk/tools/application_integration_tool/integration_connector_tool.py +159 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/function_tool.py +42 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/version.py +1 -1
- {google_adk-0.3.0 → google_adk-0.4.0}/LICENSE +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/active_streaming_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/callback_context.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/invocation_context.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/langgraph_agent.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/live_request_queue.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/loop_agent.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/parallel_agent.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/readonly_context.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/remote_agent.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/run_config.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/sequential_agent.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/agents/transcription_entry.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/artifacts/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/artifacts/base_artifact_service.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/artifacts/gcs_artifact_service.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/artifacts/in_memory_artifact_service.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/auth/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/auth/auth_credential.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/auth/auth_handler.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/auth/auth_preprocessor.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/auth/auth_schemes.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/auth/auth_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/__main__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/agent_graph.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/browser/adk_favicon.svg +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/browser/assets/audio-processor.js +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/browser/assets/config/runtime-config.json +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/browser/index.html +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/browser/main-HWIBUY2R.js +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/browser/polyfills-FFHMD2TL.js +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/browser/styles-4VDSPQ37.css +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/cli_create.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/cli_deploy.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/cli_eval.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/fast_api.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/utils/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/utils/envs.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/utils/evals.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/cli/utils/logs.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/code_executors/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/code_executors/base_code_executor.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/code_executors/code_execution_utils.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/code_executors/code_executor_context.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/code_executors/container_code_executor.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/code_executors/unsafe_local_code_executor.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/code_executors/vertex_ai_code_executor.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/evaluation/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/evaluation/agent_evaluator.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/evaluation/evaluation_constants.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/evaluation/evaluation_generator.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/evaluation/response_evaluator.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/evaluation/trajectory_evaluator.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/events/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/events/event.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/examples/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/examples/base_example_provider.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/examples/example.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/examples/example_util.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/examples/vertex_ai_example_store.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/_base_llm_processor.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/_code_execution.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/_nl_planning.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/agent_transfer.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/audio_transcriber.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/auto_flow.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/base_llm_flow.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/basic.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/identity.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/instructions.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/flows/llm_flows/single_flow.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/memory/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/memory/base_memory_service.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/memory/in_memory_memory_service.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/memory/vertex_ai_rag_memory_service.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/anthropic_llm.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/base_llm.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/base_llm_connection.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/gemini_llm_connection.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/google_llm.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/lite_llm.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/llm_request.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/llm_response.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/models/registry.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/planners/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/planners/base_planner.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/planners/built_in_planner.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/planners/plan_re_act_planner.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/runners.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/sessions/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/sessions/base_session_service.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/sessions/in_memory_session_service.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/sessions/session.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/sessions/state.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/telemetry.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/_automatic_function_calling_util.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/agent_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/apihub_tool/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/apihub_tool/apihub_toolset.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/apihub_tool/clients/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/apihub_tool/clients/apihub_client.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/apihub_tool/clients/secret_client.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/application_integration_tool/clients/integration_client.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/base_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/built_in_code_execution_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/crewai_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/example_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/exit_loop_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/function_parameter_parse_util.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/get_user_choice_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/google_api_tool/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/google_api_tool/google_api_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/google_api_tool/google_api_tool_set.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/google_api_tool/google_api_tool_sets.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/google_api_tool/googleapi_to_openapi_converter.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/google_search_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/langchain_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/load_artifacts_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/load_memory_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/load_web_page.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/long_running_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/mcp_tool/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/mcp_tool/conversion_utils.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/mcp_tool/mcp_session_manager.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/mcp_tool/mcp_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/mcp_tool/mcp_toolset.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/auth/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/auth/auth_helpers.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/base_credential_exchanger.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/common/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/common/common.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/openapi_spec_parser/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_toolset.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/openapi_spec_parser/operation_parser.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/preload_memory_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/retrieval/__init__.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/retrieval/base_retrieval_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/retrieval/files_retrieval.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/retrieval/llama_index_retrieval.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/retrieval/vertex_ai_rag_retrieval.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/tool_context.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/toolbox_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/transfer_to_agent_tool.py +0 -0
- {google_adk-0.3.0 → google_adk-0.4.0}/src/google/adk/tools/vertex_ai_search_tool.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: google-adk
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.4.0
|
4
4
|
Summary: Agent Development Kit
|
5
5
|
Author-email: Google LLC <googleapis-packages@google.com>
|
6
6
|
Requires-Python: >=3.9
|
@@ -99,11 +99,7 @@ Provides-Extra: test
|
|
99
99
|
</h3>
|
100
100
|
</html>
|
101
101
|
|
102
|
-
Agent Development Kit (ADK) is designed for developers
|
103
|
-
control and flexibility when building advanced AI agents that are tightly
|
104
|
-
integrated with services in Google Cloud. It allows you to define agent
|
105
|
-
behavior, orchestration, and tool use directly in code, enabling robust
|
106
|
-
debugging, versioning, and deployment anywhere – from your laptop to the cloud.
|
102
|
+
Agent Development Kit (ADK) is a flexible and modular framework for developing and deploying AI agents. While optimized for Gemini and the Google ecosystem, ADK is model-agnostic, deployment-agnostic, and is built for compatibility with other frameworks. ADK was designed to make agent development feel more like software development, to make it easier for developers to create, deploy, and orchestrate agentic architectures that range from simple tasks to complex workflows.
|
107
103
|
|
108
104
|
|
109
105
|
---
|
@@ -18,11 +18,7 @@
|
|
18
18
|
</h3>
|
19
19
|
</html>
|
20
20
|
|
21
|
-
Agent Development Kit (ADK) is designed for developers
|
22
|
-
control and flexibility when building advanced AI agents that are tightly
|
23
|
-
integrated with services in Google Cloud. It allows you to define agent
|
24
|
-
behavior, orchestration, and tool use directly in code, enabling robust
|
25
|
-
debugging, versioning, and deployment anywhere – from your laptop to the cloud.
|
21
|
+
Agent Development Kit (ADK) is a flexible and modular framework for developing and deploying AI agents. While optimized for Gemini and the Google ecosystem, ADK is model-agnostic, deployment-agnostic, and is built for compatibility with other frameworks. ADK was designed to make agent development feel more like software development, to make it easier for developers to create, deploy, and orchestrate agentic architectures that range from simple tasks to complex workflows.
|
26
22
|
|
27
23
|
|
28
24
|
---
|
@@ -119,6 +119,15 @@ line-length = 80
|
|
119
119
|
unstable = true
|
120
120
|
pyink-indentation = 2
|
121
121
|
pyink-use-majority-quotes = true
|
122
|
+
pyink-annotation-pragmas = [
|
123
|
+
"noqa",
|
124
|
+
"pylint:",
|
125
|
+
"type: ignore",
|
126
|
+
"pytype:",
|
127
|
+
"mypy:",
|
128
|
+
"pyright:",
|
129
|
+
"pyre-",
|
130
|
+
]
|
122
131
|
|
123
132
|
|
124
133
|
[build-system]
|
@@ -135,15 +144,10 @@ exclude = ['src/**/*.sh']
|
|
135
144
|
name = "google.adk"
|
136
145
|
|
137
146
|
[tool.isort]
|
138
|
-
|
139
|
-
|
140
|
-
force_sort_within_sections = true
|
141
|
-
honor_case_in_force_sorted_sections = true
|
142
|
-
order_by_type = false
|
143
|
-
sort_relative_in_force_sorted_sections = true
|
144
|
-
multi_line_output = 3
|
145
|
-
line_length = 200
|
147
|
+
profile = "google"
|
148
|
+
|
146
149
|
|
147
150
|
[tool.pytest.ini_options]
|
148
151
|
testpaths = ["tests"]
|
149
152
|
asyncio_default_fixture_loop_scope = "function"
|
153
|
+
asyncio_mode = "auto"
|
@@ -44,7 +44,7 @@ Args:
|
|
44
44
|
callback_context: MUST be named 'callback_context' (enforced).
|
45
45
|
|
46
46
|
Returns:
|
47
|
-
The content to return to the user. When set, the agent run will skipped and
|
47
|
+
The content to return to the user. When set, the agent run will be skipped and
|
48
48
|
the provided content will be returned to user.
|
49
49
|
"""
|
50
50
|
|
@@ -55,8 +55,8 @@ Args:
|
|
55
55
|
callback_context: MUST be named 'callback_context' (enforced).
|
56
56
|
|
57
57
|
Returns:
|
58
|
-
The content to return to the user. When set, the
|
59
|
-
|
58
|
+
The content to return to the user. When set, the provided content will be
|
59
|
+
appended to event history as agent response.
|
60
60
|
"""
|
61
61
|
|
62
62
|
|
@@ -101,8 +101,8 @@ class BaseAgent(BaseModel):
|
|
101
101
|
callback_context: MUST be named 'callback_context' (enforced).
|
102
102
|
|
103
103
|
Returns:
|
104
|
-
The content to return to the user. When set, the agent run will skipped
|
105
|
-
the provided content will be returned to user.
|
104
|
+
The content to return to the user. When set, the agent run will be skipped
|
105
|
+
and the provided content will be returned to user.
|
106
106
|
"""
|
107
107
|
after_agent_callback: Optional[AfterAgentCallback] = None
|
108
108
|
"""Callback signature that is invoked after the agent run.
|
@@ -111,8 +111,8 @@ class BaseAgent(BaseModel):
|
|
111
111
|
callback_context: MUST be named 'callback_context' (enforced).
|
112
112
|
|
113
113
|
Returns:
|
114
|
-
The content to return to the user. When set, the
|
115
|
-
|
114
|
+
The content to return to the user. When set, the provided content will be
|
115
|
+
appended to event history as agent response.
|
116
116
|
"""
|
117
117
|
|
118
118
|
@final
|
@@ -15,12 +15,7 @@
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
17
|
import logging
|
18
|
-
from typing import Any
|
19
|
-
from typing import AsyncGenerator
|
20
|
-
from typing import Callable
|
21
|
-
from typing import Literal
|
22
|
-
from typing import Optional
|
23
|
-
from typing import Union
|
18
|
+
from typing import Any, AsyncGenerator, Awaitable, Callable, Literal, Optional, Union
|
24
19
|
|
25
20
|
from google.genai import types
|
26
21
|
from pydantic import BaseModel
|
@@ -62,11 +57,11 @@ AfterModelCallback: TypeAlias = Callable[
|
|
62
57
|
]
|
63
58
|
BeforeToolCallback: TypeAlias = Callable[
|
64
59
|
[BaseTool, dict[str, Any], ToolContext],
|
65
|
-
Optional[dict],
|
60
|
+
Union[Awaitable[Optional[dict]], Optional[dict]],
|
66
61
|
]
|
67
62
|
AfterToolCallback: TypeAlias = Callable[
|
68
63
|
[BaseTool, dict[str, Any], ToolContext, dict],
|
69
|
-
Optional[dict],
|
64
|
+
Union[Awaitable[Optional[dict]], Optional[dict]],
|
70
65
|
]
|
71
66
|
|
72
67
|
InstructionProvider: TypeAlias = Callable[[ReadonlyContext], str]
|
@@ -39,12 +39,12 @@ class InputFile(BaseModel):
|
|
39
39
|
|
40
40
|
async def run_input_file(
|
41
41
|
app_name: str,
|
42
|
+
user_id: str,
|
42
43
|
root_agent: LlmAgent,
|
43
44
|
artifact_service: BaseArtifactService,
|
44
|
-
session: Session,
|
45
45
|
session_service: BaseSessionService,
|
46
46
|
input_path: str,
|
47
|
-
) ->
|
47
|
+
) -> Session:
|
48
48
|
runner = Runner(
|
49
49
|
app_name=app_name,
|
50
50
|
agent=root_agent,
|
@@ -55,9 +55,11 @@ async def run_input_file(
|
|
55
55
|
input_file = InputFile.model_validate_json(f.read())
|
56
56
|
input_file.state['_time'] = datetime.now()
|
57
57
|
|
58
|
-
session
|
58
|
+
session = session_service.create_session(
|
59
|
+
app_name=app_name, user_id=user_id, state=input_file.state
|
60
|
+
)
|
59
61
|
for query in input_file.queries:
|
60
|
-
click.echo(f'user: {query}')
|
62
|
+
click.echo(f'[user]: {query}')
|
61
63
|
content = types.Content(role='user', parts=[types.Part(text=query)])
|
62
64
|
async for event in runner.run_async(
|
63
65
|
user_id=session.user_id, session_id=session.id, new_message=content
|
@@ -65,23 +67,23 @@ async def run_input_file(
|
|
65
67
|
if event.content and event.content.parts:
|
66
68
|
if text := ''.join(part.text or '' for part in event.content.parts):
|
67
69
|
click.echo(f'[{event.author}]: {text}')
|
70
|
+
return session
|
68
71
|
|
69
72
|
|
70
73
|
async def run_interactively(
|
71
|
-
app_name: str,
|
72
74
|
root_agent: LlmAgent,
|
73
75
|
artifact_service: BaseArtifactService,
|
74
76
|
session: Session,
|
75
77
|
session_service: BaseSessionService,
|
76
78
|
) -> None:
|
77
79
|
runner = Runner(
|
78
|
-
app_name=app_name,
|
80
|
+
app_name=session.app_name,
|
79
81
|
agent=root_agent,
|
80
82
|
artifact_service=artifact_service,
|
81
83
|
session_service=session_service,
|
82
84
|
)
|
83
85
|
while True:
|
84
|
-
query = input('user: ')
|
86
|
+
query = input('[user]: ')
|
85
87
|
if not query or not query.strip():
|
86
88
|
continue
|
87
89
|
if query == 'exit':
|
@@ -100,7 +102,8 @@ async def run_cli(
|
|
100
102
|
*,
|
101
103
|
agent_parent_dir: str,
|
102
104
|
agent_folder_name: str,
|
103
|
-
|
105
|
+
input_file: Optional[str] = None,
|
106
|
+
saved_session_file: Optional[str] = None,
|
104
107
|
save_session: bool,
|
105
108
|
) -> None:
|
106
109
|
"""Runs an interactive CLI for a certain agent.
|
@@ -109,8 +112,11 @@ async def run_cli(
|
|
109
112
|
agent_parent_dir: str, the absolute path of the parent folder of the agent
|
110
113
|
folder.
|
111
114
|
agent_folder_name: str, the name of the agent folder.
|
112
|
-
|
113
|
-
|
115
|
+
input_file: Optional[str], the absolute path to the json file that contains
|
116
|
+
the initial session state and user queries, exclusive with
|
117
|
+
saved_session_file.
|
118
|
+
saved_session_file: Optional[str], the absolute path to the json file that
|
119
|
+
contains a previously saved session, exclusive with input_file.
|
114
120
|
save_session: bool, whether to save the session on exit.
|
115
121
|
"""
|
116
122
|
if agent_parent_dir not in sys.path:
|
@@ -118,46 +124,50 @@ async def run_cli(
|
|
118
124
|
|
119
125
|
artifact_service = InMemoryArtifactService()
|
120
126
|
session_service = InMemorySessionService()
|
121
|
-
session = session_service.create_session(
|
122
|
-
app_name=agent_folder_name, user_id='test_user'
|
123
|
-
)
|
124
127
|
|
125
128
|
agent_module_path = os.path.join(agent_parent_dir, agent_folder_name)
|
126
129
|
agent_module = importlib.import_module(agent_folder_name)
|
130
|
+
user_id = 'test_user'
|
131
|
+
session = session_service.create_session(
|
132
|
+
app_name=agent_folder_name, user_id=user_id
|
133
|
+
)
|
127
134
|
root_agent = agent_module.agent.root_agent
|
128
135
|
envs.load_dotenv_for_agent(agent_folder_name, agent_parent_dir)
|
129
|
-
if
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
136
|
+
if input_file:
|
137
|
+
session = await run_input_file(
|
138
|
+
app_name=agent_folder_name,
|
139
|
+
user_id=user_id,
|
140
|
+
root_agent=root_agent,
|
141
|
+
artifact_service=artifact_service,
|
142
|
+
session_service=session_service,
|
143
|
+
input_path=input_file,
|
144
|
+
)
|
145
|
+
elif saved_session_file:
|
146
|
+
|
147
|
+
loaded_session = None
|
148
|
+
with open(saved_session_file, 'r') as f:
|
149
|
+
loaded_session = Session.model_validate_json(f.read())
|
150
|
+
|
151
|
+
if loaded_session:
|
152
|
+
for event in loaded_session.events:
|
153
|
+
session_service.append_event(session, event)
|
154
|
+
content = event.content
|
155
|
+
if not content or not content.parts or not content.parts[0].text:
|
156
|
+
continue
|
157
|
+
if event.author == 'user':
|
158
|
+
click.echo(f'[user]: {content.parts[0].text}')
|
145
159
|
else:
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
else:
|
155
|
-
print(f'Unsupported file type: {json_file_path}')
|
156
|
-
exit(1)
|
160
|
+
click.echo(f'[{event.author}]: {content.parts[0].text}')
|
161
|
+
|
162
|
+
await run_interactively(
|
163
|
+
root_agent,
|
164
|
+
artifact_service,
|
165
|
+
session,
|
166
|
+
session_service,
|
167
|
+
)
|
157
168
|
else:
|
158
|
-
|
169
|
+
click.echo(f'Running agent {root_agent.name}, type exit to exit.')
|
159
170
|
await run_interactively(
|
160
|
-
agent_folder_name,
|
161
171
|
root_agent,
|
162
172
|
artifact_service,
|
163
173
|
session,
|
@@ -165,11 +175,8 @@ async def run_cli(
|
|
165
175
|
)
|
166
176
|
|
167
177
|
if save_session:
|
168
|
-
|
169
|
-
|
170
|
-
else:
|
171
|
-
session_id = input('Session ID to save: ')
|
172
|
-
session_path = f'{agent_module_path}/{session_id}.session.json'
|
178
|
+
session_id = input('Session ID to save: ')
|
179
|
+
session_path = f'{agent_module_path}/{session_id}.session.json'
|
173
180
|
|
174
181
|
# Fetch the session again to get all the details.
|
175
182
|
session = session_service.get_session(
|
@@ -96,6 +96,23 @@ def cli_create_cmd(
|
|
96
96
|
)
|
97
97
|
|
98
98
|
|
99
|
+
def validate_exclusive(ctx, param, value):
|
100
|
+
# Store the validated parameters in the context
|
101
|
+
if not hasattr(ctx, "exclusive_opts"):
|
102
|
+
ctx.exclusive_opts = {}
|
103
|
+
|
104
|
+
# If this option has a value and we've already seen another exclusive option
|
105
|
+
if value is not None and any(ctx.exclusive_opts.values()):
|
106
|
+
exclusive_opt = next(key for key, val in ctx.exclusive_opts.items() if val)
|
107
|
+
raise click.UsageError(
|
108
|
+
f"Options '{param.name}' and '{exclusive_opt}' cannot be set together."
|
109
|
+
)
|
110
|
+
|
111
|
+
# Record this option's value
|
112
|
+
ctx.exclusive_opts[param.name] = value is not None
|
113
|
+
return value
|
114
|
+
|
115
|
+
|
99
116
|
@main.command("run")
|
100
117
|
@click.option(
|
101
118
|
"--save_session",
|
@@ -105,13 +122,43 @@ def cli_create_cmd(
|
|
105
122
|
default=False,
|
106
123
|
help="Optional. Whether to save the session to a json file on exit.",
|
107
124
|
)
|
125
|
+
@click.option(
|
126
|
+
"--replay",
|
127
|
+
type=click.Path(
|
128
|
+
exists=True, dir_okay=False, file_okay=True, resolve_path=True
|
129
|
+
),
|
130
|
+
help=(
|
131
|
+
"The json file that contains the initial state of the session and user"
|
132
|
+
" queries. A new session will be created using this state. And user"
|
133
|
+
" queries are run againt the newly created session. Users cannot"
|
134
|
+
" continue to interact with the agent."
|
135
|
+
),
|
136
|
+
callback=validate_exclusive,
|
137
|
+
)
|
138
|
+
@click.option(
|
139
|
+
"--resume",
|
140
|
+
type=click.Path(
|
141
|
+
exists=True, dir_okay=False, file_okay=True, resolve_path=True
|
142
|
+
),
|
143
|
+
help=(
|
144
|
+
"The json file that contains a previously saved session (by"
|
145
|
+
"--save_session option). The previous session will be re-displayed. And"
|
146
|
+
" user can continue to interact with the agent."
|
147
|
+
),
|
148
|
+
callback=validate_exclusive,
|
149
|
+
)
|
108
150
|
@click.argument(
|
109
151
|
"agent",
|
110
152
|
type=click.Path(
|
111
153
|
exists=True, dir_okay=True, file_okay=False, resolve_path=True
|
112
154
|
),
|
113
155
|
)
|
114
|
-
def cli_run(
|
156
|
+
def cli_run(
|
157
|
+
agent: str,
|
158
|
+
save_session: bool,
|
159
|
+
replay: Optional[str],
|
160
|
+
resume: Optional[str],
|
161
|
+
):
|
115
162
|
"""Runs an interactive CLI for a certain agent.
|
116
163
|
|
117
164
|
AGENT: The path to the agent source code folder.
|
@@ -129,6 +176,8 @@ def cli_run(agent: str, save_session: bool):
|
|
129
176
|
run_cli(
|
130
177
|
agent_parent_dir=agent_parent_folder,
|
131
178
|
agent_folder_name=agent_folder_name,
|
179
|
+
input_file=replay,
|
180
|
+
saved_session_file=resume,
|
132
181
|
save_session=save_session,
|
133
182
|
)
|
134
183
|
)
|
@@ -48,8 +48,13 @@ class EventActions(BaseModel):
|
|
48
48
|
"""The agent is escalating to a higher level agent."""
|
49
49
|
|
50
50
|
requested_auth_configs: dict[str, AuthConfig] = Field(default_factory=dict)
|
51
|
-
"""
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
"""Authentication configurations requested by tool responses.
|
52
|
+
|
53
|
+
This field will only be set by a tool response event indicating tool request
|
54
|
+
auth credential.
|
55
|
+
- Keys: The function call id. Since one function response event could contain
|
56
|
+
multiple function responses that correspond to multiple function calls. Each
|
57
|
+
function call could request different auth configs. This id is used to
|
58
|
+
identify the function call.
|
59
|
+
- Values: The requested auth config.
|
55
60
|
"""
|
@@ -15,9 +15,7 @@
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
17
|
import copy
|
18
|
-
from typing import AsyncGenerator
|
19
|
-
from typing import Generator
|
20
|
-
from typing import Optional
|
18
|
+
from typing import AsyncGenerator, Generator, Optional
|
21
19
|
|
22
20
|
from google.genai import types
|
23
21
|
from typing_extensions import override
|
@@ -202,8 +200,14 @@ def _get_contents(
|
|
202
200
|
# Parse the events, leaving the contents and the function calls and
|
203
201
|
# responses from the current agent.
|
204
202
|
for event in events:
|
205
|
-
if
|
206
|
-
|
203
|
+
if (
|
204
|
+
not event.content
|
205
|
+
or not event.content.role
|
206
|
+
or not event.content.parts
|
207
|
+
or event.content.parts[0].text == ''
|
208
|
+
):
|
209
|
+
# Skip events without content, or generated neither by user nor by model
|
210
|
+
# or has empty text.
|
207
211
|
# E.g. events purely for mutating session states.
|
208
212
|
continue
|
209
213
|
if not _is_event_belongs_to_branch(current_branch, event):
|
@@ -151,28 +151,33 @@ async def handle_function_calls_async(
|
|
151
151
|
# do not use "args" as the variable name, because it is a reserved keyword
|
152
152
|
# in python debugger.
|
153
153
|
function_args = function_call.args or {}
|
154
|
-
function_response = None
|
155
|
-
|
154
|
+
function_response: Optional[dict] = None
|
155
|
+
|
156
|
+
# before_tool_callback (sync or async)
|
156
157
|
if agent.before_tool_callback:
|
157
158
|
function_response = agent.before_tool_callback(
|
158
159
|
tool=tool, args=function_args, tool_context=tool_context
|
159
160
|
)
|
161
|
+
if inspect.isawaitable(function_response):
|
162
|
+
function_response = await function_response
|
160
163
|
|
161
164
|
if not function_response:
|
162
165
|
function_response = await __call_tool_async(
|
163
166
|
tool, args=function_args, tool_context=tool_context
|
164
167
|
)
|
165
168
|
|
166
|
-
#
|
169
|
+
# after_tool_callback (sync or async)
|
167
170
|
if agent.after_tool_callback:
|
168
|
-
|
171
|
+
altered_function_response = agent.after_tool_callback(
|
169
172
|
tool=tool,
|
170
173
|
args=function_args,
|
171
174
|
tool_context=tool_context,
|
172
175
|
tool_response=function_response,
|
173
176
|
)
|
174
|
-
if
|
175
|
-
|
177
|
+
if inspect.isawaitable(altered_function_response):
|
178
|
+
altered_function_response = await altered_function_response
|
179
|
+
if altered_function_response is not None:
|
180
|
+
function_response = altered_function_response
|
176
181
|
|
177
182
|
if tool.is_long_running:
|
178
183
|
# Allow long running function to return None to not provide function response.
|
@@ -223,11 +228,17 @@ async def handle_function_calls_live(
|
|
223
228
|
# in python debugger.
|
224
229
|
function_args = function_call.args or {}
|
225
230
|
function_response = None
|
226
|
-
# Calls the tool if before_tool_callback does not exist or returns None.
|
231
|
+
# # Calls the tool if before_tool_callback does not exist or returns None.
|
232
|
+
# if agent.before_tool_callback:
|
233
|
+
# function_response = agent.before_tool_callback(
|
234
|
+
# tool, function_args, tool_context
|
235
|
+
# )
|
227
236
|
if agent.before_tool_callback:
|
228
237
|
function_response = agent.before_tool_callback(
|
229
|
-
tool, function_args, tool_context
|
238
|
+
tool=tool, args=function_args, tool_context=tool_context
|
230
239
|
)
|
240
|
+
if inspect.isawaitable(function_response):
|
241
|
+
function_response = await function_response
|
231
242
|
|
232
243
|
if not function_response:
|
233
244
|
function_response = await _process_function_live_helper(
|
@@ -235,15 +246,26 @@ async def handle_function_calls_live(
|
|
235
246
|
)
|
236
247
|
|
237
248
|
# Calls after_tool_callback if it exists.
|
249
|
+
# if agent.after_tool_callback:
|
250
|
+
# new_response = agent.after_tool_callback(
|
251
|
+
# tool,
|
252
|
+
# function_args,
|
253
|
+
# tool_context,
|
254
|
+
# function_response,
|
255
|
+
# )
|
256
|
+
# if new_response:
|
257
|
+
# function_response = new_response
|
238
258
|
if agent.after_tool_callback:
|
239
|
-
|
240
|
-
tool,
|
241
|
-
function_args,
|
242
|
-
tool_context,
|
243
|
-
function_response,
|
259
|
+
altered_function_response = agent.after_tool_callback(
|
260
|
+
tool=tool,
|
261
|
+
args=function_args,
|
262
|
+
tool_context=tool_context,
|
263
|
+
tool_response=function_response,
|
244
264
|
)
|
245
|
-
if
|
246
|
-
|
265
|
+
if inspect.isawaitable(altered_function_response):
|
266
|
+
altered_function_response = await altered_function_response
|
267
|
+
if altered_function_response is not None:
|
268
|
+
function_response = altered_function_response
|
247
269
|
|
248
270
|
if tool.is_long_running:
|
249
271
|
# Allow async function to return None to not provide function response.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"""Utility functions for session service."""
|
2
|
+
|
3
|
+
import base64
|
4
|
+
from typing import Any, Optional
|
5
|
+
|
6
|
+
from google.genai import types
|
7
|
+
|
8
|
+
|
9
|
+
def encode_content(content: types.Content):
|
10
|
+
"""Encodes a content object to a JSON dictionary."""
|
11
|
+
encoded_content = content.model_dump(exclude_none=True)
|
12
|
+
for p in encoded_content["parts"]:
|
13
|
+
if "inline_data" in p:
|
14
|
+
p["inline_data"]["data"] = base64.b64encode(
|
15
|
+
p["inline_data"]["data"]
|
16
|
+
).decode("utf-8")
|
17
|
+
return encoded_content
|
18
|
+
|
19
|
+
|
20
|
+
def decode_content(
|
21
|
+
content: Optional[dict[str, Any]],
|
22
|
+
) -> Optional[types.Content]:
|
23
|
+
"""Decodes a content object from a JSON dictionary."""
|
24
|
+
if not content:
|
25
|
+
return None
|
26
|
+
for p in content["parts"]:
|
27
|
+
if "inline_data" in p:
|
28
|
+
p["inline_data"]["data"] = base64.b64decode(p["inline_data"]["data"])
|
29
|
+
return types.Content.model_validate(content)
|