pub struct Turn {
pub role: Role,
pub content: String,
pub vector: Vec<f32>,
}Expand description
One conversation turn, written to working memory by Session::add_turn.
The vector is the caller-supplied embedding of content; Mnemo does not
embed text itself.
Fields§
§role: RoleWho produced the turn.
content: StringThe turn’s text.
vector: Vec<f32>Embedding of content.
Implementations§
Source§impl Turn
impl Turn
Sourcepub fn new(role: Role, content: impl Into<String>, vector: Vec<f32>) -> Self
pub fn new(role: Role, content: impl Into<String>, vector: Vec<f32>) -> Self
A turn with an explicit role.
Sourcepub fn user(content: impl Into<String>, vector: Vec<f32>) -> Self
pub fn user(content: impl Into<String>, vector: Vec<f32>) -> Self
Shorthand for a Role::User turn.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Turn
impl RefUnwindSafe for Turn
impl Send for Turn
impl Sync for Turn
impl Unpin for Turn
impl UnsafeUnpin for Turn
impl UnwindSafe for Turn
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