Commit Graph

1142 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
Hangfei Lin 7148e0e82e test: Add tests for Runner initialization constraints
These tests verify that `ValueError` is raised when `Runner` is initialized without providing either an `app` instance or both `app_name` and `agent`.

PiperOrigin-RevId: 805427256
2025-09-10 10:48:33 -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
Xuan Yang 3b428ec81f chore: let adk-bot respond to discussion when it is tagged
PiperOrigin-RevId: 805406204
2025-09-10 10:02:23 -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
Google Team Member 3e6d91f9e2 docs: Update description of task_completed function in SequentialAgent
PiperOrigin-RevId: 805223251
2025-09-09 23:53:14 -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
Xiang (Sean) Zhou 43c96811da ci: Fix discussion answering github action workflow to escape the quote in the discussion content JSON
PiperOrigin-RevId: 805091905
2025-09-09 15:42:34 -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
Hangfei Lin 8174a29c6d chore: update contribution guide
PiperOrigin-RevId: 804985449
2025-09-09 11:09:40 -07:00
Google Team Member a645580aa6 ADK changes
PiperOrigin-RevId: 804937691
2025-09-09 09:11:08 -07:00
Xuan Yang 78eea1aa55 chore: skip PR triage for already triaged or Google-contributor PRs
The `agent-triage-pull-request` job will now only run if the pull request does not have the 'bot triaged' or 'google-contributor' labels, avoiding redundant and unnecessary triage actions.

PiperOrigin-RevId: 804732073
2025-09-08 22:20:19 -07:00
Google Team Member fa55354a1a feat: Update to ADK + A2A Remote Client to use A2A SDK ClientFactory
Use the A2A Python SDK for client support for A2A Remote clients. This enables A2A based agents that use gRPC or RESTful interfaces, as well as the jsonrpc support. This also simplifies creation of clients and provides simpler mechanisms to inject credentials and observability into the remote agent interactions.

PiperOrigin-RevId: 804711466
2025-09-08 21:03:27 -07:00
Google Team Member 64f11a6a67 chore: Avoid mutable default arguments in local_eval_service and runners
Changed default values for `session_service`, `artifact_service`, and `run_config` from instances of mutable classes to `None`. Instances are now created within the function body if the argument is not provided, preventing unexpected shared state across function calls.

PiperOrigin-RevId: 804624564
2025-09-08 16:11:24 -07:00
George Weale d56dd08072 fix: Enable saving input blobs as artifacts in ADK web server for issue #2176
The `run_config` for `run_agent` now includes `save_input_blobs_as_artifacts=True`.

PiperOrigin-RevId: 804589111
2025-09-08 14:30:03 -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
George Weale 43eec82f84 fix: Add a NOTE to agent transfer instructions listing available agents
The system instructions for agent transfer now include a NOTE section that lists all agents available for the `transfer_to_agent` function. This also has the target agents and, if there is one that applies, the parent agent. New unit tests are added to verify the correct generation of this NOTE.

PiperOrigin-RevId: 804569691
2025-09-08 13:43:38 -07:00
George Weale 5b465fd71b chore: Avoid mutable default arguments in local_eval_service and runners
Changed default values for `session_service`, `artifact_service`, and `run_config` from instances of mutable classes to `None`. Instances are now created within the function body if the argument is not provided, preventing unexpected shared state across function calls.

PiperOrigin-RevId: 804560641
2025-09-08 13:21:05 -07:00
George Weale ca5f7f1ff0 chore: Reorder dependencies in pyproject.toml
PiperOrigin-RevId: 804559734
2025-09-08 13:18:41 -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
Shangjie Chen e63fe0c0eb fix: Fix pagination of list_sessions in VertexAiSessionService
Resolves https://github.com/google/adk-python/issues/2860

PiperOrigin-RevId: 804511401
2025-09-08 11:14:32 -07:00
Max Ind bc6b5462a7 test: add functional telemetry tests
This includes:
- Test verifying multiple spans are written during E2E runner execution.
- Regression tests for the "ContextVar was created in a different Context" exceptions caused by the interplay of context based instrumentation and async generators getting indeterminately suspended.

PiperOrigin-RevId: 804333483
2025-09-08 02:23:10 -07:00
George Weale 1e23652968 fix: AttributeError and indentation in parameter processing. For issue #2776 and issue #2763
PiperOrigin-RevId: 804222317
2025-09-07 18:37:42 -07:00
Google Team Member 1979dcf496 fix: Allow AgentTool to inherit/use plugins from its invocation context when running
PiperOrigin-RevId: 803656189
2025-09-05 17:09:04 -07:00