Expand description
Schema normalization cache for LLM provider adapters.
Caches normalized schemas keyed by a content hash of the serialized JSON, avoiding redundant normalization when the same tool schema is encountered across multiple requests.
§Example
use adk_core::{SchemaCache, SchemaAdapter, GenericSchemaAdapter};
use serde_json::json;
let cache = SchemaCache::new();
let adapter = GenericSchemaAdapter;
let schema = json!({"type": "object", "properties": {"name": {"type": "string"}}});
// First call normalizes and caches
let result1 = cache.get_or_normalize(&schema, &adapter);
// Second call returns cached value without re-normalizing
let result2 = cache.get_or_normalize(&schema, &adapter);
assert_eq!(result1, result2);Structs§
- Schema
Cache - A thread-safe cache for normalized JSON Schemas.