Commit Graph

1402 Commits

Author SHA1 Message Date
Google Team Member a17f3b2e6d feat: Allow custom request and event converters in A2aAgentExecutor
This change introduces type aliases for request and event conversion functions:
- `A2ARequestToADKRunArgsConverter`: For converting A2A `RequestContext` to an `ADKRunArgs` Pydantic model.
- `AdkEventToA2AEventsConverter`: For converting ADK `Event` to a list of A2A `A2AEvent` objects.

The `convert_a2a_request_to_adk_run_args` function now returns a structured `ADKRunArgs` model instead of a generic dictionary, improving type safety.

These converter types can now be provided via the `A2aAgentExecutorConfig` to customize the conversion logic used by the `A2aAgentExecutor`. The executor defaults to the existing `convert_a2a_request_to_adk_run_args` and `convert_event_to_a2a_events` functions if no custom converters are specified.

This allows users to inject their own logic for handling request and event conversions, for example, to add custom metadata or transform data types, without modifying the core executor.

PiperOrigin-RevId: 819934960
2025-10-16 13:06:21 -07:00
Shangjie Chen 6ab1498aa0 fix: Add usage_metadata and citation_metadata to DatabaseSessionService
PiperOrigin-RevId: 819900773
2025-10-16 13:05:52 -07:00
Google Team Member 2424d6a3b1 feat: Reorder create_time and mime_type to ArtifactVersion
Before: http://sponge2/ba05f9ac-c13d-43b6-bb8a-3e1b029cc705(failed)
After: http://sponge2/a623ba76-62c1-4d17-b4b6-22044333a801
PiperOrigin-RevId: 819896989
2025-10-15 13:46:12 -07:00
Lin Nikaido 36c96ec5b3 fix: #2883 pickle data was truncated error in database session using MySql
Merge https://github.com/google/adk-python/pull/2884

closes: #2883
# Fix
When put leage data into event and load it. the _pickle.UnpicklingError was occurred.
The root caurse is `DynamicPickleType` mapping `BLOB` as default in case of MySql, not `LONGBLOB`. And learge data will be able to cut off tail of data. And raise pickle error.

# What todo
Defined `LONFBLOB` as default explicitly.

# Question
Where should we code the test code like this case? I cannot found the test code the DB and table was created expectedly.

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2884 from Lin-Nikaido:fix/#2883-mysql-datatype-fix 2be9b38fc3f5d5083b0b6715a2bf7b4eff5d947b
PiperOrigin-RevId: 819891727
2025-10-15 13:33:22 -07:00
Shangjie Chen a985cc38ec feat: Support return all sessions when user id is none
PiperOrigin-RevId: 819884236
2025-10-15 13:14:24 -07:00
machache b650181384 feat: add support for ContetxtWindowCompressionConfig in RunConfig
Merge https://github.com/google/adk-python/pull/2206

### Summary

This PR adds support for `ContextWindowCompressionConfig` in `RunConfig`.
This enables context window compression using a `trigger_tokens` threshold and a sliding window with a `target_tokens` limit.

This feature is useful for managing long-running audio inputs.

### Related Issue

Closes #2188

### Testing Plan

- Added new unit test: `test_streaming_with_context_window_compression_config`

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/2206 from ac-machache:support/add-context-compression-config c8a5b15cae2d2b72f331797d07ae0bbaf977ed3c
PiperOrigin-RevId: 819855786
2025-10-15 12:00:21 -07:00
Kathy Wu 78e74b5bf2 feat: Add require_confirmation param for MCP tool/toolset
This allows users to require human approval for using MCP tools.

PiperOrigin-RevId: 819800747
2025-10-15 09:58:31 -07:00
Ankur Sharma d82c492140 chore: Remove deprecated convert_session_to_eval_format function
This change removes the `convert_session_to_eval_format` function and its associated unit tests. New tests for `create_gcs_eval_managers_from_uri` are also added.

