Skip to main content

Module adapter

Module adapter 

Source
Expand description

Adapter bridging MemoryService to adk_core::Memory.

The runner expects Arc<dyn adk_core::Memory>, which has a simple search(&str) signature. MemoryService requires a SearchRequest with app_name and user_id. This adapter binds those fields at construction time so any MemoryService can be used as adk_core::Memory.

§Example

use adk_memory::{InMemoryMemoryService, MemoryServiceAdapter};
use std::sync::Arc;

let service = Arc::new(InMemoryMemoryService::new());
let memory = Arc::new(MemoryServiceAdapter::new(service, "my-app", "user-1"));
// memory implements adk_core::Memory and can be passed to RunnerConfig

Structs§

MemoryServiceAdapter
Adapts any MemoryService into an adk_core::Memory implementation.