Commit Graph

429 Commits

Author SHA1 Message Date
Shangjie Chen 1ee01cc05a feat: Implement checkpoint and resume logic for SequentialAgent
PiperOrigin-RevId: 811977004
2025-09-26 15:26:42 -07:00
Xinran (Sherry) Tang 28d44a365a test: Make testing_utils.InMemoryRunner support ADK App and add utils for extracting event contents for testing resumability
PiperOrigin-RevId: 811933527
2025-09-26 13:22:11 -07:00
Shangjie Chen 2c752934a8 feat: Skip running a workflow agent if it has no sub-agents
PiperOrigin-RevId: 811528166
2025-09-25 15:39:38 -07:00
Xinran (Sherry) Tang b2b80e7fa0 feat: Pause invocations on long running function calls for resumable apps
PiperOrigin-RevId: 811518771
2025-09-25 15:11:11 -07:00
Shangjie Chen 8b081751ed feat: Add core checkpointing primitive for base agent
PiperOrigin-RevId: 811458903
2025-09-25 12:35:36 -07:00
Max Ind e7528aebd4 feat(otel): adjust telemetry to follow OTLP 1.37 GenAI semconv
Changes include:
- Implementing missing attributes. e.g. 'gen_ai.agent.name'
- Specifying reasons for not filling out some conditionally required attributes. e.g. 'gen_ai.data_source.id'
- Specifying reasons for not including certain attributes which are specified in current semconv. e.g. inference attributes on agent spans

PiperOrigin-RevId: 811379706
2025-09-25 09:25:15 -07:00
Xinran (Sherry) Tang cbb6e4945a feat: Add a app level config for resumable applications
PiperOrigin-RevId: 811272046
2025-09-25 03:14:34 -07:00
Google Team Member c8c6cd70a4 feat: Introduce ExtendedOAuth2 scheme that auto-populates auth/token URLs
Use auto-discovered auth_endpoint and token_endpoint in CredentialManager.

PiperOrigin-RevId: 811183929
2025-09-24 22:21:07 -07:00
Ankur Sharma d48679582d feat: Populate AppDetails to each Invocation
AppDetails require two pieces of information:
1) Instructions
2) Tools

Both these pieces of information are gathered using the llm_request that was passed to the model. This approach, slightly invasive, ensures that we capture the "exact" instructions and tools that were given to the model.

PiperOrigin-RevId: 811180648
2025-09-24 22:06:56 -07:00
Google Team Member 2a2da0fe03 feat: Introduce OAuth2DiscoveryManager to fetch metadata needed for OAuth
This is the first step to bring ADK to compliance with MCP Authorization Spec.

PiperOrigin-RevId: 811177152
2025-09-24 21:53:48 -07:00
Ankur Sharma 5a485b01cd feat: Adds Rubric based final response evaluator
The evaluator uses a set of rubrics to assess the quality of the agent's final response.

PiperOrigin-RevId: 811154498
2025-09-24 20:30:51 -07:00
Ankur Sharma 01923a9227 feat: Data model for storing App Details and data model for steps
Details:
1. Data model for storing App Details (the agentic system)
As we move towards LLM as Judge metrics, we see that some of these metrics need information about the Agentic system that was used for inferencing. We add a data model to capture that.

2. Data model for Steps
We refine the concept of intermediate data. Previously it stored data in the form of a multiple lists, thereby losing out on the chronological information. This information is needed for some of the metrics. So we refine the concept of intermediate data as series of logical steps that an Agent Take.

PiperOrigin-RevId: 811122784
2025-09-24 18:41:38 -07:00
Xuan Yang 6db096a3f4 chore: remove unsupported 'type': 'unknown' in test_common.py for fastapi 0.117.1
PiperOrigin-RevId: 810673476
2025-09-23 19:44:49 -07:00
Xiang (Sean) Zhou ae5592e242 chore: Add tests for instruction provider and merge test_static_instructions.py to test_intructions.py
PiperOrigin-RevId: 810610507
2025-09-23 15:47:46 -07:00
Xiang (Sean) Zhou 61213ce4d4 feat: Support non-text content in static instruction
move them to user contents and reference them from instruction

PiperOrigin-RevId: 810587466
2025-09-23 15:36:15 -07:00
George Weale 657369cffe fix: Adds plugin to save artifacts for issue #2176
PiperOrigin-RevId: 810522939
2025-09-23 15:35:48 -07:00
shsha4 86dea5b53a fix(mcp): Initialize tool_name_prefix in MCPToolse
Merge https://github.com/google/adk-python/pull/2823

