Commit Graph

226 Commits

Author SHA1 Message Date
Ankur Sharma bab3be2cf3 feat: Add support for persisting eval run results
If the EvalRunResultsManager is provided to LocalEvalService, then we want to persist the eval run results using it.

PiperOrigin-RevId: 782196848
2025-07-11 19:29:32 -07:00
Ankur Sharma 33eec34577 feat: Adding implementation of evaluate method in LocalEvalService
Also, delete agent_creator.py file. We added this file by mistake.

PiperOrigin-RevId: 782193593
2025-07-11 19:15:40 -07:00
Xiang (Sean) Zhou 134ec0d71e fix: Fix the long running function response event merge logic
1) raise explicit error if the response event contains responses against multiple function call events
2) merge all function responses for the corresponding function call event

PiperOrigin-RevId: 782154577
2025-07-11 16:48:59 -07:00
Xiang (Sean) Zhou a8fcc1b8ab fix: Return final task result in task artifact instead of status message
According to a2a protocol task artifact is a different concept from adk artifact.
if a task is completed the final result should be in task artifact.

PiperOrigin-RevId: 782154265
2025-07-11 16:47:28 -07:00
seanzhou1023 997b6a964d Merge branch 'main' into expose_credential_service 2025-07-11 15:38:27 -07:00
seanzhou1023 7de173ed90 Update test_readonly_context.py 2025-07-11 15:32:37 -07:00
Copybara-Service 0a65b528e3 Merge pull request #1866 from hironow:hironow/type-fix-for-static
PiperOrigin-RevId: 782040553
2025-07-11 11:02:03 -07:00
Sean Zhou 4c5ef1e235 feat: Add configure service account auth for google_api_tool_set 2025-07-10 21:23:59 -07:00
Ankur Sharma 51be7a899c feat: Add implementation of BaseEvalService that runs evals locally
This change:
- Introduces the LocalEvalService Class.
- Implements only the "perform_inference" method. Evaluate method will be implemented in the next CL.
- Adds required test coverage.

PiperOrigin-RevId: 781781954
2025-07-10 19:25:24 -07:00
Che Liu 162228d208 feat: Integrating Plugin with ADK
This change integrates the plugin system with ADK. PluginManager is attached to the invocation context similar to session/artifact/memory.

It includes integrations with following ADK internal callbacks:

* App callbacks: Integrated in the BaseRunner class, in run_async and run_live
* On Message callbacks: Integrated in the BaseRunner class, triggers on run_async.
* Agent callbacks: Integrated in the BaseAgent class. Leveraging the existing *callback functions
* Model callbacks: Integrating in the base_llm_flow.
* Tool callbacks: Integrated in functions.py, wrapped around the code for agent tool_callbacks

Sample code to use plugins:

```python
# Add plugins to Runner

runner = Runner(
      app_name="my-app",
      agent=root_agent,
      artifact_service=artifact_service,
      session_service=session_service,
      memory_service=memory_service,
      plugins=[
        MySamplePlugin(),
        LoggingPlugin(),
      ],
  )

```

PiperOrigin-RevId: 781746586
2025-07-10 17:28:42 -07:00
Che Liu 16ba91cd01 feat: Implement PluginService for registering and executing plugins
PluginService takes the registration of plugins, and provide the wrapper utilities to execute all plugins.

PiperOrigin-RevId: 781745769
2025-07-10 17:26:05 -07:00
Yanfei Chen 5a721d99a7 test: add the unit test for EnterpriseWebSearchTool
PiperOrigin-RevId: 781743222
2025-07-10 17:16:13 -07:00
Liang Wu aef54f8eb7 feat(config): support loading from YAML config in CLI
The supported CLIs are: `adk web`, `adk run` and `adk api_server`.

PiperOrigin-RevId: 781666724
2025-07-10 13:47:58 -07:00
Xiang (Sean) Zhou 584c8c6d91 fix: improve partial event handling and streaming aggregation
- Allow run_async to break on partial events instead of raising ValueError
- Generate aggregated streaming content regardless of finish_reason
- Add error_code and error_message to final streaming responses if model response is interrupted.

