Commit Graph

165 Commits

Author SHA1 Message Date
Xuan Yang 957dc628ab chore: set up Github workflow for ADK release analyzer for doc updates
PiperOrigin-RevId: 805434018
2025-09-10 11:02:59 -07:00
Google Team Member 0935a40011 feat: Add Bigquery Forecast tool
This tool answers questions about structured data in BigQuery using natural language.

PiperOrigin-RevId: 805414952
2025-09-10 10:20:47 -07:00
GenkiNoguchi 5cda37adb3 chore: fix typos in multiple files
Merge https://github.com/google/adk-python/pull/2864

**Reason for this change:**

  Multiple typos were found in comments, docstrings, and code throughout the codebase, which could lead to confusion and reduce code readability.

  **Changes made:**

  Fixed the following typos across 8 files:

  1. contributing/samples/adk_answering_agent/utils.py:130: "extention" → "extension"
  2. llms-full.txt:15171: "fuction" → "function"
  3. src/google/adk/a2a/converters/part_converter.py:
    - Line 96: "Conver" → "Convert", "reponse" → "response"
    - Line 99: "suervice" → "service"
    - Line 100: "accordinlgy" → "accordingly"
    - Line 191: "Conver" → "Convert", "reponse" → "response"
    - Line 195: "accordinlgy" → "accordingly"
  4. src/google/adk/agents/base_agent.py:568: "custome" → "custom"
  5. src/google/adk/evaluation/agent_evaluator.py:572: "Retruns" → "Returns"
  6. src/google/adk/flows/llm_flows/basic.py:55: "outoput_schema" → "output_schema"
  7. src/google/adk/flows/llm_flows/contents.py:136: "fuction_response" → "function_response"
  8. src/google/adk/models/google_llm.py:138: "gemini_llm_connecton.py" → "gemini_llm_connection.py"

  **Impact:**

  This change will:
  - Improve code documentation clarity and professionalism
  - Make comments, docstrings, and code more readable and accurate
  - Help prevent confusion for developers reading the code
  - Ensure consistency in terminology throughout the codebase

  This is a non-breaking change that only affects comments, documentation strings, and improves code clarity.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2864 from ammmr:chore-fix-typos 3cea9fcf6f21edb006b63e9258d2b82930dd961d
PiperOrigin-RevId: 805227784
2025-09-10 00:08:15 -07:00
Xuan Yang 8132d3b621 chore: add instructions for the ADK release analyzer agent to sort the recommended changes and recommend API reference changes
PiperOrigin-RevId: 805099909
2025-09-09 16:07:28 -07:00
Xuan Yang e3422c616d chore: create an initial ADK release analyzer agent to find the doc updates needed between releases
PiperOrigin-RevId: 805030050
2025-09-09 13:00:05 -07:00
Shangjie Chen 8452d2bcba feat: Allow function tool to pass in a callable to decide whether it need confirmation
PiperOrigin-RevId: 804583437
2025-09-08 14:16:59 -07:00
Yujun Zou 467df1a36f docs: Update root_agent description for clarity
Update description as: Coordinator agent to greet users.

PiperOrigin-RevId: 804553925
2025-09-08 13:01:47 -07:00
Google Team Member 72ff9c64a2 feat: Add GkeCodeExecutor for sandboxed code execution on GKE #non-breaking
Merge https://github.com/google/adk-python/pull/1629

close https://github.com/google/adk-python/issues/2170

### Summary

This PR introduces `GkeCodeExecutor`, a new code executor that provides a secure and scalable method for running LLM-generated code by leveraging GKE Sandbox. It serves as a robust alternative to local or standard containerized executors by leveraging the **GKE Sandbox** environment, which uses gVisor for workload isolation.

For each code execution request, it dynamically creates an ephemeral Kubernetes Job with a hardened Pod configuration, offering significant security benefits and ensuring that each code execution runs in a clean, isolated environment.

### Key Features of GkeCodeExecutor

* **Dynamic Job Creation**: Uses the Kubernetes `batch/v1` API to create a new Job for each code snippet.
* **Secure Code Mounting**: Injects code into the Pod via a temporary `ConfigMap`, which is mounted to a read-only file.
* **gVisor Sandboxing**: Enforces execution within a `gvisor` runtime for kernel-level isolation.
* **Hardened Security Context**: Pods run as non-root with all Linux capabilities dropped and a read-only root filesystem.
* **Resource Management**: Applies configurable CPU and memory limits to prevent abuse.
* **Automatic Cleanup**: Uses the `ttl_seconds_after_finished` feature on Jobs for robust, automatic garbage collection of completed Pods and Jobs.
* **Node Scheduling**: The executor uses Kubernetes `tolerations` in its Pod specification. This allows the k8s scheduler to place the execution Pod onto a **_pre-configured_** gVisor-enabled node.
* **Module Integration**: The `GkeCodeExecutor` is registered in the `code_executors/__init__.py`, making it available for use by agents. The `ImportError` handling is configured to check for the required `kubernetes` SDK.

### Execution Flow:

1.  Agent invokes `GkeCodeExecutor` with the LLM-generated code.
2.  The `GkeCodeExecutor` will `execute_code` – creates a temporary `ConfigMap`, and then create a k8s `Job` to run it.
3.  This Job runs a standard `python:3.11-slim` container. The image is pulled once to the node and cached. The Job will mount the ConfigMap as `/app/code.py`
4.  The GkeCodeExecutor will monitor the Job to completion, fetch `stdout/stderr` logs from the container, return `CodeExecutionResult` to the LlmAgent, and ensure all temp resources are deleted.
5.  The calling agent formats the result and provides a final response to the user. If the result contains error, it will retry up to `error_retry_attempts` times.

