pub struct InteractionRecord {
pub timestamp: DateTime<Utc>,
pub method: String,
pub path: String,
pub query_params: HashMap<String, String>,
pub headers: HashMap<String, String>,
pub request: Option<Value>,
pub status: u16,
pub response: Option<Value>,
pub embedding: Option<Vec<f32>>,
pub metadata: HashMap<String, String>,
}Expand description
A single interaction record (request + response pair)
Fields§
§timestamp: DateTime<Utc>Timestamp of the interaction
method: StringHTTP method (GET, POST, PUT, DELETE, etc.)
path: StringRequest path (e.g., /api/users/123)
query_params: HashMap<String, String>Query parameters
headers: HashMap<String, String>Request headers
request: Option<Value>Request body (if present)
status: u16Response status code
response: Option<Value>Response body (if present)
embedding: Option<Vec<f32>>Vector embedding for semantic search (generated from interaction summary)
metadata: HashMap<String, String>Metadata about this interaction
Implementations§
Source§impl InteractionRecord
impl InteractionRecord
Sourcepub fn new(
method: impl Into<String>,
path: impl Into<String>,
request: Option<Value>,
status: u16,
response: Option<Value>,
) -> InteractionRecord
pub fn new( method: impl Into<String>, path: impl Into<String>, request: Option<Value>, status: u16, response: Option<Value>, ) -> InteractionRecord
Create a new interaction record (timestamped at the current wall-clock time).
Sourcepub fn with_query_params(
self,
params: HashMap<String, String>,
) -> InteractionRecord
pub fn with_query_params( self, params: HashMap<String, String>, ) -> InteractionRecord
Add query parameters.
Sourcepub fn with_headers(self, headers: HashMap<String, String>) -> InteractionRecord
pub fn with_headers(self, headers: HashMap<String, String>) -> InteractionRecord
Add headers.
Sourcepub fn with_embedding(self, embedding: Vec<f32>) -> InteractionRecord
pub fn with_embedding(self, embedding: Vec<f32>) -> InteractionRecord
Set embedding.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> InteractionRecord
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> InteractionRecord
Add metadata.
Trait Implementations§
Source§impl Clone for InteractionRecord
impl Clone for InteractionRecord
Source§fn clone(&self) -> InteractionRecord
fn clone(&self) -> InteractionRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InteractionRecord
impl Debug for InteractionRecord
Source§impl<'de> Deserialize<'de> for InteractionRecord
impl<'de> Deserialize<'de> for InteractionRecord
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InteractionRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InteractionRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for InteractionRecord
impl Serialize for InteractionRecord
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for InteractionRecord
impl RefUnwindSafe for InteractionRecord
impl Send for InteractionRecord
impl Sync for InteractionRecord
impl Unpin for InteractionRecord
impl UnsafeUnpin for InteractionRecord
impl UnwindSafe for InteractionRecord
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