Files
google--adk-python/contributing/samples
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
..
2026-06-30 00:31:51 -07:00
2026-01-20 14:50:09 -08:00