7 Commits

Author SHA1 Message Date
Soumili Nandi c6bba8dcc8 feat: add nvidia nim integration sample
Merge https://github.com/google/adk-python/pull/3433

Adds a sample demonstrating how to integrate NVIDIA NIM models with ADK using LiteLLM.

PiperOrigin-RevId: 966677064
2026-08-18 10:37:41 -07:00
George Weale ee3a3815a1 fix: repair two broken contributing samples
jira_agent passed tool_name to ApplicationIntegrationToolset, which only
accepts tool_name_prefix. hello_world_litellm_add_function_to_prompt
failed at import because langchain-core 1.x no longer auto-imports
langchain_core.tools, which convert_to_openai_function relies on.

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 945809141
2026-07-10 11:27:07 -07:00
Haran Rajkumar 9d0a5a8615 test(samples): add replay tests for the interactions_api sample
Add replay test fixtures covering the documented flows of the
contributing/samples/models/interactions_api sample (basic text, Google
Search grounding, multi-turn stateful recall, and a custom function
tool), so the sample is exercised by tests/unittests/test_samples.py.

Also fix the shared sample test harness (cli/agent_test_runner.py) to
support the Interactions API:

- Exclude the volatile interaction_id (a server-issued token) and
  turn_complete fields from fixture comparison and from rebuilt
  fixtures, matching how other non-reproducible fields (timestamps,
  usage metadata, etc.) are already handled. The Interactions API
  stamps these onto every model response and the replay MockModel
  cannot reproduce them.
- Drive all turns of a fixture rebuild on a single persistent event
  loop. The sync Runner.run() uses asyncio.run() per call, which closes
  the loop the model's cached async api_client is bound to, so
  subsequent turns fail with "Event loop is closed" and corrupt
  multi-turn fixtures. Reusing one loop keeps the cached client valid
  across the conversation.

Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 940691339
2026-06-30 15:31:21 -07:00
Haran Rajkumar 4100a24021 chore: replace vertexai with enterprise in samples and docs
Co-authored-by: Haran Rajkumar <haranrk@google.com>
PiperOrigin-RevId: 930146494
2026-06-10 16:34:15 -07:00
George Weale aa51512587 chore: apply pre-commit formatting
Change-Id: Iec95a44368502706d814380881c8d10c4a7e8cd4
2026-05-28 16:05:50 -07:00
haranrk da1d8f1552 feat(interactions): update ADK to support Google GenAI SDK v2.0.0
Update ADK to support the new Interactions API. See: https://ai.google.dev/gemini-api/docs/interactions-breaking-changes-may-2026

Key changes include:
* Updated `interactions_utils.py` to parse new v2 interaction events such as
  `InteractionCreatedEvent`, `InteractionCompletedEvent`, and explicit step
  types (`ModelOutputStep`, `FunctionCallStep`, etc.).
* Transitioned from "turns" to "steps" terminology, including renaming
  `convert_contents_to_turns` to `convert_contents_to_steps`.
* Updated `contributing/samples/interactions_api`

Breaking Changes in interactions_utils.py:

- Renamed "turn" functions to "step" equivalents:
  - `convert_content_to_turn` -> `_convert_content_to_step`
  - `convert_contents_to_turns` -> `_convert_contents_to_steps`
  - `convert_interaction_output_to_part` -> `_convert_interaction_step_to_parts`
- Updated `build_interactions_request_log` to use required `input_steps` instead of `input_turns`.
- Deprecated `convert_part_to_interaction_content`

Change-Id: I962724321342ba0192251896ce51832b214d60d9
2026-05-27 16:30:02 -07:00
Sasha Sobran 162279358c chore: switch main to v2.0.0 GA (transition to v2)
Co-authored-by: Bo Yang <ybo@google.com>
Co-authored-by: Wei Sun (Jack) <weisun@google.com>
Co-authored-by: George Weale <gweale@google.com>
Co-authored-by: Swapnil Agarwal <swapnilag@google.com>
Co-authored-by: Xuan Yang <xygoogle@google.com>
Co-authored-by: Shangjie Chen <deanchen@google.com>
Co-authored-by: Yifan Wang <wanyif@google.com>
Co-authored-by: Kathy Wu <wukathy@google.com>
2026-05-19 02:01:33 +00:00