Struct llm_weaver::TapestryFragment
source · pub struct TapestryFragment<T: Config> {
pub context_tokens: <T::PromptModel as Llm<T>>::Tokens,
pub context_messages: Vec<ContextMessage<T>>,
}
Expand description
Represents a single part of a conversation containing a list of messages along with other metadata.
LLM can only hold a limited amount of tokens in a the entire message history/context.
The total number of context_tokens
is tracked when Loom::weave
is executed and if it
exceeds the maximum number of tokens allowed for the current GPT Config::PromptModel
, then a
summary is generated and a new TapestryFragment
instance is created.
Fields§
§context_tokens: <T::PromptModel as Llm<T>>::Tokens
Total number of GPT tokens in the context_messages
.
context_messages: Vec<ContextMessage<T>>
List of ContextMessage
s that represents the message history.
Trait Implementations§
source§impl<T: Clone + Config> Clone for TapestryFragment<T>where
T::PromptModel: Clone,
impl<T: Clone + Config> Clone for TapestryFragment<T>where
T::PromptModel: Clone,
source§fn clone(&self) -> TapestryFragment<T>
fn clone(&self) -> TapestryFragment<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug + Config> Debug for TapestryFragment<T>where
T::PromptModel: Debug,
impl<T: Debug + Config> Debug for TapestryFragment<T>where
T::PromptModel: Debug,
source§impl<T: Default + Config> Default for TapestryFragment<T>where
T::PromptModel: Default,
impl<T: Default + Config> Default for TapestryFragment<T>where
T::PromptModel: Default,
source§fn default() -> TapestryFragment<T>
fn default() -> TapestryFragment<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for TapestryFragment<T>
impl<T> RefUnwindSafe for TapestryFragment<T>
impl<T> Send for TapestryFragment<T>
impl<T> Sync for TapestryFragment<T>
impl<T> Unpin for TapestryFragment<T>
impl<T> UnwindSafe for TapestryFragment<T>
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