PiperOrigin-RevId: 804511467
2025-09-08 11:15:29 -07:00
Xiang (Sean) Zhou 25df6c22d5 chore: Tune instructions to not ask root directory if it's already provided in the context
PiperOrigin-RevId: 803512675
2025-09-05 10:23:34 -07:00
Hangfei Lin 4df79dd5c9 feat: Upgrade ADK stack to use App instead in addition to root_agent
The convention:
- If some fields(like plugin) are defined both at root_agent and app, then a error will be raised.
- app code should be located within agent.py.
- an instance named app should be created

PiperOrigin-RevId: 803155804
2025-09-04 13:38:00 -07:00
Xiang (Sean) Zhou 66cc98801a chore: Adjust the instruction of agent builder assistant for how to use google_search tool and url_context tool
PiperOrigin-RevId: 802629718
2025-09-03 11:14:45 -07:00
Xiang (Sean) Zhou a503a0c807 ci: Load discussion data from event content to avoid additional GraphQL API call
PiperOrigin-RevId: 802308383
2025-09-02 15:22:17 -07:00
Xiang (Sean) Zhou 408d3dfeb1 chore: refactor discussion answering agent to merge answer_discussions.py into main.py
mainly to dedup duplicated functionality in both file.

PiperOrigin-RevId: 802291102
2025-09-02 14:25:32 -07:00
Google Team Member 831e2e6d4d ADK changes
PiperOrigin-RevId: 801284664
2025-08-30 11:08:43 -07:00
Hangfei Lin dff733c6fc feat: Upgrade ADK stack to use App instead in addition to root_agent
The convention:
- If some fields(like plugin) are defined both at root_agent and app, then a error will be raised.
- app code should be located within agent.py.
- an instance named app should be created

PiperOrigin-RevId: 801252329
2025-08-30 08:01:53 -07:00
Google Team Member 214f2884f5 feat: Upgrade ADK stack to use App instead in addition to root_agent
The convention:
- If some fields(like plugin) are defined both at root_agent and app, then a error will be raised.
- app code should be located within agent.py.
- an instance named app should be created

PiperOrigin-RevId: 801103084
2025-08-29 18:49:04 -07:00
Hangfei Lin a2e89a22a5 feat: Upgrade ADK stack to use App instead in addition to root_agent
The convention:
- If some fields(like plugin) are defined both at root_agent and app, then a error will be raised.
- app code should be located within agent.py.
- an instance named app should be created

PiperOrigin-RevId: 801084463
2025-08-29 17:33:38 -07:00
Shangjie Chen a17bcbb2aa feat: Add a tool confirmation flow that can guard tool execution with explicit confirmation and custom input
The existing `LongRunningTool` does not define a programmatic way to provide & validate structured input, also it relies on LLM to reason and parse the user's response.

For a quick start, annotate the function with `FunctionTool(my_function, require_confirmation=True)`. A more advanced flow is shown in the `human_tool_confirmation` sample.

The new flow is similar to the existing Auth flow:
- User request a tool confirmation by calling `tool_context.request_confirmation()` in the tool or `before_tool_callback`, or just using the `require_confirmation` shortcut in FunctionTool.
- User can provide custom validation logic before tool call proceeds.
- ADK creates corresponding RequestConfirmation FunctionCall Event to ask user for confirmation
- User needs to provide the expected tool confirmation to a RequestConfirmation FunctionResponse Event.
- ADK then checks the response and continues the tool call.

PiperOrigin-RevId: 801019917
2025-08-29 13:56:54 -07:00
Xiang (Sean) Zhou 3ed9097983 chore: Add initial version of agent builder assistant that assists user to build config based agent
PiperOrigin-RevId: 801014241
2025-08-29 13:42:31 -07:00
Google Team Member fcd748e17f chore: add contributing Spanner tools RAG agent sample
PiperOrigin-RevId: 800938492
2025-08-29 10:00:43 -07:00
Google Team Member 11a2ffe35a feat: allow setting agent/application name for BigQuery tools
This will allow tracking of tool usage per agent/application.

PiperOrigin-RevId: 800607186
2025-08-28 14:10:01 -07:00
Xiang (Sean) Zhou 8d6f138fbe chore: Update oauth calendar sample agent to test the case when a subsequent tool call happends right after a tool call that requires auth
context: this is for reproducing https://github.com/google/adk-python/issues/1944 and verify corresponding fix
PiperOrigin-RevId: 800561025
2025-08-28 12:10:43 -07:00
Google Team Member 47b88d2b06 feat: Add the ask_data_insights tool for natural language queries on BigQuery data
PiperOrigin-RevId: 799267061
2025-08-25 14:23:10 -07:00
Wei Sun (Jack) a360bc2542 docs: Clean up docs in sample
PiperOrigin-RevId: 798284758
2025-08-22 11:36:58 -07:00
Wei Sun (Jack) 2c088acc9b docs: Fixes root_agent.yaml in tool_mcp_stdio_notion_config for Agent Config sample and add README.md
PiperOrigin-RevId: 798241478
2025-08-22 09:40:31 -07:00