v0.4.0
π 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-Afterup 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: RetryConfigfield 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
Embeddertrait inadk_rs::core(plus acosine_similarityhelper). VectorMemoryService(adk_rs::services::mem) embeds entries at ingest time and
ranks searches by cosine similarity, withwith_top_k(n)(default 5) and
with_min_score(s)builders. Drop-in replacement forInMemoryMemoryServiceβ
theload_memory/preload_memorytools work unchanged.- Two embedders in the box:
GeminiEmbedder(batchEmbedContents, e.g.
gemini-embedding-001) andOpenAiEmbedder(/embeddings, e.g.
text-embedding-3-small; reaches Azure/Ollama viaOPENAI_BASE_URL). MockEmbedderunder thetestingfeature: 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 plainjson_objectmode. - 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
Schemato each provider's
JSON Schema dialect: lowercased types,nullableβ["type", "null"]unions,
additionalProperties: falseon 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)βLiveSessionwithsend_text,
send_audio(realtime PCM with server-side VAD),send_audio_stream_end,
send_tool_response,recv, andclose.LiveEventcovers incremental text, decoded PCM audio, input/output
transcriptions, tool calls and cancellations, barge-inInterrupted,
GenerationComplete,TurnComplete,GoAway, and usage metadata.LiveConfigselects response modality (TEXT or AUDIO), prebuilt voice, system
instruction, tools, and transcription flags.- The transport-security policy carries over:
wss://always, plainws://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