Description
  This change introduces a tool_name_prefix attribute to McpToolset and McpToolsetConfig. This allows for adding a prefix to the
  names of all tools within the toolset, which can help avoid naming collisions and provide better organization.

  The implementation involves updating the McpToolset's __init__ and from_config methods to handle the new tool_name_prefix and
  adding the corresponding field to McpToolsetConfig.

  Testing Plan
  A new unit test file has been added to ensure the functionality works as expected.

   - `tests/unittests/tools/test_mcp_toolset.py`:
     - The test_mcp_toolset_with_prefix test case verifies that the tool_name_prefix is correctly applied to the tool names
       retrieved from the toolset.
     - All tests were run via pytest and passed.

  Related Issue
   - Closes #2814

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2823 from shsha4:fix/issue-2814 e8e5b0d6d5f406d3875faf2229a96701725b7a5e
PiperOrigin-RevId: 810500616
2025-09-23 15:35:12 -07:00
Xiang (Sean) Zhou 9be9cc2fee feat: Support static instructions
Static instructions:
Always added to system instructions for context caching

Dynamic instructions:
Added to system instructions when no static instruction exists (for backward compatibility), OR inserted before last batch of continuous user content when static instructions exist

PiperOrigin-RevId: 809170679
2025-09-19 13:46:36 -07:00
Xiang (Sean) Zhou c66245a3b8 feat: support context caching
1. add a context cache config in app level which will apply to all agents in the app
2. pass on cache config through invocation context to llm_reqeust
3. store cache metadata in llm_response
4. lookup old cache metadata from latest event for reusing old cache
5. create new cache if old cache cannot be reused

PiperOrigin-RevId: 809158578
2025-09-19 13:17:02 -07:00
Xinran (Sherry) Tang 13a95c463d feat: Add get_events util function in invocation_context
PiperOrigin-RevId: 809111315
2025-09-19 11:21:35 -07:00
Kacper Jawoszek f157b2ee4c feat(otel): support standard OTel env variables for exporter endpoints
ADK web server will automatically setup OTel providers with exporters if any of the .*_ENDPOINT variables from https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/ is set.

PiperOrigin-RevId: 809079453
2025-09-19 09:59:58 -07:00
Wei Sun (Jack) 006a406f5b chore: Allow outputting non-acsii without escape and excludes fields in the dumped yaml files in the yaml_utils.py
Also excludes `_adk_recordings_config` for `adk conformance create` command.

PiperOrigin-RevId: 808865049
2025-09-18 21:24:14 -07:00
guillaume blaquiere 25958242db feat: add endpoint to generate memory from session
Merge https://github.com/google/adk-python/pull/2900

In relation with #2416

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2900 from guillaumeblaquiere:add-session-to-memory 0507de43021c62f9223167dca8f53b536227ad04
PiperOrigin-RevId: 808658162
2025-09-18 11:13:21 -07:00
Xuan Yang 8a92fd18b6 fix: ignore empty function chunk in LiteLlm streaming response
Fixes https://github.com/google/adk-python/issues/1532

PiperOrigin-RevId: 808636127
2025-09-18 10:18:53 -07:00
Afonso Menegola c9ea80af28 fix: Prevent escaping of Latin characters in LLM response
Merge https://github.com/google/adk-python/pull/2937

**Closes #2936**

This Pull Request addresses the issue where `LlmAgent` outputs, when configured with `output_schema` and `tools`, were presenting escaped Latin characters (e.g., `\xf3` for `ó`) in the final response. This behavior occurred because `json.dumps` was being called with `ensure_ascii=True` (its default), which is not ideal for human-readable output, especially when dealing with non-ASCII characters common in many languages like Portuguese.

**Changes Proposed:**

* Modified the `_OutputSchemaRequestProcessor` in `src/google/adk/flows/llm_flows/_output_schema_processor.py` to explicitly set `ensure_ascii=False` when calling `json.dumps` for the `set_model_response` tool's output.

**Impact:**

This change ensures that all non-ASCII characters in the structured model response are preserved in their natural form, improving the readability and user experience of agent outputs, particularly for users interacting in languages with accented characters or other special symbols.

**Testing:**

The fix was verified locally by running an `LlmAgent` with an `output_schema` and confirming that responses containing Latin characters (e.g., "ação", "caminhão", "ícone") are now correctly displayed without escaping.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2937 from amenegola:fix/issue-2936-escape-chars 6cac00f97aa4cd8d8ccaa97ec5fffc74f57995dc
PiperOrigin-RevId: 808622892
2025-09-18 09:48:03 -07:00