PiperOrigin-RevId: 819576620
2025-10-14 22:37:49 -07:00
Xuan Yang 05aa3fa38b fix: Remove the PR triaging agent's dependence on "bot triaged" label
PiperOrigin-RevId: 819427872
2025-10-14 15:35:59 -07:00
Google Team Member f9c09ef075 feat: Support returning all sessions when user_id is none in the request
resolves https://github.com/google/adk-python/issues/3154

PiperOrigin-RevId: 819417330
2025-10-14 15:10:41 -07:00
Shangjie Chen 141318f775 feat: Support returning all sessions when user_id is none in the request
resolves https://github.com/google/adk-python/issues/3154

PiperOrigin-RevId: 819401023
2025-10-14 14:30:47 -07:00
Google Team Member 85c95a8cbf feat: Add create_time and mime_type to ArtifactVersion
PiperOrigin-RevId: 819396924
2025-10-14 14:21:02 -07:00
Hangfei Lin cb6d583cad chore: Add RSVP link to ADK Community Call
This change adds a link to a Qualtrics form for RSVPing to the ADK Community Call in the README.

PiperOrigin-RevId: 819376219
2025-10-14 13:36:33 -07:00
Shangjie Chen 2c7a342593 feat: Add create_time and mime_type to ArtifactVersion
PiperOrigin-RevId: 819372593
2025-10-14 13:29:24 -07:00
Joseph Pagadora 9fbed0b15a fix: Overall eval status should be NOT_EVALUATED if no invocations were evaluated
PiperOrigin-RevId: 819322513
2025-10-14 11:36:33 -07:00
Xuan Yang bae21027d9 chore: Disable the scheduled execution for issue triage workflow
PiperOrigin-RevId: 819312327
2025-10-14 11:15:12 -07:00
George Weale 89344da813 chore: Update agent builder instructions and remove run command details
PiperOrigin-RevId: 819299339
2025-10-14 10:46:53 -07:00
Xiang (Sean) Zhou d22b8bf890 chore: Clarify how to use adk built-in tool in instruction
PiperOrigin-RevId: 818987709
2025-10-13 21:43:37 -07:00
George Weale dfb8638eae chore: fix the cleanup_unused_files tool in yaml agent to use the same directory as other tools
PiperOrigin-RevId: 818846060
2025-10-13 15:01:36 -07:00
George Weale 3c0b99a19e fix: rollback of add structured JSON logging with Cloud Trace correlation Close #1683
PiperOrigin-RevId: 818844025
2025-10-13 14:57:23 -07:00
George Weale d8548aabd2 feat: add structured JSON logging with Cloud Trace correlation Close #1683
- add a shared --structured_logs flag to adk web and adk api_server so users can opt into JSON-formatted output
- introduce CloudTraceJSONFormatter that emits structured entries and attaches current Cloud Trace/Span IDs when an OpenTelemetry context is active
- update CLI logging setup to clear duplicate stdout handlers when Cloud Logging is enabled and to reconfigure existing handlers (like from Uvicorn) so they also pick up the structured format and requested log level

With the flag disabled the CLIs keep their existing text logs; when enabled, the services now produce Cloud Logging–friendly JSON that can be correlated with distributed traces.

PiperOrigin-RevId: 818823818
2025-10-13 14:08:45 -07:00
Google Team Member df05ed6b3b feat: migrate invocation_context to callback_context
Update plugin manager and built-in plugins to prioritize CallbackContext. Keep InvocationContext access for legacy plugins with adapter. Change callback docs/tests to cover the new context.

PiperOrigin-RevId: 818822267
2025-10-13 14:05:44 -07:00
Google Team Member 2158b3c915 fix: correctly populate context_id in remote_a2a_agent library when constructing a2a request
PiperOrigin-RevId: 818813897
2025-10-13 13:45:54 -07:00
George Weale e2072af69f feat: migrate invocation_context to callback_context
Update plugin manager and built-in plugins to prioritize CallbackContext. Keep InvocationContext access for legacy plugins with adapter. Change callback docs/tests to cover the new context.

PiperOrigin-RevId: 818798087
2025-10-13 13:09:15 -07:00
Xiang (Sean) Zhou fa84bcb575 chore: Correct the callback signatures
PiperOrigin-RevId: 818781277
2025-10-13 12:30:37 -07:00