PiperOrigin-RevId: 781377328
2025-07-09 23:03:33 -07:00
Hangfei Lin d792018c09 test: Adds test for streaming + function calls
This commit includes a number of new tests for live streaming with function calls. These tests cover various scenarios:
- Single function calls
- Multiple function calls
- Parallel function calls
- Function calls with errors
- Synchronous function calls
- Simple streaming tools
- Video streaming tools
- Stopping a streaming tool
- Multiple streaming tools simultaneously

The tests use mock models and custom runners to simulate the interaction between the agent, model, and tools. They verify that function calls are correctly generated, executed, and that the expected data is returned.

PiperOrigin-RevId: 781318483
2025-07-09 19:41:27 -07:00
Liang Wu d263afd91b feat: add agent.clone() method
This would allow users to easily make a copy of the agents they built without having to add too much boilerplates. This promotes code reuse, modularity and testability of agents.

PiperOrigin-RevId: 781214379
2025-07-09 14:34:58 -07:00
hironow 843b791bb0 chore(fix typo): correct typo AUTHLIB_AVIALABLE → AUTHLIB_AVAILABLE 2025-07-10 03:08:31 +09:00
Joseph Pagadora 75699fbeca feat: Implement auto rater-based evaluator for responses
PiperOrigin-RevId: 780654576
2025-07-08 11:49:26 -07:00
Mateusz Czubak d3b500bd68 feat: expose credential service in readonly context 2025-07-08 11:32:50 +02:00
Hangfei Lin bf39c00610 test: Add tests for live streaming configs
This PR extends the existing Streaming tests to consider new configurations that have been added, including:

- `output_audio_transcription`
- `input_audio_transcription`
- `realtime_input_config`
- `enable_affective_dialog`
- `proactivity`

These configurations are tested individually and also combined, to cover all the possibilities, increasing the testing coverage and ensuring everything is working as expected.

In addition, the new configuration values are also validated to be sure they are properly initialized.

PiperOrigin-RevId: 780178334
2025-07-07 11:01:46 -07:00
Sindri Snær Gunnarsson 362fb3f2b7 fix: scenario where a user can access another users events given the same session id
test: refine test_session_state in test_session_state to catch event leakage

fix: revert app name to my_app for test_session_state test

style: fix pyink style warnings

fix: add app_name to filter as per suggestion from rpedela-recurly
2025-07-02 18:56:08 +00:00
Ankur Sharma 0bd05df471 feat: Add Safety evaluator metric
We add a new metric for evaluating safety of Agent's response to ADK Eval. We delegate the actual implementation to Vertex Gen AI Eval SDK, so using this metric will require GCP project.

As a part of this change, we created (refactored) a simple Facade for vertex gen ai eval sdk.

PiperOrigin-RevId: 778580406
2025-07-02 11:30:31 -07:00
Ankur Sharma 62c4a85917 chore: Update ResponseEvaluator to use newer version of Eval SDK
Also,
- removed functionality that was marked deprecated from the ResponseEvaluator class.
- Added unit test cases

PiperOrigin-RevId: 778568884
2025-07-02 11:00:27 -07:00
google-labs-jules[bot] 0959b06dbd Fix: Handle unexpected 'parameters' argument in FunctionTool.run_async
The LLM occasionally includes an unexpected 'parameters' argument when calling tools, specifically observed with 'transfer_to_agent'. This change makes FunctionTool.run_async more robust by filtering arguments against the function signature before invocation.

This resolves issue #1637.

Update test_function_tool.py

fix typing

fix: add `from __future__ import annotations`
2025-07-02 00:22:09 +00:00
Ankur Sharma b0d88bf172 feat: BaseEvalService declaration and surrounding data models
Also, adds a metric registry.

PiperOrigin-RevId: 778186012
2025-07-01 14:13:48 -07:00