v0.19.0
v0.19.0 Release Summary
What Changed
This release fixes ADK (Google Agent Development Kit) response deserialization and adds Provider::GoogleAdk as a first-class provider. The previous heuristic required a "partial" key to identify ADK responses, which failed for valid ADK responses that omit it. Response routing is now split into a provider-hinted path (direct, no key inspection) and an improved heuristic fallback.
Breaking Changes
ChatResponse::from_response_value gains a required second argument.
Before:
ChatResponse::from_response_value(value: Value) -> Result<Self, ProviderError>After:
ChatResponse::from_response_value(value: Value, provider: Option<&Provider>) -> Result<Self, ProviderError>Pass None to preserve the previous heuristic behavior. Pass Some(&Provider::GoogleAdk) (or any other variant) to bypass key inspection entirely.
Changes
ADK response deserialization
The old heuristic routed to AdkLlmV1 only when both "partial" and at least one of "model_version" or "turn_complete" were present. AdkLlmResponse has all-optional fields, so responses without "partial" silently misrouted to GeminiV1 (if "candidates" was present) or returned Err.
from_response_value now accepts an optional Provider hint:
- Provider hint given: deserializes directly into the provider's type with no key inspection.
Provider::GoogleAdkalways producesAdkLlmV1regardless of which fields are present. - No hint (
NoneorUndefined): falls through to the heuristic, which is improved (see below).
Heuristic ADK detection
The heuristic ADK check now fires on any of 12 keys rather than requiring "partial":
| Key | Why it signals ADK |
|---|---|
partial, turn_complete, interrupted |
ADK event fields absent from Gemini |
error_code, error_message, interaction_id |
ADK-exclusive |
live_session_resumption_update, input_transcription, output_transcription, custom_metadata |
ADK-exclusive |
usage_metadata |
ADK snake_case; Gemini uses usageMetadata |
model_version |
ADK snake_case; Gemini uses modelVersion |
The ADK check is ordered before the Gemini "candidates" check, so ADK responses that include "candidates" no longer misroute to GeminiV1.
Provider::GoogleAdk enum variant
Provider::GoogleAdk is now a recognized variant across the type system:
Provider::from_string("google_adk")/as_str()→"google_adk"ModelSettings::validate_provider(GoogleAdk)acceptsGoogleChatsettingsModelSettings::provider_default_settings(GoogleAdk)returnsGeminiSettings::default()(previously fell through toOpenAIChatSettings, causing any ADK prompt without explicit settings to immediately fail validation)- Message creation, system role, and
is_google_provider()all treatGoogleAdkas part of the Google family - Python stub:
Provider.GoogleAdkis exported frompotato_head
Bug fix: Prompt::new_rs with Provider::GoogleAdk and no explicit settings
Previously, calling Prompt::new_rs(…, Provider::GoogleAdk, …, None) (no model_settings) would error with InvalidModelSettings because provider_default_settings returned OpenAIChatSettings for GoogleAdk, which then failed validate_provider. This is fixed.
Upgrading from v0.18.0
-
Update all
from_response_valuecall sites — add a second argument. To preserve existing behavior exactly, passNone:// Before ChatResponse::from_response_value(value) // After ChatResponse::from_response_value(value, None) // Or, if you know the provider: ChatResponse::from_response_value(value, Some(&Provider::GoogleAdk))
-
No schema changes, no config changes, no environment variable changes.
-
Python callers:
Provider.GoogleAdkis now available. No existing Python code breaks —from_response_valueis not exposed to Python.