pub struct ModelCall { /* private fields */ }Expand description
Model-call interception context: the request a ChatModel is about to
receive. Mutations to the messages or tool schemas propagate to the model.
Implementations§
Source§impl ModelCall
impl ModelCall
Sourcepub fn new(
thread_id: impl Into<String>,
node: impl Into<String>,
messages: Vec<ChatMessage>,
tools: Vec<Value>,
) -> Self
pub fn new( thread_id: impl Into<String>, node: impl Into<String>, messages: Vec<ChatMessage>, tools: Vec<Value>, ) -> Self
A context for a model call with messages and tool schemas tools.
Sourcepub fn messages(&self) -> &[ChatMessage]
pub fn messages(&self) -> &[ChatMessage]
The conversation about to be sent.
Sourcepub fn messages_mut(&mut self) -> &mut Vec<ChatMessage>
pub fn messages_mut(&mut self) -> &mut Vec<ChatMessage>
Mutable access to the conversation (inject, redact, rewrite).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelCall
impl RefUnwindSafe for ModelCall
impl Send for ModelCall
impl Sync for ModelCall
impl Unpin for ModelCall
impl UnsafeUnpin for ModelCall
impl UnwindSafe for ModelCall
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