1003 Commits

Author SHA1 Message Date
Google Team Member c8059428a2 chore: add contributing spanner sample
PiperOrigin-RevId: 795154839
v1.11.0
2025-08-14 12:41:28 -07:00
Xuan Yang e63e2a7106 fix: add the missing required tool parameters for Anthropic models
Fixes #1692

PiperOrigin-RevId: 795125801
2025-08-14 11:31:00 -07:00
Wei Sun (Jack) 9ba8eec220 feat(tracing): Adds more OpenTelemetry convention attributes: gen_ai.request.max_tokens, gen_ai.request.top_p and gen_ai.response.finish_reasons
Fixes #1234

PiperOrigin-RevId: 795082815
2025-08-14 09:52:50 -07:00
Kacper Jawoszek 9cfe43334a fix: Uncomment OTel tracing in base_llm_flow.py
It was mistakenly commented out in the previous change.

PiperOrigin-RevId: 795048873
2025-08-14 08:20:07 -07:00
Xiang (Sean) Zhou 52284b1bae fix: A2A RPC URL got overriden by host and port param of adk api server
PiperOrigin-RevId: 794708721
2025-08-13 13:20:26 -07:00
George Weale a74d3344bc chore: Added upper version bounds to dependencies in "pyproject.toml"
This change keeps dependencies to their major versions, but for the pre 1.0.0 releases pinned to minor releases as they could have breaking changes.

PyYAML: Version 7.0 is in development and could have breaking changes

absolufy-imports: The package is archived and no longer maintained.

anyio: Follows SemVer, so version 5.0 could have breaking changes.

authlib: Follows a SemVer-like pattern, so version 2.0 could have breaking changes.

click: A mature library, version 9.0 is the expected boundary for breaking changes.

fastapi: As a pre-1.0 library, the next minor release could have breaking changes.

google-api-python-client: Although in maintenance, version 3.0 could still have breaking changes.

google-cloud-aiplatform: Follows SemVer, so breaking changes are expected in version 2.0.

google-cloud-secret-manager: A stable Google library, version 3.0 could lead to breaking changes.

google-cloud-speech: A stable Google library, version 3.0 could lead to breaking changes.

google-cloud-storage: A stable Google library.

google-genai: As an official Google SDK, version 2.0 is the expected boundary for breaking changes.

graphviz: As a pre-1.0 library, the next minor release could have breaking changes.

mcp: As an SDK, version 2.0 is the boundary for potential breaking changes.

opentelemetry-api: Follows SemVer; version 2.0 could have breaking changes.

opentelemetry-exporter-gcp-trace: It's tied to the v1 OpenTelemetry API, so version 2.0 would likely be a breaking change.

opentelemetry-sdk: It's coupled to the v1 API, so version 2.0 would likely be a breaking change.

pydantic: This stops upgrades to the incompatible version 3.0 after its major 2.0 rewrite.

python-dateutil: Follows to SemVer, making version 3.0 the boundary for potential breaking changes.

python-dotenv: Locks to stable version 1.0 major release.

requests: As a more mature library, version 3.0 is boundary for breaking changes.

sqlalchemy: This locks the dependency to the stable version 2.0 API after its major rewrite.

starlette: As a pre-1.0 library, the next minor release could have breaking changes.

tenacity: This is a mature library, version 9.0 is boundary for breaking changes.

typing-extensions: Major versions are tied to large typing changes in Python itself.

tzlocal: The library has a history of introducing breaking API changes between major versions.

uvicorn: As a pre-1.0 library, the next minor release could have breaking changes.

watchdog: As a stable library, version 7.0 could have breaking changes.

websockets: Follows SemVer, so version 16.0 is the boundary for breaking changes.
PiperOrigin-RevId: 794677571
2025-08-13 12:03:47 -07:00
George Weale ddf2e2194b chore: Update python-version in .github/workflows/python-unit-tests.yml to ["3.9", "3.10", "3.11", "3.12", "3.13"]
Verified with uv on Python 3.12 and 3.13 using the same ignores as CI.
3.12:
uv python install 3.12 && uv venv --python 3.12 .venv && source .venv/bin/activate
uv sync --extra test --extra eval --extra a2a
python -m pytest tests/unittests --ignore=tests/unittests/artifacts/test_artifact_service.py --ignore=tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py
3.13: repeated the above with 3.13 (separate env)
Result: All unit tests passed

PiperOrigin-RevId: 794669437
2025-08-13 11:43:24 -07:00
Kacper Jawoszek a30c63c593 fix: aclose all async generators to fix OTel tracing context
See https://github.com/google/adk-python/issues/1670#issuecomment-3115891100

PiperOrigin-RevId: 794659547
2025-08-13 11:18:26 -07:00
Wei Sun (Jack) c5af44cfc0 docs(config): Fixes tool_functions, which is a config-based sample for using tools
PiperOrigin-RevId: 794652291
2025-08-13 11:01:52 -07:00
Google Team Member c52f956433 chore: Update comment to reference "Streamable HTTP Client"
Corrects a typo in the `StreamableHTTPConnectionParams` docstring, changing "SSE" to "Streamable HTTP" to accurately reflect the referenced client.

