pub enum Role {
User,
Assistant,
Tool,
}Expand description
Role of a message participant in a completion request.
Variants§
User
A message from the end user or calling code.
Assistant
A message from the assistant (used for multi-turn conversations).
Tool
A tool result message.
Anthropic: sent as role: "user" with type: "tool_result" content.
OpenAI: sent as role: "tool" with tool_call_id.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
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