google-adk 1.5.0__tar.gz → 1.6.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. {google_adk-1.5.0 → google_adk-1.6.1}/PKG-INFO +6 -4
  2. {google_adk-1.5.0 → google_adk-1.6.1}/README.md +1 -1
  3. {google_adk-1.5.0 → google_adk-1.6.1}/pyproject.toml +5 -2
  4. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/a2a/converters/event_converter.py +257 -36
  5. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/a2a/converters/part_converter.py +93 -25
  6. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/a2a/converters/request_converter.py +12 -32
  7. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/a2a/converters/utils.py +22 -4
  8. google_adk-1.6.1/src/google/adk/a2a/executor/a2a_agent_executor.py +260 -0
  9. google_adk-1.6.1/src/google/adk/a2a/executor/task_result_aggregator.py +71 -0
  10. google_adk-1.6.1/src/google/adk/a2a/logs/log_utils.py +349 -0
  11. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/base_agent.py +54 -0
  12. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/llm_agent.py +15 -0
  13. google_adk-1.6.1/src/google/adk/agents/remote_a2a_agent.py +532 -0
  14. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/artifacts/in_memory_artifact_service.py +6 -3
  15. google_adk-1.6.1/src/google/adk/cli/browser/chunk-EQDQRRRY.js +1 -0
  16. google_adk-1.6.1/src/google/adk/cli/browser/chunk-TXJFAAIW.js +2 -0
  17. google_adk-1.6.1/src/google/adk/cli/browser/index.html +34 -0
  18. google_adk-1.6.1/src/google/adk/cli/browser/main-RXDVX3K6.js +3914 -0
  19. google_adk-1.6.1/src/google/adk/cli/browser/polyfills-FFHMD2TL.js +17 -0
  20. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/cli_deploy.py +4 -1
  21. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/cli_eval.py +8 -6
  22. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/cli_tools_click.py +30 -10
  23. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/fast_api.py +120 -5
  24. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/utils/agent_loader.py +12 -0
  25. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/agent_evaluator.py +107 -10
  26. google_adk-1.6.1/src/google/adk/evaluation/base_eval_service.py +157 -0
  27. google_adk-1.6.1/src/google/adk/evaluation/constants.py +20 -0
  28. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/eval_case.py +3 -3
  29. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/eval_metrics.py +39 -0
  30. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/evaluation_generator.py +1 -1
  31. google_adk-1.6.1/src/google/adk/evaluation/final_response_match_v2.py +230 -0
  32. google_adk-1.6.1/src/google/adk/evaluation/llm_as_judge.py +141 -0
  33. google_adk-1.6.1/src/google/adk/evaluation/llm_as_judge_utils.py +48 -0
  34. google_adk-1.6.1/src/google/adk/evaluation/metric_evaluator_registry.py +89 -0
  35. google_adk-1.6.1/src/google/adk/evaluation/response_evaluator.py +90 -0
  36. google_adk-1.6.1/src/google/adk/evaluation/safety_evaluator.py +54 -0
  37. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/trajectory_evaluator.py +16 -2
  38. google_adk-1.6.1/src/google/adk/evaluation/vertex_ai_eval_facade.py +147 -0
  39. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/events/event.py +2 -4
  40. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/base_llm_flow.py +2 -0
  41. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/memory/in_memory_memory_service.py +3 -2
  42. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/lite_llm.py +50 -10
  43. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/runners.py +27 -10
  44. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/sessions/database_session_service.py +25 -7
  45. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/sessions/in_memory_session_service.py +5 -1
  46. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/sessions/vertex_ai_session_service.py +67 -42
  47. google_adk-1.6.1/src/google/adk/tools/apihub_tool/clients/__init__.py +13 -0
  48. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/bigquery/config.py +11 -1
  49. google_adk-1.6.1/src/google/adk/tools/bigquery/query_tool.py +488 -0
  50. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/enterprise_search_tool.py +2 -2
  51. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/function_tool.py +7 -1
  52. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/google_search_tool.py +1 -1
  53. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/mcp_tool/mcp_session_manager.py +44 -30
  54. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/mcp_tool/mcp_tool.py +44 -7
  55. google_adk-1.6.1/src/google/adk/utils/__init__.py +13 -0
  56. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/version.py +1 -1
  57. google_adk-1.5.0/src/google/adk/cli/browser/index.html +0 -33
  58. google_adk-1.5.0/src/google/adk/cli/browser/main-JAAWEV7F.js +0 -92
  59. google_adk-1.5.0/src/google/adk/cli/browser/polyfills-B6TNHZQ6.js +0 -17
  60. google_adk-1.5.0/src/google/adk/evaluation/response_evaluator.py +0 -263
  61. google_adk-1.5.0/src/google/adk/tools/bigquery/query_tool.py +0 -194
  62. {google_adk-1.5.0 → google_adk-1.6.1}/LICENSE +0 -0
  63. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/__init__.py +0 -0
  64. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/a2a/__init__.py +0 -0
  65. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/a2a/converters/__init__.py +0 -0
  66. {google_adk-1.5.0/src/google/adk/auth/credential_service → google_adk-1.6.1/src/google/adk/a2a/executor}/__init__.py +0 -0
  67. {google_adk-1.5.0/src/google/adk/errors → google_adk-1.6.1/src/google/adk/a2a/logs}/__init__.py +0 -0
  68. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/__init__.py +0 -0
  69. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/active_streaming_tool.py +0 -0
  70. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/callback_context.py +0 -0
  71. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/invocation_context.py +0 -0
  72. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/langgraph_agent.py +0 -0
  73. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/live_request_queue.py +0 -0
  74. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/loop_agent.py +0 -0
  75. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/parallel_agent.py +0 -0
  76. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/readonly_context.py +0 -0
  77. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/run_config.py +0 -0
  78. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/sequential_agent.py +0 -0
  79. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/agents/transcription_entry.py +0 -0
  80. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/artifacts/__init__.py +0 -0
  81. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/artifacts/base_artifact_service.py +0 -0
  82. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/artifacts/gcs_artifact_service.py +0 -0
  83. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/__init__.py +0 -0
  84. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/auth_credential.py +0 -0
  85. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/auth_handler.py +0 -0
  86. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/auth_preprocessor.py +0 -0
  87. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/auth_schemes.py +0 -0
  88. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/auth_tool.py +0 -0
  89. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/credential_manager.py +0 -0
  90. {google_adk-1.5.0/src/google/adk/flows → google_adk-1.6.1/src/google/adk/auth/credential_service}/__init__.py +0 -0
  91. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/credential_service/base_credential_service.py +0 -0
  92. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/credential_service/in_memory_credential_service.py +0 -0
  93. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/credential_service/session_state_credential_service.py +0 -0
  94. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/exchanger/__init__.py +0 -0
  95. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/exchanger/base_credential_exchanger.py +0 -0
  96. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/exchanger/credential_exchanger_registry.py +0 -0
  97. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/exchanger/oauth2_credential_exchanger.py +0 -0
  98. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/oauth2_credential_util.py +0 -0
  99. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/refresher/__init__.py +0 -0
  100. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/refresher/base_credential_refresher.py +0 -0
  101. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/refresher/credential_refresher_registry.py +0 -0
  102. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/auth/refresher/oauth2_credential_refresher.py +0 -0
  103. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/__init__.py +0 -0
  104. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/__main__.py +0 -0
  105. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/agent_graph.py +0 -0
  106. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/browser/adk_favicon.svg +0 -0
  107. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/browser/assets/ADK-512-color.svg +0 -0
  108. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/browser/assets/audio-processor.js +0 -0
  109. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/browser/assets/config/runtime-config.json +0 -0
  110. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/browser/styles-4VDSPQ37.css +0 -0
  111. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/cli.py +0 -0
  112. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/cli_create.py +0 -0
  113. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/utils/__init__.py +0 -0
  114. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/utils/cleanup.py +0 -0
  115. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/utils/common.py +0 -0
  116. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/utils/envs.py +0 -0
  117. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/utils/evals.py +0 -0
  118. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/cli/utils/logs.py +0 -0
  119. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/code_executors/__init__.py +0 -0
  120. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/code_executors/base_code_executor.py +0 -0
  121. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/code_executors/built_in_code_executor.py +0 -0
  122. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/code_executors/code_execution_utils.py +0 -0
  123. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/code_executors/code_executor_context.py +0 -0
  124. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/code_executors/container_code_executor.py +0 -0
  125. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/code_executors/unsafe_local_code_executor.py +0 -0
  126. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/code_executors/vertex_ai_code_executor.py +0 -0
  127. {google_adk-1.5.0/src/google/adk/platform → google_adk-1.6.1/src/google/adk/errors}/__init__.py +0 -0
  128. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/errors/not_found_error.py +0 -0
  129. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/__init__.py +0 -0
  130. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/_eval_set_results_manager_utils.py +0 -0
  131. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/_eval_sets_manager_utils.py +0 -0
  132. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/eval_result.py +0 -0
  133. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/eval_set.py +0 -0
  134. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/eval_set_results_manager.py +0 -0
  135. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/eval_sets_manager.py +0 -0
  136. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/evaluation_constants.py +0 -0
  137. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/evaluator.py +0 -0
  138. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/final_response_match_v1.py +0 -0
  139. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/gcs_eval_set_results_manager.py +0 -0
  140. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/gcs_eval_sets_manager.py +0 -0
  141. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/local_eval_set_results_manager.py +0 -0
  142. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/evaluation/local_eval_sets_manager.py +0 -0
  143. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/events/__init__.py +0 -0
  144. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/events/event_actions.py +0 -0
  145. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/examples/__init__.py +0 -0
  146. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/examples/base_example_provider.py +0 -0
  147. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/examples/example.py +0 -0
  148. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/examples/example_util.py +0 -0
  149. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/examples/vertex_ai_example_store.py +0 -0
  150. {google_adk-1.5.0/src/google/adk/tools/apihub_tool/clients → google_adk-1.6.1/src/google/adk/flows}/__init__.py +0 -0
  151. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/__init__.py +0 -0
  152. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/_base_llm_processor.py +0 -0
  153. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/_code_execution.py +0 -0
  154. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/_nl_planning.py +0 -0
  155. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/agent_transfer.py +0 -0
  156. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/audio_transcriber.py +0 -0
  157. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/auto_flow.py +0 -0
  158. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/basic.py +0 -0
  159. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/contents.py +0 -0
  160. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/functions.py +0 -0
  161. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/identity.py +0 -0
  162. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/instructions.py +0 -0
  163. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/flows/llm_flows/single_flow.py +0 -0
  164. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/memory/__init__.py +0 -0
  165. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/memory/_utils.py +0 -0
  166. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/memory/base_memory_service.py +0 -0
  167. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/memory/memory_entry.py +0 -0
  168. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/memory/vertex_ai_memory_bank_service.py +0 -0
  169. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/memory/vertex_ai_rag_memory_service.py +0 -0
  170. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/__init__.py +0 -0
  171. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/anthropic_llm.py +0 -0
  172. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/base_llm.py +0 -0
  173. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/base_llm_connection.py +0 -0
  174. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/gemini_llm_connection.py +0 -0
  175. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/google_llm.py +0 -0
  176. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/llm_request.py +0 -0
  177. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/llm_response.py +0 -0
  178. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/models/registry.py +0 -0
  179. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/planners/__init__.py +0 -0
  180. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/planners/base_planner.py +0 -0
  181. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/planners/built_in_planner.py +0 -0
  182. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/planners/plan_re_act_planner.py +0 -0
  183. {google_adk-1.5.0/src/google/adk/utils → google_adk-1.6.1/src/google/adk/platform}/__init__.py +0 -0
  184. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/platform/internal/__init__.py +0 -0
  185. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/platform/internal/thread.py +0 -0
  186. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/platform/thread.py +0 -0
  187. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/py.typed +0 -0
  188. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/sessions/__init__.py +0 -0
  189. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/sessions/_session_util.py +0 -0
  190. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/sessions/base_session_service.py +0 -0
  191. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/sessions/session.py +0 -0
  192. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/sessions/state.py +0 -0
  193. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/telemetry.py +0 -0
  194. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/__init__.py +0 -0
  195. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/_automatic_function_calling_util.py +0 -0
  196. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/_forwarding_artifact_service.py +0 -0
  197. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/_function_parameter_parse_util.py +0 -0
  198. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/_gemini_schema_util.py +0 -0
  199. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/_memory_entry_utils.py +0 -0
  200. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/agent_tool.py +0 -0
  201. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/apihub_tool/__init__.py +0 -0
  202. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/apihub_tool/apihub_toolset.py +0 -0
  203. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/apihub_tool/clients/apihub_client.py +0 -0
  204. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/apihub_tool/clients/secret_client.py +0 -0
  205. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/application_integration_tool/__init__.py +0 -0
  206. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/application_integration_tool/application_integration_toolset.py +0 -0
  207. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/application_integration_tool/clients/connections_client.py +0 -0
  208. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/application_integration_tool/clients/integration_client.py +0 -0
  209. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/application_integration_tool/integration_connector_tool.py +0 -0
  210. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/authenticated_function_tool.py +0 -0
  211. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/base_authenticated_tool.py +0 -0
  212. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/base_tool.py +0 -0
  213. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/base_toolset.py +0 -0
  214. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/bigquery/__init__.py +0 -0
  215. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/bigquery/bigquery_credentials.py +0 -0
  216. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/bigquery/bigquery_tool.py +0 -0
  217. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/bigquery/bigquery_toolset.py +0 -0
  218. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/bigquery/client.py +0 -0
  219. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/bigquery/metadata_tool.py +0 -0
  220. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/crewai_tool.py +0 -0
  221. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/example_tool.py +0 -0
  222. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/exit_loop_tool.py +0 -0
  223. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/get_user_choice_tool.py +0 -0
  224. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/google_api_tool/__init__.py +0 -0
  225. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/google_api_tool/google_api_tool.py +0 -0
  226. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/google_api_tool/google_api_toolset.py +0 -0
  227. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/google_api_tool/google_api_toolsets.py +0 -0
  228. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/google_api_tool/googleapi_to_openapi_converter.py +0 -0
  229. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/langchain_tool.py +0 -0
  230. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/load_artifacts_tool.py +0 -0
  231. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/load_memory_tool.py +0 -0
  232. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/load_web_page.py +0 -0
  233. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/long_running_tool.py +0 -0
  234. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/mcp_tool/__init__.py +0 -0
  235. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/mcp_tool/conversion_utils.py +0 -0
  236. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/mcp_tool/mcp_toolset.py +0 -0
  237. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/__init__.py +0 -0
  238. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/auth/__init__.py +0 -0
  239. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/auth/auth_helpers.py +0 -0
  240. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/__init__.py +0 -0
  241. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/auto_auth_credential_exchanger.py +0 -0
  242. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/base_credential_exchanger.py +0 -0
  243. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.py +0 -0
  244. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/auth/credential_exchangers/service_account_exchanger.py +0 -0
  245. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/common/__init__.py +0 -0
  246. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/common/common.py +0 -0
  247. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/openapi_spec_parser/__init__.py +0 -0
  248. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.py +0 -0
  249. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/openapi_spec_parser/openapi_toolset.py +0 -0
  250. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/openapi_spec_parser/operation_parser.py +0 -0
  251. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/openapi_spec_parser/rest_api_tool.py +0 -0
  252. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.py +0 -0
  253. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/preload_memory_tool.py +0 -0
  254. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/retrieval/__init__.py +0 -0
  255. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/retrieval/base_retrieval_tool.py +0 -0
  256. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/retrieval/files_retrieval.py +0 -0
  257. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/retrieval/llama_index_retrieval.py +0 -0
  258. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/retrieval/vertex_ai_rag_retrieval.py +0 -0
  259. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/tool_context.py +0 -0
  260. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/toolbox_toolset.py +0 -0
  261. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/transfer_to_agent_tool.py +0 -0
  262. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/url_context_tool.py +0 -0
  263. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/tools/vertex_ai_search_tool.py +0 -0
  264. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/utils/feature_decorator.py +0 -0
  265. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/utils/instructions_utils.py +0 -0
  266. {google_adk-1.5.0 → google_adk-1.6.1}/src/google/adk/utils/variant_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-adk
