pub struct CanonicalInput { /* private fields */ }Expand description
Ordered canonical messages for one transaction submission.
Monoloop does not own chat history. Hosts map their journal into
CanonicalMessage values (typically User / Assistant, plus System /
Tool when needed) and call CanonicalInput::try_new. For a single user
line only, see user_text_input.
Implementations§
Source§impl CanonicalInput
impl CanonicalInput
Sourcepub fn try_new(
messages: Vec<CanonicalMessage>,
limits: &InputLimits,
) -> Result<Self, InputValidationError>
pub fn try_new( messages: Vec<CanonicalMessage>, limits: &InputLimits, ) -> Result<Self, InputValidationError>
Validate and construct input under the given limits.
Sourcepub fn messages(&self) -> &[CanonicalMessage]
pub fn messages(&self) -> &[CanonicalMessage]
Borrow messages in caller order.
Sourcepub fn into_messages(self) -> Vec<CanonicalMessage>
pub fn into_messages(self) -> Vec<CanonicalMessage>
Consume into messages.
Trait Implementations§
Source§impl Clone for CanonicalInput
impl Clone for CanonicalInput
Source§fn clone(&self) -> CanonicalInput
fn clone(&self) -> CanonicalInput
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 CanonicalInput
impl Debug for CanonicalInput
Source§impl<'de> Deserialize<'de> for CanonicalInput
impl<'de> Deserialize<'de> for CanonicalInput
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CanonicalInput
impl PartialEq for CanonicalInput
Source§impl Serialize for CanonicalInput
impl Serialize for CanonicalInput
impl StructuralPartialEq for CanonicalInput
Auto Trait Implementations§
impl Freeze for CanonicalInput
impl RefUnwindSafe for CanonicalInput
impl Send for CanonicalInput
impl Sync for CanonicalInput
impl Unpin for CanonicalInput
impl UnsafeUnpin for CanonicalInput
impl UnwindSafe for CanonicalInput
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