pub struct LlmMessage {
pub role: String,
pub text: String,
pub tool_calls: Vec<ToolCall>,
pub tool_call_id: Option<String>,
}Expand description
A message in the conversation.
Fields§
§role: String§text: String§tool_calls: Vec<ToolCall>§tool_call_id: Option<String>Implementations§
Source§impl LlmMessage
impl LlmMessage
Sourcepub fn assistant_from(resp: &LlmResponse) -> Self
pub fn assistant_from(resp: &LlmResponse) -> Self
Create an assistant message from a response.
Sourcepub fn tool_result(call_id: &str, content: &str) -> Self
pub fn tool_result(call_id: &str, content: &str) -> Self
Create a tool-result message.
Trait Implementations§
Source§impl Clone for LlmMessage
impl Clone for LlmMessage
Source§fn clone(&self) -> LlmMessage
fn clone(&self) -> LlmMessage
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 moreAuto Trait Implementations§
impl Freeze for LlmMessage
impl RefUnwindSafe for LlmMessage
impl Send for LlmMessage
impl Sync for LlmMessage
impl Unpin for LlmMessage
impl UnsafeUnpin for LlmMessage
impl UnwindSafe for LlmMessage
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