Skip to content

v0.4.0

Choose a tag to compare

@skundu42 skundu42 released this 10 Jun 07:26
· 2 commits to main since this release

πŸ” Automatic provider retries

All provider clients (Gemini, Anthropic, OpenAi) β€” including the new embedding
clients β€” now retry transient failures with exponential backoff and full jitter:

  • Retries 429 (honouring Retry-After up to 60s), 408/409/5xx, and
    connect/timeout transport errors. Other 4xx fail immediately.
  • Defaults mirror the official SDKs: 2 retries, 500ms initial backoff, 8s cap.
  • Tune or opt out per client via the new retry: RetryConfig field on each provider
    config (RetryConfig::disabled() restores the old fail-fast behaviour).
  • For streaming calls, retry covers connection establishment; mid-stream failures
    still surface as stream errors.

β†’ https://adk-rs.vercel.app/docs/providers

🧠 Semantic memory

Memory search graduates from substring matching to embedding-based retrieval:

  • New Embedder trait in adk_rs::core (plus a cosine_similarity helper).
  • VectorMemoryService (adk_rs::services::mem) embeds entries at ingest time and
    ranks searches by cosine similarity, with with_top_k(n) (default 5) and
    with_min_score(s) builders. Drop-in replacement for InMemoryMemoryService β€”
    the load_memory / preload_memory tools work unchanged.
  • Two embedders in the box: GeminiEmbedder (batchEmbedContents, e.g.
    gemini-embedding-001) and OpenAiEmbedder (/embeddings, e.g.
    text-embedding-3-small; reaches Azure/Ollama via OPENAI_BASE_URL).
  • MockEmbedder under the testing feature: a deterministic hashed bag-of-words
    embedder for offline tests of semantic-memory flows.

β†’ https://adk-rs.vercel.app/docs/memory

🧾 Structured output on every provider

.output_schema(...) is now server-enforced on all three providers, not just Gemini:

  • OpenAI-compatible β€” strict structured outputs
    (response_format: {"type": "json_schema", "strict": true, ...}). Optional
    properties are sent as required-but-nullable to satisfy strict mode while
    preserving the original semantics. A JSON mime type without a schema still maps
    to plain json_object mode.
  • Anthropic β€” the Messages API's native
    output_config: {"format": {"type": "json_schema", ...}}. Requires a
    structured-outputs-capable Claude model (Claude 4.5-generation and newer).
  • A shared transform converts the OpenAPI-flavoured Schema to each provider's
    JSON Schema dialect: lowercased types, nullable β†’ ["type", "null"] unions,
    additionalProperties: false on objects, unsupported keywords stripped.

β†’ https://adk-rs.vercel.app/docs/structured-output

πŸŽ™ Gemini Live API (feature = "live")

Bidirectional WebSocket streaming over BidiGenerateContent:

  • Gemini::connect_live(LiveConfig) β†’ LiveSession with send_text,
    send_audio (realtime PCM with server-side VAD), send_audio_stream_end,
    send_tool_response, recv, and close.
  • LiveEvent covers incremental text, decoded PCM audio, input/output
    transcriptions, tool calls and cancellations, barge-in Interrupted,
    GenerationComplete, TurnComplete, GoAway, and usage metadata.
  • LiveConfig selects response modality (TEXT or AUDIO), prebuilt voice, system
    instruction, tools, and transcription flags.
  • The transport-security policy carries over: wss:// always, plain ws:// only
    to loopback hosts.
  • Live sessions are a model-level surface today (alongside generate_content);
    runner-loop integration is planned.

β†’ https://adk-rs.vercel.app/docs/live

Full Changelog: v0.3.0...v0.4.0