pub struct Prepared<'a> {
pub model: &'a str,
pub prompt: Option<&'a str>,
pub tools: &'a [Arc<ToolDefinition>],
pub history: &'a Conversation,
}Expand description
A request as prepared to be sent, as next_request_tokens reads it.
Fields§
§model: &'a strThe model it goes to.
prompt: Option<&'a str>The system prompt sent before the messages, if any.
tools: &'a [Arc<ToolDefinition>]The tools it offers.
history: &'a ConversationIts messages, with their ids.
Implementations§
Source§impl Prepared<'_>
impl Prepared<'_>
Sourcepub fn start(&self) -> RequestStart
pub fn start(&self) -> RequestStart
What this request starts with, to keep once it is sent.
Sourcepub fn whole_tokens(&self) -> u64
pub fn whole_tokens(&self) -> u64
The estimate of the whole request: its system prompt, tools and
messages, by the default HeuristicTokenCounter.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Prepared<'a>
impl<'a> RefUnwindSafe for Prepared<'a>
impl<'a> Send for Prepared<'a>
impl<'a> Sync for Prepared<'a>
impl<'a> Unpin for Prepared<'a>
impl<'a> UnsafeUnpin for Prepared<'a>
impl<'a> UnwindSafe for Prepared<'a>
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