3
- Version: 1.5.0
3
+ Version: 1.6.1
4
4
  Summary: Agent Development Kit
5
5
  Author-email: Google LLC <googleapis-packages@google.com>
6
6
  Requires-Python: >=3.9
@@ -41,9 +41,11 @@ Requires-Dist: python-dotenv>=1.0.0
41
41
  Requires-Dist: requests>=2.32.4
42
42
  Requires-Dist: sqlalchemy>=2.0
43
43
  Requires-Dist: starlette>=0.46.2
44
+ Requires-Dist: tenacity>=8.0.0
44
45
  Requires-Dist: typing-extensions>=4.5, <5
45
46
  Requires-Dist: tzlocal>=5.3
46
47
  Requires-Dist: uvicorn>=0.34.0
48
+ Requires-Dist: watchdog>=6.0.0
47
49
  Requires-Dist: websockets>=15.0.1
48
50
  Requires-Dist: a2a-sdk>=0.2.7 ; extra == "a2a" and (python_version>='3.10')
49
51
  Requires-Dist: flit>=3.10.0 ; extra == "dev"
@@ -57,7 +59,7 @@ Requires-Dist: myst-parser ; extra == "docs"
57
59
  Requires-Dist: sphinx ; extra == "docs"
58
60
  Requires-Dist: sphinx-autodoc-typehints ; extra == "docs"
