Skip to content

Commit a192a6a

Browse files
committed
Merge branch 'main' into feature/approval-mechanism
2 parents d3100f5 + 78bfce4 commit a192a6a

File tree

14 files changed

+461
-55
lines changed

14 files changed

+461
-55
lines changed

CHANGELOG.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,97 @@
11
# Changelog
22

3+
## [1.2.1](https://github.com/google/adk-python/compare/v1.2.0...v1.2.1) (2025-06-04)
4+
5+
6+
### Bug Fixes
7+
8+
* Import deprecated from typing_extensions ([068df04](https://github.com/google/adk-python/commit/068df04bcef694725dd36e09f4476b5e67f1b456))
9+
10+
11+
## [1.2.0](https://github.com/google/adk-python/compare/v1.1.1...v1.2.0) (2025-06-04)
12+
13+
14+
### Features
15+
16+
* Add agent engine as a deployment option to the ADK CLI ([2409c3e](https://github.com/google/adk-python/commit/2409c3ef192262c80f5328121f6dc4f34265f5cf))
17+
* Add an option to use gcs artifact service in adk web. ([8d36dbd](https://github.com/google/adk-python/commit/8d36dbda520b1c0dec148e1e1d84e36ddcb9cb95))
18+
* Add index tracking to handle parallel tool call using litellm ([05f4834](https://github.com/google/adk-python/commit/05f4834759c9b1f0c0af9d89adb7b81ea67d82c8))
19+
* Add sortByColumn functionality to List Operation ([af95dd2](https://github.com/google/adk-python/commit/af95dd29325865ec30a1945b98e65e457760e003))
20+
* Add implementation for `get_eval_case`, `update_eval_case` and `delete_eval_case` for the local eval sets manager. ([a7575e0](https://github.com/google/adk-python/commit/a7575e078a564af6db3f42f650e94ebc4f338918))
21+
* Expose more config of VertexAiSearchTool from latest Google GenAI SDK ([2b5c89b](https://github.com/google/adk-python/commit/2b5c89b3a94e82ea4a40363ea8de33d9473d7cf0))
22+
* New Agent Visualization ([da4bc0e](https://github.com/google/adk-python/commit/da4bc0efc0dd96096724559008205854e97c3fd1))
23+
* Set the max width and height of view image dialog to be 90% ([98a635a](https://github.com/google/adk-python/commit/98a635afee399f64e0a813d681cd8521fbb49500))
24+
* Support Langchain StructuredTool for Langchain tool ([7e637d3](https://github.com/google/adk-python/commit/7e637d3fa05ca3e43a937e7158008d2b146b1b81))
25+
* Support Langchain tools that has run_manager in _run args and don't have args_schema populated ([3616bb5](https://github.com/google/adk-python/commit/3616bb5fc4da90e79eb89039fb5e302d6a0a14ec))
26+
* Update for anthropic models ([16f7d98](https://github.com/google/adk-python/commit/16f7d98acf039f21ec8a99f19eabf0ef4cb5268c))
27+
* Use bigquery scope by default in bigquery credentials. ([ba5b80d](https://github.com/google/adk-python/commit/ba5b80d5d774ff5fdb61bd43b7849057da2b4edf))
28+
* Add jira_agent adk samples code which connect Jira cloud ([8759a25](https://github.com/google/adk-python/commit/8759a2525170edb2f4be44236fa646a93ba863e6))
29+
* Render HTML artifact in chat window ([5c2ad32](https://github.com/google/adk-python/commit/5c2ad327bf4262257c3bc91010c3f8c303d3a5f5))
30+
* Add export to json button in the chat window ([fc3e374](https://github.com/google/adk-python/commit/fc3e374c86c4de87b4935ee9c56b6259f00e8ea2))
31+
* Add tooltip to the export session button ([2735942](https://github.com/google/adk-python/commit/273594215efe9dbed44d4ef85e6234bd7ba7b7ae))
32+
33+
34+
### Bug Fixes
35+
36+
* Add adk icon for UI ([2623c71](https://github.com/google/adk-python/commit/2623c710868d832b6d5119f38e22d82adb3de66b))
37+
* Add cache_ok option to remove sa warning. ([841e10a](https://github.com/google/adk-python/commit/841e10ae353e0b1b3d020a26d6cac6f37981550e))
38+
* Add support for running python main function in UnsafeLocalCodeExecutor when the code has an if __name__ == "__main__" statement. ([95e33ba](https://github.com/google/adk-python/commit/95e33baf57e9c267a758e08108cde76adf8af69b))
39+
* Adk web not working on some env for windows, fixes https://github.com/google/adk-web/issues/34 ([daac8ce](https://github.com/google/adk-python/commit/daac8cedfe6d894f77ea52784f0a6d19003b2c00))
40+
* Assign empty inputSchema to MCP tool when converting an ADK tool that wraps a function which takes no parameters. ([2a65c41](https://github.com/google/adk-python/commit/2a65c4118bb2aa97f2a13064db884bd63c14a5f7))
41+
* Call all tools in parallel calls during partial authentication ([0e72efb](https://github.com/google/adk-python/commit/0e72efb4398ce6a5d782bcdcb770b2473eb5af2e))
42+
* Continue fetching events if there are multiple pages. ([6506302](https://github.com/google/adk-python/commit/65063023a5a7cb6cd5db43db14a411213dc8acf5))
43+
* Do not convert "false" value to dict ([60ceea7](https://github.com/google/adk-python/commit/60ceea72bde2143eb102c60cf33b365e1ab07d8f))
44+
* Enhance agent loader exception handler and expose precise error information ([7b51ae9](https://github.com/google/adk-python/commit/7b51ae97245f6990c089183734aad41fe59b3330))
45+
* Ensure function description is copied when ignoring parameters ([7fdc6b4](https://github.com/google/adk-python/commit/7fdc6b4417e5cf0fbc72d3117531914353d3984a))
46+
* Filter memory by app_name and user_id. ([db4bc98](https://github.com/google/adk-python/commit/db4bc9809c7bb6b0d261973ca7cfd87b392694be))
47+
* Fix filtering by user_id for vertex ai session service listing ([9d4ca4e](https://github.com/google/adk-python/commit/9d4ca4ed44cf10bc87f577873faa49af469acc25))
48+
* fix parameter schema generation for gemini ([5a67a94](https://github.com/google/adk-python/commit/5a67a946d2168b80dd6eba008218468c2db2e74e))
49+
* Handle non-indexed function call chunks with incremental fallback index ([b181cbc](https://github.com/google/adk-python/commit/b181cbc8bc629d1c9bfd50054e47a0a1b04f7410))
50+
* Handles function tool parsing corner case where type hints are stored as strings. ([a8a2074](https://github.com/google/adk-python/commit/a8a20743f92cd63c3d287a3d503c1913dd5ad5ae))
51+
* Introduce PreciseTimestamp to fix mysql datetime precision issue. ([841e10a](https://github.com/google/adk-python/commit/841e10ae353e0b1b3d020a26d6cac6f37981550e))
52+
* match arg case in errors ([b226a06](https://github.com/google/adk-python/commit/b226a06c0bf798f85a53c591ad12ee582703af6d))
53+
* ParallelAgent should only append to its immediate sub-agent, not transitive descendants ([ec8bc73](https://github.com/google/adk-python/commit/ec8bc7387c84c3f261c44cedfe76eb1f702e7b17))
54+
* Relax openapi spec to gemini schema conversion to tolerate more cases ([b1a74d0](https://github.com/google/adk-python/commit/b1a74d099fae44d41750b79e58455282d919dd78))
55+
* Remove labels from config when using API key from Google AI Studio to call model ([5d29716](https://github.com/google/adk-python/commit/5d297169d08a2d0ea1a07641da2ac39fa46b68a4))
56+
* **sample:** Correct text artifact saving in artifact_save_text sample ([5c6001d](https://github.com/google/adk-python/commit/5c6001d90fe6e1d15a2db6b30ecf9e7b6c26eee4))
57+
* Separate thinking from text parts in streaming mode ([795605a](https://github.com/google/adk-python/commit/795605a37e1141e37d86c9b3fa484a3a03e7e9a6))
58+
* Simplify content for ollama provider ([eaee49b](https://github.com/google/adk-python/commit/eaee49bc897c20231ecacde6855cccfa5e80d849))
59+
* Timeout issues for mcpstdio server when mcp tools are incorrect. ([45ef668](https://github.com/google/adk-python/commit/45ef6684352e3c8082958bece8610df60048f4a3))
60+
* **transfer_to_agent:** update docstring for clarity and accuracy ([854a544](https://github.com/google/adk-python/commit/854a5440614590c2a3466cf652688ba57d637205))
61+
* Update unit test code for test_connection ([b0403b2](https://github.com/google/adk-python/commit/b0403b2d98b2776d15475f6b525409670e2841fc))
62+
* Use inspect.cleandoc on function docstrings in generate_function_declaration. ([f7cb666](https://github.com/google/adk-python/commit/f7cb66620be843b8d9f3d197d6e8988e9ee0dfca))
63+
* Restore errors path ([32c5ffa](https://github.com/google/adk-python/commit/32c5ffa8ca5e037f41ff345f9eecf5b26f926ea1))
64+
* Unused import for deprecated ([ccd05e0](https://github.com/google/adk-python/commit/ccd05e0b00d0327186e3b1156f1b0216293efe21))
65+
* Prevent JSON parsing errors and preserve non-ascii characters in telemetry ([d587270](https://github.com/google/adk-python/commit/d587270327a8de9f33b3268de5811ac756959850))
66+
* Raise HTTPException when running evals in fast_api if google-adk[eval] is not installed ([1de5c34](https://github.com/google/adk-python/commit/1de5c340d8da1cedee223f6f5a8c90070a9f0298))
67+
* Fix typos in README for sample bigquery_agent and oauth_calendar_agent ([9bdd813](https://github.com/google/adk-python/commit/9bdd813be15935af5c5d2a6982a2391a640cab23))
68+
* Make tool_call one span for telemetry and renamed to execute_tool ([999a7fe](https://github.com/google/adk-python/commit/999a7fe69d511b1401b295d23ab3c2f40bccdc6f))
69+
* Use media type in chat window. Remove isArtifactImage and isArtifactAudio reference ([1452dac](https://github.com/google/adk-python/commit/1452dacfeb6b9970284e1ddeee6c4f3cb56781f8))
70+
* Set output_schema correctly for LiteLllm ([6157db7](https://github.com/google/adk-python/commit/6157db77f2fba4a44d075b51c83bff844027a147))
71+
* Update pending event dialog style ([1db601c](https://github.com/google/adk-python/commit/1db601c4bd90467b97a2f26fe9d90d665eb3c740))
72+
* Remove the gap between event holder and image ([63822c3](https://github.com/google/adk-python/commit/63822c3fa8b0bdce2527bd0d909c038e2b66dd98))
73+
74+
75+
### Documentation
76+
77+
* Adds a sample agent to illustrate state usage via `callbacks`. ([18fbe3c](https://github.com/google/adk-python/commit/18fbe3cbfc9f2af97e4b744ec0a7552331b1d8e3))
78+
* Fix typos in documentation ([7aaf811](https://github.com/google/adk-python/commit/7aaf8116169c210ceda35c649b5b49fb65bbb740))
79+
* Change eval_dataset to eval_dataset_file_path_or_dir ([62d7bf5](https://github.com/google/adk-python/commit/62d7bf58bb1c874caaf3c56a614500ae3b52f215))
80+
* Fix broken link to A2A example ([0d66a78](https://github.com/google/adk-python/commit/0d66a7888b68380241b92f7de394a06df5a0cc06))
81+
* Fix typo in envs.py ([bd588bc](https://github.com/google/adk-python/commit/bd588bce50ccd0e70b96c7291db035a327ad4d24))
82+
* Updates CONTRIBUTING.md to refine setup process using uv. ([04e07b4](https://github.com/google/adk-python/commit/04e07b4a1451123272641a256c6af1528ea6523e))
83+
* Create and update project documentation including README.md and CONTRIBUTING.md ([f180331](https://github.com/google/adk-python/commit/f1803312c6a046f94c23cfeaed3e8656afccf7c3))
84+
* Rename the root agent in the example to match the example name ([94c0aca](https://github.com/google/adk-python/commit/94c0aca685f1dfa4edb44caaedc2de25cc0caa41))
85+
* ADK: add section comment ([349a414](https://github.com/google/adk-python/commit/349a414120fbff0937966af95864bd683f063d08))
86+
87+
88+
### Chore
89+
90+
* Miscellaneous changes ([0724a83](https://github.com/google/adk-python/commit/0724a83aa9cda00c1b228ed47a5baa7527bb4a0a), [a9dcc58](https://github.com/google/adk-python/commit/a9dcc588ad63013d063dbe37095c0d2e870142c3), [ac52eab](https://github.com/google/adk-python/commit/ac52eab88eccafa451be7584e24aea93ff15f3f3), [a0714b8](https://github.com/google/adk-python/commit/a0714b8afc55461f315ede8451b17aad18d698dd))
91+
* Enable release-please workflow ([57d99aa](https://github.com/google/adk-python/commit/57d99aa7897fb229f41c2a08034606df1e1e6064))
92+
* Added unit test coverage for local_eval_sets_manager.py ([174afb3](https://github.com/google/adk-python/commit/174afb3975bdc7e5f10c26f3eebb17d2efa0dd59))
93+
* Extract common options for `adk web` and `adk api_server` ([01965bd](https://github.com/google/adk-python/commit/01965bdd74a9dbdb0ce91a924db8dee5961478b8))
94+
395
## 1.1.1
496

597
### Features

contributing/samples/hello_world_anthropic/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async def check_prime(nums: list[int]) -> str:
6161

6262
root_agent = Agent(
6363
model=Claude(model="claude-3-5-sonnet-v2@20241022"),
64-
name="data_processing_agent",
64+
name="hello_world_agent",
6565
description=(
6666
"hello world agent that can roll a dice of 8 sides and check prime"
6767
" numbers."

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ dependencies = [
4444
"PyYAML>=6.0.2", # For APIHubToolset.
4545
"sqlalchemy>=2.0", # SQL database ORM
4646
"tzlocal>=5.3", # Time zone utilities
47+
"typing-extensions>=4.5, <5",
4748
"uvicorn>=0.34.0", # ASGI server for FastAPI
4849
# go/keep-sorted end
4950
]

src/google/adk/cli/utils/evals.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,20 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from typing import Any
1618
from typing import Tuple
1719

18-
from deprecated import deprecated
1920
from google.genai import types as genai_types
21+
from typing_extensions import deprecated
2022

2123
from ...evaluation.eval_case import IntermediateData
2224
from ...evaluation.eval_case import Invocation
2325
from ...sessions.session import Session
2426

2527

26-
@deprecated(reason='Use convert_session_to_eval_invocations instead.')
28+
@deprecated('Use convert_session_to_eval_invocations instead.')
2729
def convert_session_to_eval_format(session: Session) -> list[dict[str, Any]]:
2830
"""Converts a session data into eval format.
2931

src/google/adk/evaluation/response_evaluator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from typing import Any
1618
from typing import Optional
1719

18-
from deprecated import deprecated
1920
from google.genai import types as genai_types
2021
import pandas as pd
2122
from tabulate import tabulate
23+
from typing_extensions import deprecated
2224
from typing_extensions import override
2325
from vertexai.preview.evaluation import EvalTask
2426
from vertexai.preview.evaluation import MetricPromptTemplateExamples
@@ -124,10 +126,8 @@ def _get_eval_status(self, score: float):
124126

125127
@staticmethod
126128
@deprecated(
127-
reason=(
128-
"This method has been deprecated and will be removed soon. Please use"
129-
" evaluate_invocations instead."
130-
)
129+
"This method has been deprecated and will be removed soon. Please use"
130+
" evaluate_invocations instead."
131131
)
132132
def evaluate(
133133
raw_eval_dataset: list[list[dict[str, Any]]],

src/google/adk/evaluation/trajectory_evaluator.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
1517
from typing import Any
1618
from typing import cast
1719

18-
from deprecated import deprecated
1920
from google.genai import types as genai_types
2021
import pandas as pd
2122
from tabulate import tabulate
23+
from typing_extensions import deprecated
2224
from typing_extensions import override
2325

2426
from .eval_case import Invocation
@@ -100,10 +102,8 @@ def _get_eval_status(self, score: float):
100102

101103
@staticmethod
102104
@deprecated(
103-
reason=(
104-
"This method has been deprecated and will be removed soon. Please use"
105-
" evaluate_invocations instead."
106-
)
105+
"This method has been deprecated and will be removed soon. Please use"
106+
" evaluate_invocations instead."
107107
)
108108
def evaluate(
109109
eval_dataset: list[list[dict[str, Any]]],
@@ -218,7 +218,10 @@ def _evaluate_row(row):
218218
return new_row, failure
219219

220220
@staticmethod
221-
@deprecated()
221+
@deprecated(
222+
"are_tools_equal is deprecated and will be removed soon. Please use"
223+
" TrajectoryEvaluator._are_tool_calls_equal instead."
224+
)
222225
def are_tools_equal(list_a_original, list_b_original):
223226
# Remove other entries that we don't want to evaluate
224227
list_a = [

src/google/adk/sessions/in_memory_session_service.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
from __future__ import annotations
1415

1516
import copy
1617
import logging
@@ -223,6 +224,7 @@ def _list_sessions_impl(
223224
sessions_without_events.append(copied_session)
224225
return ListSessionsResponse(sessions=sessions_without_events)
225226

227+
@override
226228
async def delete_session(
227229
self, *, app_name: str, user_id: str, session_id: str
228230
) -> None:
@@ -247,7 +249,7 @@ def _delete_session_impl(
247249
)
248250
is None
249251
):
250-
return None
252+
return
251253

252254
self.sessions[app_name][user_id].pop(session_id)
253255

@@ -261,11 +263,20 @@ async def append_event(self, session: Session, event: Event) -> Event:
261263
app_name = session.app_name
262264
user_id = session.user_id
263265
session_id = session.id
266+
267+
def _warning(message: str) -> None:
268+
logger.warning(
269+
f'Failed to append event to session {session_id}: {message}'
270+
)
271+
264272
if app_name not in self.sessions:
273+
_warning(f'app_name {app_name} not in sessions')
265274
return event
266275
if user_id not in self.sessions[app_name]:
276+
_warning(f'user_id {user_id} not in sessions[app_name]')
267277
return event
268278
if session_id not in self.sessions[app_name][user_id]:
279+
_warning(f'session_id {session_id} not in sessions[app_name][user_id]')
269280
return event
270281

271282
if event.actions and event.actions.state_delta:

src/google/adk/sessions/vertex_ai_session_service.py

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import asyncio
1717
import logging
1818
import re
19-
import time
2019
from typing import Any
20+
from typing import Dict
2121
from typing import Optional
2222
import urllib.parse
2323

@@ -50,9 +50,6 @@ def __init__(
5050
self.project = project
5151
self.location = location
5252

53-
client = genai.Client(vertexai=True, project=project, location=location)
54-
self.api_client = client._api_client
55-
5653
@override
5754
async def create_session(
5855
self,
@@ -86,6 +83,7 @@ async def create_session(
8683
operation_id = api_response['name'].split('/')[-1]
8784

8885
max_retry_attempt = 5
86+
lro_response = None
8987
while max_retry_attempt >= 0:
9088
lro_response = await api_client.async_request(
9189
http_method='GET',
@@ -99,6 +97,11 @@ async def create_session(
9997
await asyncio.sleep(1)
10098
max_retry_attempt -= 1
10199

100+
if lro_response is None or not lro_response.get('done', None):
101+
raise TimeoutError(
102+
f'Timeout waiting for operation {operation_id} to complete.'
103+
)
104+
102105
# Get session resource
103106
get_session_api_response = await api_client.async_request(
104107
http_method='GET',
@@ -235,11 +238,15 @@ async def delete_session(
235238
) -> None:
236239
reasoning_engine_id = _parse_reasoning_engine_id(app_name)
237240
api_client = _get_api_client(self.project, self.location)
238-
await api_client.async_request(
239-
http_method='DELETE',
240-
path=f'reasoningEngines/{reasoning_engine_id}/sessions/{session_id}',
241-
request_dict={},
242-
)
241+
try:
242+
await api_client.async_request(
243+
http_method='DELETE',
244+
path=f'reasoningEngines/{reasoning_engine_id}/sessions/{session_id}',
245+
request_dict={},
246+
)
247+
except Exception as e:
248+
logger.error(f'Error deleting session {session_id}: {e}')
249+
raise e
243250

244251
@override
245252
async def append_event(self, session: Session, event: Event) -> Event:
@@ -266,7 +273,7 @@ def _get_api_client(project: str, location: str):
266273
return client._api_client
267274

268275

269-
def _convert_event_to_json(event: Event):
276+
def _convert_event_to_json(event: Event) -> Dict[str, Any]:
270277
metadata_json = {
271278
'partial': event.partial,
272279
'turn_complete': event.turn_complete,
@@ -318,7 +325,7 @@ def _convert_event_to_json(event: Event):
318325
return event_json
319326

320327

321-
def _from_api_event(api_event: dict) -> Event:
328+
def _from_api_event(api_event: Dict[str, Any]) -> Event:
322329
event_actions = EventActions()
323330
if api_event.get('actions', None):
324331
event_actions = EventActions(

0 commit comments

Comments
 (0)