Skip to content

Commit 45a6070

Browse files
committed
fix: version and cache metadata
1 parent 143ad50 commit 45a6070

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies = [
1515
"pydantic-settings>=2.10.1", # Config management
1616
"a2a-sdk>=0.3.0", # For Google Agent2Agent protocol
1717
"deprecated>=1.2.18",
18-
"google-adk>=1.10.0", # For basic agent architecture
18+
"google-adk>=1.15.0", # For basic agent architecture
1919
"litellm>=1.79.3", # For model inference
2020
"loguru>=0.7.3", # For better logging
2121
"opentelemetry-exporter-otlp>=1.35.0",

veadk/models/ark_llm.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,20 @@ def add_previous_response_id(
263263
and "response_id" in events[-2].custom_metadata
264264
):
265265
previous_response_id = events[-2].custom_metadata["response_id"]
266-
llm_request.cache_metadata = CacheMetadata(
267-
cache_name=previous_response_id,
268-
expire_time=0,
269-
fingerprint="",
270-
invocations_used=0,
271-
cached_contents_count=0,
272-
)
266+
if "contents_count" in CacheMetadata.model_fields: # adk >= 1.17
267+
llm_request.cache_metadata = CacheMetadata(
268+
cache_name=previous_response_id,
269+
expire_time=0,
270+
fingerprint="",
271+
invocations_used=0,
272+
contents_count=0,
273+
)
274+
else: # 1.15 <= adk < 1.17
275+
llm_request.cache_metadata = CacheMetadata(
276+
cache_name=previous_response_id,
277+
expire_time=0,
278+
fingerprint="",
279+
invocations_used=0,
280+
cached_contents_count=0,
281+
)
273282
return

0 commit comments

Comments
 (0)