pub struct AmpEnvelope {
pub amp_version: String,
pub op: AmpOp,
pub memory_type: AmpMemoryType,
pub agent_id: Option<String>,
pub content: Option<String>,
pub query: Option<String>,
pub memory_ids: Vec<String>,
pub top_k: Option<usize>,
pub tags: Vec<String>,
pub ttl_seconds: Option<u64>,
pub metadata: Option<Value>,
}Expand description
A single AMP request envelope.
Every field except op and memory_type is optional; which
fields are meaningful depends on op (e.g. query for
recall, memory_ids for forget / merge / expire,
content for remember). crate::store enforces the
per-op requirements and returns a typed error on a malformed
envelope rather than panicking.
Fields§
§amp_version: StringAMP protocol version. Currently "amp/1".
op: AmpOp§memory_type: AmpMemoryType§agent_id: Option<String>Agent scope. Falls back to the engine default when omitted.
content: Option<String>remember payload.
query: Option<String>recall query string.
memory_ids: Vec<String>Target memory ids for forget / merge / expire.
top_k: Option<usize>recall top-k. Defaults to 5 (the conformance suite’s
recall@5).
Free-form tags attached on remember / used to scope recall.
ttl_seconds: Option<u64>expire: seconds from now after which the memory expires. When
omitted (or 0), expire takes effect immediately.
metadata: Option<Value>Optional opaque metadata round-tripped onto the stored record.
Implementations§
Source§impl AmpEnvelope
impl AmpEnvelope
Sourcepub fn new(op: AmpOp, memory_type: AmpMemoryType) -> Self
pub fn new(op: AmpOp, memory_type: AmpMemoryType) -> Self
Construct a minimal envelope for op over memory_type.
Trait Implementations§
Source§impl Clone for AmpEnvelope
impl Clone for AmpEnvelope
Source§fn clone(&self) -> AmpEnvelope
fn clone(&self) -> AmpEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AmpEnvelope
impl Debug for AmpEnvelope
Source§impl<'de> Deserialize<'de> for AmpEnvelope
impl<'de> Deserialize<'de> for AmpEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AmpEnvelope
impl RefUnwindSafe for AmpEnvelope
impl Send for AmpEnvelope
impl Sync for AmpEnvelope
impl Unpin for AmpEnvelope
impl UnsafeUnpin for AmpEnvelope
impl UnwindSafe for AmpEnvelope
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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> ⓘ
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> ⓘ
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 more