Skip to content

v0.19.0

Choose a tag to compare

@thorrester thorrester released this 19 Mar 14:58
· 51 commits to main since this release
f1bf86f

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::GoogleAdk always produces AdkLlmV1 regardless of which fields are present.
  • No hint (None or Undefined): 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) accepts GoogleChat settings
  • ModelSettings::provider_default_settings(GoogleAdk) returns GeminiSettings::default() (previously fell through to OpenAIChatSettings, causing any ADK prompt without explicit settings to immediately fail validation)
  • Message creation, system role, and is_google_provider() all treat GoogleAdk as part of the Google family
  • Python stub: Provider.GoogleAdk is exported from potato_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

  1. Update all from_response_value call sites — add a second argument. To preserve existing behavior exactly, pass None:

    // 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))
  2. No schema changes, no config changes, no environment variable changes.

  3. Python callers: Provider.GoogleAdk is now available. No existing Python code breaks — from_response_value is not exposed to Python.