59
61
  Requires-Dist: sphinx-rtd-theme ; extra == "docs"
60
- Requires-Dist: google-cloud-aiplatform[evaluation]>=1.87.0 ; extra == "eval"
62
+ Requires-Dist: google-cloud-aiplatform[evaluation]>=1.100.0 ; extra == "eval"
61
63
  Requires-Dist: pandas>=2.2.3 ; extra == "eval"
62
64
  Requires-Dist: tabulate>=0.9.0 ; extra == "eval"
63
65
  Requires-Dist: rouge-score>=0.1.2 ; extra == "eval"
@@ -72,7 +74,7 @@ Requires-Dist: lxml>=5.3.0 ; extra == "extensions"
72
74
  Requires-Dist: toolbox-core>=0.1.0 ; extra == "extensions"
73
75
  Requires-Dist: anthropic>=0.43.0 ; extra == "test"
74
76
  Requires-Dist: langchain-community>=0.3.17 ; extra == "test"
75
- Requires-Dist: langgraph>=0.2.60 ; extra == "test"
77
+ Requires-Dist: langgraph>=0.2.60, <= 0.4.10 ; extra == "test"
76
78
  Requires-Dist: litellm>=1.71.2 ; extra == "test"
77
79
  Requires-Dist: llama-index-readers-file>=0.4.0 ; extra == "test"
