pub struct MemoryServiceAdapter { /* private fields */ }Available on crate feature
memory only.Expand description
Adapts any MemoryService into an adk_core::Memory implementation.
Binds app_name and user_id at construction so the runner’s
search(query: &str) calls are forwarded with full context.
Implementations§
Source§impl MemoryServiceAdapter
impl MemoryServiceAdapter
Sourcepub fn new(
inner: Arc<dyn MemoryService>,
app_name: impl Into<String>,
user_id: impl Into<String>,
) -> MemoryServiceAdapter
pub fn new( inner: Arc<dyn MemoryService>, app_name: impl Into<String>, user_id: impl Into<String>, ) -> MemoryServiceAdapter
Create a new adapter binding a memory service to a specific app and user.
Trait Implementations§
Source§impl Memory for MemoryServiceAdapter
impl Memory for MemoryServiceAdapter
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<MemoryEntry>, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryServiceAdapter: 'async_trait,
Source§fn add<'life0, 'async_trait>(
&'life0 self,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryServiceAdapter: 'async_trait,
fn add<'life0, 'async_trait>(
&'life0 self,
entry: MemoryEntry,
) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryServiceAdapter: 'async_trait,
Add a single memory entry. Read more
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryServiceAdapter: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64, AdkError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryServiceAdapter: 'async_trait,
Delete entries matching a query. Returns count of deleted entries. Read more
Auto Trait Implementations§
impl Freeze for MemoryServiceAdapter
impl !RefUnwindSafe for MemoryServiceAdapter
impl Send for MemoryServiceAdapter
impl Sync for MemoryServiceAdapter
impl Unpin for MemoryServiceAdapter
impl UnsafeUnpin for MemoryServiceAdapter
impl !UnwindSafe for MemoryServiceAdapter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.