PiperOrigin-RevId: 794424727
2025-08-12 23:45:23 -07:00
Xuan Yang 585141e0b7 fix: Use PreciseTimestamp for create and update time in database session service to improve precision
PiperOrigin-RevId: 794422113
2025-08-12 23:36:53 -07:00
Google Team Member 114db93d70 ADK changes
PiperOrigin-RevId: 794403729
2025-08-12 22:29:23 -07:00
Hangfei Lin e2518dc371 fix: Ignore AsyncGenerator return types in function declarations
For Vertex model backend, we send response back. This doesn't work for streaming tools that the return type is AsyncGenerator. So the fix here is to ignore the return type when it's AsyncGenerator.

We can't distinguish streaming vs non-streaming tool with AsyncGenerator though as LiveRequestQueue is optional in streaming tool.

Adds an `ignore_response` option to `build_function_declaration` to skip including the return type in the function declaration. This is enabled for tools that return `AsyncGenerator`, as the model does not yet support understanding these return types, while streaming tools can still handle them. Also, removes redundant return statements in `_get_mandatory_params`.

PiperOrigin-RevId: 794392846
2025-08-12 21:45:52 -07:00
Xiang (Sean) Zhou 8c65967cdc fix: Make all subclass of BaseToolset to call parent constructor
So that all member field are created / initialized in the base toolset.

PiperOrigin-RevId: 794388671
2025-08-12 21:32:24 -07:00
Xiang (Sean) Zhou ebd726f1f5 feat: Support adding prefix to tool names returned by toolset
This is to address the name conflict issue of tools returned by different toolset. Mainly it's to give each toolset a namespace.

We have a flag `add_tool_name_prefix` to decide whether to apply this behavior
We have a `tool_name_prefix` to let client specify a custom prefix, if not set , toolset name will be used as prefix.

PiperOrigin-RevId: 794306796
2025-08-12 16:17:53 -07:00
Goldy 54680edf3c fix: path parameter extraction for complex Google API endpoints
Merge https://github.com/google/adk-python/pull/1815

fix: path parameter extraction for complex Google API endpoints

- Fix GoogleApiToOpenApiConverter to handle path parameters in complex endpoints like /v1/documents/{documentId}:batchUpdate
- Use Google Discovery Document 'location' field
- Add comprehensive test suite for Google Docs batchUpdate functionality
- Verify parameter location handling for complex endpoint patterns
- Test schema validation for BatchUpdateDocumentRequest/Response

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/1815 from goldylocks87:fix-issue-1814-path-parameter-extraction af5508ec6975b1ccbc34931a0041e422ee259c16
PiperOrigin-RevId: 794301898
2025-08-12 16:02:45 -07:00
Shangjie Chen bb3735c9ca chore: Remove logging that contains full event data from DatabaseSessionService
Resolves https://github.com/google/adk-python/issues/2153

PiperOrigin-RevId: 794288546
2025-08-12 15:19:52 -07:00
Xuan Yang a09a5e67aa chore: add the missing env variables in discussion_answering.yml
PiperOrigin-RevId: 794285985
2025-08-12 15:12:03 -07:00
Google Team Member 7e0880869b feat: Expose print_detailed_results param to AgentEvaluator.evaluate
Currently `print_detailed_results` is available only in `AgentEvaluator.evaluate_eval_set` while the adk-samples data science agent uses `AgentEvaluator.evaluate` https://github.com/google/adk-samples/blob/c230c3ddc16a3f9fc7edff409b567bdd65ebd9da/python/agents/data-science/eval/test_eval.py#L32.

PiperOrigin-RevId: 794262781
2025-08-12 14:07:17 -07:00
Google Team Member 1fc8d20ae8 feat: add Spanner first-party toolset (breaking change to BigQueryTool, consolidating into generic GoogleTool)
Spanner toolset support basic operations to interact with Spanner table metadata and query results.

Consolidate BigQueryTool into generic GoogleTool, so that BigQueryToolset and SpannerToolset can share.

PiperOrigin-RevId: 794259782
2025-08-12 13:59:37 -07:00
Google Team Member 10e3dfab1a feat: remove load_dotenv() in feature_decorator.py
PiperOrigin-RevId: 794249376
2025-08-12 13:35:49 -07:00
Xuan Yang 5fba1963c3 chore: add Gemini API docs as a new datastore for the ADK Answering Agent
PiperOrigin-RevId: 794247007
2025-08-12 13:30:00 -07:00
Xuan Yang 7d2cb654f0 chore: add the missing license header for some sample agents' files
PiperOrigin-RevId: 794165986
2025-08-12 10:24:36 -07:00
Xiang (Sean) Zhou 88f759a941 fix: docstring concatenation in 3.13
The issue was caused by a breaking change in Python 3.13's inspect.cleandoc() function that made it more conservative about whitespace handling:

Root Cause:

- Python 3.12-: inspect.cleandoc() used line.lstrip() - strips all whitespace (spaces, tabs, etc.)
- Python 3.13+: inspect.cleandoc() uses line.lstrip(' ') - strips only space characters

PiperOrigin-RevId: 793921360
2025-08-11 21:26:25 -07:00
Wei Sun (Jack) e295feb4c6 docs: Add workflow_triage sample for multi-agent request orchestration
Demonstrates intelligent triage system with root planning agent and parallel
execution agents.

Use session state to store the execution plan and coordinate with other specialized agents.

Check out README.md for more details.

PiperOrigin-RevId: 793884758
2025-08-11 19:05:53 -07:00