78
80
  Requires-Dist: pytest-asyncio>=0.25.0 ; extra == "test"
@@ -137,7 +139,7 @@ Agent Development Kit (ADK) is a flexible and modular framework for developing a
137
139
 
138
140
  For remote agent-to-agent communication, ADK integrates with the
139
141
  [A2A protocol](https://github.com/google-a2a/A2A/).
140
- See this [example](https://github.com/google-a2a/a2a-samples/tree/main/samples/python/agents/google_adk)
142
+ See this [example](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents)
141
143
  for how they can work together.
142
144
 
143
145
  ## 🚀 Installation
@@ -45,7 +45,7 @@ Agent Development Kit (ADK) is a flexible and modular framework for developing a
45
45
 
46
46
  For remote agent-to-agent communication, ADK integrates with the
47
47
  [A2A protocol](https://github.com/google-a2a/A2A/).
48
- See this [example](https://github.com/google-a2a/a2a-samples/tree/main/samples/python/agents/google_adk)
48
+ See this [example](https://github.com/a2aproject/a2a-samples/tree/main/samples/python/agents)
49
49
  for how they can work together.
50
50
 
51
51
  ## 🚀 Installation
@@ -47,9 +47,11 @@ dependencies = [
47
47
  "requests>=2.32.4",
48
48
  "sqlalchemy>=2.0", # SQL database ORM
49
49
  "starlette>=0.46.2", # For FastAPI CLI
50
+ "tenacity>=8.0.0", # For Retry management
50
51
  "typing-extensions>=4.5, <5",
51
52
  "tzlocal>=5.3", # Time zone utilities
52
53
  "uvicorn>=0.34.0", # ASGI server for FastAPI
54
+ "watchdog>=6.0.0", # For file change detection and hot reload
53
55
  "websockets>=15.0.1", # For BaseLlmFlow
54
56
  # go/keep-sorted end
55
57
  ]
@@ -84,7 +86,7 @@ a2a = [
84
86
 
85
87
  eval = [
86
88
  # go/keep-sorted start
87
- "google-cloud-aiplatform[evaluation]>=1.87.0",
89
+ "google-cloud-aiplatform[evaluation]>=1.100.0",
88
90
  "pandas>=2.2.3",
89
91
  "tabulate>=0.9.0",
90
92
  "rouge-score>=0.1.2",
@@ -95,7 +97,8 @@ test = [
95
97
  # go/keep-sorted start
96
98
  "anthropic>=0.43.0", # For anthropic model tests
97
99
  "langchain-community>=0.3.17",
98
- "langgraph>=0.2.60", # For LangGraphAgent
100
+ # langgraph 0.5 removed langgraph.graph.graph which we depend on
101
+ "langgraph>=0.2.60, <= 0.4.10", # For LangGraphAgent
99
102
  "litellm>=1.71.2", # For LiteLLM tests
100
103
  "llama-index-readers-file>=0.4.0", # For retrieval tests
101
104
  "pytest-asyncio>=0.25.0",
@@ -14,7 +14,8 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- import datetime
17
+ from datetime import datetime
18
+ from datetime import timezone
18
19
  import logging
19
20
  from typing import Any
20
21
  from typing import Dict
@@ -26,18 +27,24 @@ from a2a.server.events import Event as A2AEvent
26
27
  from a2a.types import Artifact
27
28
  from a2a.types import DataPart
28
29
  from a2a.types import Message
30
+ from a2a.types import Part as A2APart
29
31
  from a2a.types import Role
32
+ from a2a.types import Task
30
33
  from a2a.types import TaskArtifactUpdateEvent
31
34
  from a2a.types import TaskState
32
35
  from a2a.types import TaskStatus
33
36
  from a2a.types import TaskStatusUpdateEvent
34
37
  from a2a.types import TextPart
38
+ from google.genai import types as genai_types
35
39
 
36
40
  from ...agents.invocation_context import InvocationContext
37
41
  from ...events.event import Event
38
- from ...utils.feature_decorator import working_in_progress
42
+ from ...flows.llm_flows.functions import REQUEST_EUC_FUNCTION_CALL_NAME
43
+ from ...utils.feature_decorator import experimental
44
+ from .part_converter import A2A_DATA_PART_METADATA_IS_LONG_RUNNING_KEY
39
45
  from .part_converter import A2A_DATA_PART_METADATA_TYPE_FUNCTION_CALL
40
46
  from .part_converter import A2A_DATA_PART_METADATA_TYPE_KEY
47
+ from .part_converter import convert_a2a_part_to_genai_part
41
48
  from .part_converter import convert_genai_part_to_a2a_part
42
49
  from .utils import _get_adk_metadata_key
43
50
 
@@ -143,6 +150,8 @@ def _convert_artifact_to_a2a_events(
143
150
  invocation_context: InvocationContext,
144
151
  filename: str,
145
152
  version: int,
153
+ task_id: Optional[str] = None,
154
+ context_id: Optional[str] = None,
146
155
  ) -> TaskArtifactUpdateEvent:
147
156
  """Converts a new artifact version to an A2A TaskArtifactUpdateEvent.
148
157
 
@@ -151,6 +160,7 @@ def _convert_artifact_to_a2a_events(
151
160
  invocation_context: The invocation context.
152
161
  filename: The name of the artifact file.
153
162
  version: The version number of the artifact.
163
+ task_id: Optional task ID to use for generated events. If not provided, new UUIDs will be generated.
154
164
 
155
165
  Returns:
156
166
  A TaskArtifactUpdateEvent representing the artifact update.
@@ -186,9 +196,9 @@ def _convert_artifact_to_a2a_events(
186
196
  )
187
197
 
188
198
  return TaskArtifactUpdateEvent(
189
- taskId=str(uuid.uuid4()),
199
+ taskId=task_id,
190
200
  append=False,
191
- contextId=invocation_context.session.id,
201
+ contextId=context_id,
192
202
  lastChunk=True,
193
203
  artifact=Artifact(
194
204
  artifactId=artifact_id,
@@ -210,7 +220,7 @@ def _convert_artifact_to_a2a_events(
210
220
  raise RuntimeError(f"Artifact conversion failed: {e}") from e
211
221
 
212
222
 
213
- def _process_long_running_tool(a2a_part, event: Event) -> None:
223
+ def _process_long_running_tool(a2a_part: A2APart, event: Event) -> None:
214
224
  """Processes long-running tool metadata for an A2A part.
215
225
 
216
226
  Args:
@@ -220,18 +230,172 @@ def _process_long_running_tool(a2a_part, event: Event) -> None:
220
230
  if (
221
231
  isinstance(a2a_part.root, DataPart)
222
232
  and event.long_running_tool_ids
233
+ and a2a_part.root.metadata
223
234
  and a2a_part.root.metadata.get(
224
235
  _get_adk_metadata_key(A2A_DATA_PART_METADATA_TYPE_KEY)
225
236
  )
226
237
  == A2A_DATA_PART_METADATA_TYPE_FUNCTION_CALL
227
- and a2a_part.root.metadata.get("id") in event.long_running_tool_ids
238
+ and a2a_part.root.data.get("id") in event.long_running_tool_ids
228
239
  ):
229
- a2a_part.root.metadata[_get_adk_metadata_key("is_long_running")] = True
240
+ a2a_part.root.metadata[
241
+ _get_adk_metadata_key(A2A_DATA_PART_METADATA_IS_LONG_RUNNING_KEY)
242
+ ] = True
230
243
 
231
244
 
232
- @working_in_progress
233
- def convert_event_to_a2a_status_message(
234
- event: Event, invocation_context: InvocationContext
245
+ def convert_a2a_task_to_event(
246
+ a2a_task: Task,
247
+ author: Optional[str] = None,
248
+ invocation_context: Optional[InvocationContext] = None,
249
+ ) -> Event:
250
+ """Converts an A2A task to an ADK event.
251
+
252
+ Args:
253
+ a2a_task: The A2A task to convert. Must not be None.
254
+ author: The author of the event. Defaults to "a2a agent" if not provided.
255
+ invocation_context: The invocation context containing session information.
256
+ If provided, the branch will be set from the context.
257
+
258
+ Returns:
259
+ An ADK Event object representing the converted task.
260
+
261
+ Raises:
262
+ ValueError: If a2a_task is None.
263
+ RuntimeError: If conversion of the underlying message fails.
264
+ """
265
+ if a2a_task is None:
266
+ raise ValueError("A2A task cannot be None")
267
+
268
+ try:
269
+ # Extract message from task status or history
270
+ message = None
271
+ if a2a_task.status and a2a_task.status.message:
272
+ message = a2a_task.status.message
273
+ elif a2a_task.history:
274
+ message = a2a_task.history[-1]
275
+
276
+ # Convert message if available
277
+ if message:
278
+ try:
279
+ return convert_a2a_message_to_event(message, author, invocation_context)
280
+ except Exception as e:
281
+ logger.error("Failed to convert A2A task message to event: %s", e)
282
+ raise RuntimeError(f"Failed to convert task message: {e}") from e
283
+
284
+ # Create minimal event if no message is available
285
+ return Event(
286
+ invocation_id=(
287
+ invocation_context.invocation_id
288
+ if invocation_context
289
+ else str(uuid.uuid4())
290
+ ),
291
+ author=author or "a2a agent",
292
+ branch=invocation_context.branch if invocation_context else None,
293
+ )
294
+
295
+ except Exception as e:
296
+ logger.error("Failed to convert A2A task to event: %s", e)
297
+ raise
298
+
299
+
300
+ @experimental
301
+ def convert_a2a_message_to_event(
302
+ a2a_message: Message,
303
+ author: Optional[str] = None,
304
+ invocation_context: Optional[InvocationContext] = None,
305
+ ) -> Event:
306
+ """Converts an A2A message to an ADK event.
307
+
308
+ Args:
309
+ a2a_message: The A2A message to convert. Must not be None.
310
+ author: The author of the event. Defaults to "a2a agent" if not provided.
311
+ invocation_context: The invocation context containing session information.
312
+ If provided, the branch will be set from the context.
313
+
314
+ Returns:
315
+ An ADK Event object with converted content and long-running tool metadata.
316
+
317
+ Raises:
318
+ ValueError: If a2a_message is None.
319
+ RuntimeError: If conversion of message parts fails.
320
+ """
321
+ if a2a_message is None:
322
+ raise ValueError("A2A message cannot be None")
323
+
324
+ if not a2a_message.parts:
325
+ logger.warning(
326
+ "A2A message has no parts, creating event with empty content"
327
+ )
328
+ return Event(
329
+ invocation_id=(
330
+ invocation_context.invocation_id
331
+ if invocation_context
332
+ else str(uuid.uuid4())
333
+ ),
334
+ author=author or "a2a agent",
335
+ branch=invocation_context.branch if invocation_context else None,
336
+ content=genai_types.Content(role="model", parts=[]),
337
+ )
338
+
339
+ try:
340
+ parts = []
341
+ long_running_tool_ids = set()
342
+
343
+ for a2a_part in a2a_message.parts:
344
+ try:
345
+ part = convert_a2a_part_to_genai_part(a2a_part)
346
+ if part is None:
347
+ logger.warning("Failed to convert A2A part, skipping: %s", a2a_part)
348
+ continue
349
+
350
+ # Check for long-running tools
351
+ if (
352
+ a2a_part.root.metadata
353
+ and a2a_part.root.metadata.get(
354
+ _get_adk_metadata_key(
355
+ A2A_DATA_PART_METADATA_IS_LONG_RUNNING_KEY
356
+ )
357
+ )
358
+ is True
359
+ ):
360
+ long_running_tool_ids.add(part.function_call.id)
361
+
362
+ parts.append(part)
363
+
364
+ except Exception as e:
365
+ logger.error("Failed to convert A2A part: %s, error: %s", a2a_part, e)
366
+ # Continue processing other parts instead of failing completely
367
+ continue
368
+
369
+ if not parts:
370
+ logger.warning(
371
+ "No parts could be converted from A2A message %s", a2a_message
372
+ )
373
+
374
+ return Event(
375
+ invocation_id=(
376
+ invocation_context.invocation_id
377
+ if invocation_context
378
+ else str(uuid.uuid4())
379
+ ),
380
+ author=author or "a2a agent",
381
+ branch=invocation_context.branch if invocation_context else None,
382
+ long_running_tool_ids=long_running_tool_ids
383
+ if long_running_tool_ids
384
+ else None,
385
+ content=genai_types.Content(
386
+ role="model",
387
+ parts=parts,
388
+ ),
389
+ )
390
+
391
+ except Exception as e:
392
+ logger.error("Failed to convert A2A message to event: %s", e)
393
+ raise RuntimeError(f"Failed to convert message: {e}") from e
394
+
395
+
396
+ @experimental
397
+ def convert_event_to_a2a_message(
398
+ event: Event, invocation_context: InvocationContext, role: Role = Role.agent
235
399
  ) -> Optional[Message]:
236
400
  """Converts an ADK event to an A2A message.
237
401
 
@@ -262,9 +426,7 @@ def convert_event_to_a2a_status_message(
262
426
  _process_long_running_tool(a2a_part, event)
263
427
 
264
428
  if a2a_parts:
265
- return Message(
266
- messageId=str(uuid.uuid4()), role=Role.agent, parts=a2a_parts
267
- )
429
+ return Message(messageId=str(uuid.uuid4()), role=role, parts=a2a_parts)
268
430
 
269
431
  except Exception as e:
270
432
  logger.error("Failed to convert event to status message: %s", e)
@@ -274,38 +436,57 @@ def convert_event_to_a2a_status_message(
274
436
 
275
437
 
276
438
  def _create_error_status_event(
277
- event: Event, invocation_context: InvocationContext
439
+ event: Event,
440
+ invocation_context: InvocationContext,
441
+ task_id: Optional[str] = None,
442
+ context_id: Optional[str] = None,
278
443
  ) -> TaskStatusUpdateEvent:
279
444
  """Creates a TaskStatusUpdateEvent for error scenarios.
280
445
 
281
446
  Args:
282
447
  event: The ADK event containing error information.
283
448
  invocation_context: The invocation context.
449
+ task_id: Optional task ID to use for generated events.
450
+ context_id: Optional Context ID to use for generated events.
284
451
 
285
452
  Returns:
286
453
  A TaskStatusUpdateEvent with FAILED state.
287
454
  """
288
455
  error_message = getattr(event, "error_message", None) or DEFAULT_ERROR_MESSAGE
289
456
 
457
+ # Get context metadata and add error code
458
+ event_metadata = _get_context_metadata(event, invocation_context)
459
+ if event.error_code:
460
+ event_metadata[_get_adk_metadata_key("error_code")] = str(event.error_code)
461
+
290
462
  return TaskStatusUpdateEvent(
291
- taskId=str(uuid.uuid4()),
292
- contextId=invocation_context.session.id,
293
- final=False,
294
- metadata=_get_context_metadata(event, invocation_context),
463
+ taskId=task_id,
464
+ contextId=context_id,
465
+ metadata=event_metadata,
295
466
  status=TaskStatus(
296
467
  state=TaskState.failed,
297
468
  message=Message(
298
469
  messageId=str(uuid.uuid4()),
299
470
  role=Role.agent,
300
471
  parts=[TextPart(text=error_message)],
472
+ metadata={
473
+ _get_adk_metadata_key("error_code"): str(event.error_code)
474
+ }
475
+ if event.error_code
476
+ else {},
301
477
  ),
302
- timestamp=datetime.datetime.now().isoformat(),
478
+ timestamp=datetime.now(timezone.utc).isoformat(),
303
479
  ),
480
+ final=False,
304
481
  )
305
482
 
306
483
 
307
- def _create_running_status_event(
308
- message: Message, invocation_context: InvocationContext, event: Event
484
+ def _create_status_update_event(
485
+ message: Message,
486
+ invocation_context: InvocationContext,
487
+ event: Event,
488
+ task_id: Optional[str] = None,
489
+ context_id: Optional[str] = None,
309
490
  ) -> TaskStatusUpdateEvent:
310
491
  """Creates a TaskStatusUpdateEvent for running scenarios.
311
492
 
@@ -313,32 +494,70 @@ def _create_running_status_event(
313
494
  message: The A2A message to include.
314
495
  invocation_context: The invocation context.
315
496
  event: The ADK event.
497
+ task_id: Optional task ID to use for generated events.
498
+ context_id: Optional Context ID to use for generated events.
499
+
316
500
 
317
501
  Returns:
318
502
  A TaskStatusUpdateEvent with RUNNING state.
319
503
  """
504
+ status = TaskStatus(
505
+ state=TaskState.working,
506
+ message=message,
507
+ timestamp=datetime.now(timezone.utc).isoformat(),
508
+ )
509
+
510
+ if any(
511
+ part.root.metadata.get(
512
+ _get_adk_metadata_key(A2A_DATA_PART_METADATA_TYPE_KEY)
513
+ )
514
+ == A2A_DATA_PART_METADATA_TYPE_FUNCTION_CALL
515
+ and part.root.metadata.get(
516
+ _get_adk_metadata_key(A2A_DATA_PART_METADATA_IS_LONG_RUNNING_KEY)
517
+ )
518
+ is True
519
+ and part.root.data.get("name") == REQUEST_EUC_FUNCTION_CALL_NAME
520
+ for part in message.parts
521
+ if part.root.metadata
522
+ ):
523
+ status.state = TaskState.auth_required
524
+ elif any(
525
+ part.root.metadata.get(
526
+ _get_adk_metadata_key(A2A_DATA_PART_METADATA_TYPE_KEY)
527
+ )
528
+ == A2A_DATA_PART_METADATA_TYPE_FUNCTION_CALL
529
+ and part.root.metadata.get(
530
+ _get_adk_metadata_key(A2A_DATA_PART_METADATA_IS_LONG_RUNNING_KEY)
531
+ )
532
+ is True
533
+ for part in message.parts
534
+ if part.root.metadata
535
+ ):
536
+ status.state = TaskState.input_required
537
+
320
538
  return TaskStatusUpdateEvent(
321
- taskId=str(uuid.uuid4()),
322
- contextId=invocation_context.session.id,
323
- final=False,
324
- status=TaskStatus(
325
- state=TaskState.working,
326
- message=message,
327
- timestamp=datetime.datetime.now().isoformat(),
328
- ),
539
+ taskId=task_id,
540
+ contextId=context_id,
541
+ status=status,
329
542
  metadata=_get_context_metadata(event, invocation_context),
543
+ final=False,
330
544
  )
331
545
 
332
546
 
333
- @working_in_progress
547
+ @experimental
334
548
  def convert_event_to_a2a_events(
335
- event: Event, invocation_context: InvocationContext
549
+ event: Event,
550
+ invocation_context: InvocationContext,
551
+ task_id: Optional[str] = None,
552
+ context_id: Optional[str] = None,
336
553
  ) -> List[A2AEvent]:
337
554
  """Converts a GenAI event to a list of A2A events.
338
555
 
339
556
  Args:
340
557
  event: The ADK event to convert.
341
558
  invocation_context: The invocation context.
559
+ task_id: Optional task ID to use for generated events.
560
+ context_id: Optional Context ID to use for generated events.
342
561
 
343
562
  Returns:
344
563
  A list of A2A events representing the converted ADK event.
@@ -358,20 +577,22 @@ def convert_event_to_a2a_events(
358
577
  if event.actions.artifact_delta:
359
578
  for filename, version in event.actions.artifact_delta.items():
360
579
  artifact_event = _convert_artifact_to_a2a_events(
361
- event, invocation_context, filename, version
580
+ event, invocation_context, filename, version, task_id, context_id
362
581
  )
363
582
  a2a_events.append(artifact_event)
364
583
 
365
584
  # Handle error scenarios
366
585
  if event.error_code:
367
- error_event = _create_error_status_event(event, invocation_context)
586
+ error_event = _create_error_status_event(
587
+ event, invocation_context, task_id, context_id
588
+ )
368
589
  a2a_events.append(error_event)
369
590
 
370
591
  # Handle regular message content
371
- message = convert_event_to_a2a_status_message(event, invocation_context)
592
+ message = convert_event_to_a2a_message(event, invocation_context)
372
593
  if message:
373
- running_event = _create_running_status_event(
374
- message, invocation_context, event
594
+ running_event = _create_status_update_event(
595
+ message, invocation_context, event, task_id, context_id
375
596
  )
376
597
  a2a_events.append(running_event)
377
598