pub struct VecPromptMsgsDeque<T: Config, L: Llm<T>> {
pub tokens: <L as Llm<T>>::Tokens,
pub inner: VecDeque<<L as Llm<T>>::Request>,
}
Expand description
A helper struct to manage the prompt messages in a deque while keeping track of the tokens added or removed.
Fields§
§tokens: <L as Llm<T>>::Tokens
§inner: VecDeque<<L as Llm<T>>::Request>
Implementations§
Source§impl<T: Config, L: Llm<T>> VecPromptMsgsDeque<T, L>
impl<T: Config, L: Llm<T>> VecPromptMsgsDeque<T, L>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
pub fn push_front(&mut self, msg_reqs: L::Request)
pub fn push_back(&mut self, msg_reqs: L::Request)
pub fn append(&mut self, msg_reqs: &mut VecDeque<L::Request>)
pub fn truncate(&mut self, len: usize)
pub fn extend(&mut self, msg_reqs: Vec<L::Request>)
pub fn into_vec(self) -> Vec<L::Request>
Auto Trait Implementations§
impl<T, L> Freeze for VecPromptMsgsDeque<T, L>
impl<T, L> RefUnwindSafe for VecPromptMsgsDeque<T, L>
impl<T, L> Send for VecPromptMsgsDeque<T, L>
impl<T, L> Sync for VecPromptMsgsDeque<T, L>
impl<T, L> Unpin for VecPromptMsgsDeque<T, L>
impl<T, L> UnwindSafe for VecPromptMsgsDeque<T, L>
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