From 08627c124b7a2bc305e809c81b33b98171943e7b Mon Sep 17 00:00:00 2001 From: Shahin Saadati Date: Tue, 11 Aug 2026 12:40:16 -0700 Subject: [PATCH 1/2] Document createHttpOptions on the Kotlin context cache config ContextCacheConfig gained a fourth parameter, createHttpOptions, in adk-kotlin 0.7.0. It bounds the CachedContent.create() call specifically, and is fail-open: when the create exceeds the timeout it fails and the request proceeds uncached, so it is a latency guard rather than a correctness switch. The snippet says so, since that is the part the signature does not convey. No other language documents this. Python and Java have no equivalent parameter at all -- the Java record has exactly three components -- so this is Kotlin-first rather than a backfill. HttpOptions is ADK's own com.google.adk.kt.types.HttpOptions, deliberately not the backend SDK's, so the import matters: two other types share the name. Extracted, compiled and ran the snippet against the 0.7.0 pin: OK timeout=10s. --- docs/context/caching.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/context/caching.md b/docs/context/caching.md index b71d240db1..c565fb8f3e 100644 --- a/docs/context/caching.md +++ b/docs/context/caching.md @@ -74,7 +74,9 @@ these settings, as shown in the following code sample: import com.google.adk.kt.annotations.ExperimentalContextCachingFeature import com.google.adk.kt.apps.App import com.google.adk.kt.models.Gemini + import com.google.adk.kt.types.HttpOptions import kotlin.time.Duration.Companion.minutes + import kotlin.time.Duration.Companion.seconds val rootAgent = LlmAgent( @@ -95,6 +97,8 @@ these settings, as shown in the following code sample: minTokens = 8192, ttl = 10.minutes, // Store for up to 10 minutes cacheIntervals = 5, // Refresh after 5 uses + // On timeout the create fails and the request proceeds uncached. + createHttpOptions = HttpOptions(timeout = 10.seconds), ), ) ``` From 8b64a0849262e95b94573330c249cf5f9b78ac49 Mon Sep 17 00:00:00 2001 From: Shahin Saadati Date: Fri, 14 Aug 2026 12:17:59 -0700 Subject: [PATCH 2/2] docs: add create_http_options parameter documentation for cache configuration --- docs/context/caching.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/context/caching.md b/docs/context/caching.md index c565fb8f3e..3473401ca0 100644 --- a/docs/context/caching.md +++ b/docs/context/caching.md @@ -120,6 +120,10 @@ all agents within your app. content can be used before it expires. This setting allows you to control how frequently the cache is updated, even if the TTL has not expired. Defaults to `10`. +- **`create_http_options`** (HttpOptions): The HTTP options for the cache + creation call, which lets you set a timeout on it. If the call times out, + it fails and the request proceeds without caching. Available in Python and + Kotlin; defaults to none. ## Next steps