pub struct OutputFormat { /* private fields */ }Expand description
Helper for building model-appropriate prompt text from sections, key/value lines and values.
Implementations§
Source§impl OutputFormat
impl OutputFormat
Sourcepub fn new(capability: &Capability) -> Self
pub fn new(capability: &Capability) -> Self
Create with formatting derived from Capability.
Sourcepub fn section_start(&mut self, string: &str)
pub fn section_start(&mut self, string: &str)
Start a section header.
Sourcepub fn section_end(&mut self)
pub fn section_end(&mut self)
End current section.
Sourcepub fn single_item(&mut self, key: &str, text: &str)
pub fn single_item(&mut self, key: &str, text: &str)
Write unordered key/value item (adds bullet when unordered is Prefix::Unordered).
Sourcepub fn single_line(&mut self, key: &str, text: &str)
pub fn single_line(&mut self, key: &str, text: &str)
Write key/value line without list prefix.
Sourcepub fn single_line_quoted(&mut self, key: &str, text: &str)
pub fn single_line_quoted(&mut self, key: &str, text: &str)
Write quoted value; chooses quote kind based on content.
Sourcepub fn single_line_tagged(&mut self, key: &str, text: &str)
pub fn single_line_tagged(&mut self, key: &str, text: &str)
Write key/value with value wrapped in < >.
Sourcepub fn value(&mut self, value: &Value)
pub fn value(&mut self, value: &Value)
Write Value without list prefix using Writer::print_value.
Sourcepub fn ordered_value(&mut self, value: &Value)
pub fn ordered_value(&mut self, value: &Value)
Write Value using ordered prefix.
Sourcepub fn unordered_value(&mut self, value: &Value)
pub fn unordered_value(&mut self, value: &Value)
Write Value using unordered prefix.
Auto Trait Implementations§
impl Freeze for OutputFormat
impl RefUnwindSafe for OutputFormat
impl Send for OutputFormat
impl Sync for OutputFormat
impl Unpin for OutputFormat
impl UnwindSafe for OutputFormat
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