pub struct AgentMessage { /* private fields */ }Expand description
One message in an Agent v1 invocation request.
Implementations§
Source§impl AgentMessage
impl AgentMessage
Sourcepub fn new(role: AgentRole, content: impl Into<AgentContent>) -> Self
pub fn new(role: AgentRole, content: impl Into<AgentContent>) -> Self
Construct a message with an explicit typed role.
Sourcepub fn user(content: impl Into<AgentContent>) -> Self
pub fn user(content: impl Into<AgentContent>) -> Self
Construct a user message.
Sourcepub fn system(content: impl Into<AgentContent>) -> Self
pub fn system(content: impl Into<AgentContent>) -> Self
Construct a system message.
Sourcepub fn assistant(content: impl Into<AgentContent>) -> Self
pub fn assistant(content: impl Into<AgentContent>) -> Self
Construct an assistant message.
Sourcepub const fn content(&self) -> &AgentContent
pub const fn content(&self) -> &AgentContent
Borrow the typed message content.
Trait Implementations§
Source§impl Clone for AgentMessage
impl Clone for AgentMessage
Source§fn clone(&self) -> AgentMessage
fn clone(&self) -> AgentMessage
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 moreSource§impl Debug for AgentMessage
impl Debug for AgentMessage
Source§impl<'de> Deserialize<'de> for AgentMessage
impl<'de> Deserialize<'de> for AgentMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentMessage
impl RefUnwindSafe for AgentMessage
impl Send for AgentMessage
impl Sync for AgentMessage
impl Unpin for AgentMessage
impl UnsafeUnpin for AgentMessage
impl UnwindSafe for AgentMessage
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