pub enum PlainMessage {
System(String),
User(String),
Assistant {
text: String,
tool_calls: Vec<PlainToolCall>,
},
ToolResult {
tool_call_id: String,
tool_name: String,
content: String,
is_error: bool,
},
Custom {
kind: String,
payload: String,
},
}Expand description
Simple test/example transcript shape.
Variants§
Implementations§
Source§impl PlainMessage
impl PlainMessage
pub fn system(text: impl Into<String>) -> Self
pub fn user(text: impl Into<String>) -> Self
pub fn assistant(text: impl Into<String>) -> Self
pub fn assistant_with_tool_calls( text: impl Into<String>, tool_calls: Vec<PlainToolCall>, ) -> Self
pub fn tool_result( tool_call_id: impl Into<String>, tool_name: impl Into<String>, content: impl Into<String>, is_error: bool, ) -> Self
Trait Implementations§
Source§impl Clone for PlainMessage
impl Clone for PlainMessage
Source§fn clone(&self) -> PlainMessage
fn clone(&self) -> PlainMessage
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 PlainMessage
impl Debug for PlainMessage
impl Eq for PlainMessage
Source§impl PartialEq for PlainMessage
impl PartialEq for PlainMessage
impl StructuralPartialEq for PlainMessage
Source§impl TranscriptMessage for PlainMessage
impl TranscriptMessage for PlainMessage
Source§fn render_for_compaction(&self, out: &mut String)
fn render_for_compaction(&self, out: &mut String)
Render the message into the summarization transcript.
Source§fn user_text_for_compaction(&self, out: &mut String) -> bool
fn user_text_for_compaction(&self, out: &mut String) -> bool
Write the user-visible text for real user messages. Read more
Source§fn is_compaction_summary(&self, summary_prefix: &str) -> bool
fn is_compaction_summary(&self, summary_prefix: &str) -> bool
Identify compaction-summary messages that should not be retained as real
recent user messages.
Auto Trait Implementations§
impl Freeze for PlainMessage
impl RefUnwindSafe for PlainMessage
impl Send for PlainMessage
impl Sync for PlainMessage
impl Unpin for PlainMessage
impl UnsafeUnpin for PlainMessage
impl UnwindSafe for PlainMessage
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