pub struct RolePrompt { /* private fields */ }Expand description
Role-based prompt builder
Constructs prompts with explicit role assignments (system, user, assistant) for better context and behavior control.
Implementations§
Source§impl RolePrompt
impl RolePrompt
Sourcepub fn add_message(self, role: Role, message: impl Into<String>) -> Self
pub fn add_message(self, role: Role, message: impl Into<String>) -> Self
Add a message with explicit role
Trait Implementations§
Source§impl Clone for RolePrompt
impl Clone for RolePrompt
Source§fn clone(&self) -> RolePrompt
fn clone(&self) -> RolePrompt
Returns a duplicate of the value. Read more
1.0.0 · 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 RolePrompt
impl Debug for RolePrompt
Auto Trait Implementations§
impl Freeze for RolePrompt
impl RefUnwindSafe for RolePrompt
impl Send for RolePrompt
impl Sync for RolePrompt
impl Unpin for RolePrompt
impl UnwindSafe for RolePrompt
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