pub struct SystemInstructions { /* private fields */ }Expand description
LanguageModelSession instructions that have been checked for C-FFI compatibility.
Implementations§
Source§impl SystemInstructions
impl SystemInstructions
Sourcepub fn new(value: impl Into<String>) -> Result<Self, Error>
pub fn new(value: impl Into<String>) -> Result<Self, Error>
Creates session instructions, rejecting text containing interior null bytes.
SystemInstructions are developer-controlled system guidance that persists for
the lifetime of a LanguageModelSession.
§Examples
use aimx::SystemInstructions;
let instructions = SystemInstructions::new("Answer in one concise paragraph.")?;
assert_eq!(instructions.as_str(), "Answer in one concise paragraph.");§Errors
Returns Error::NullByte if value contains an interior null byte.
Trait Implementations§
Source§impl Clone for SystemInstructions
impl Clone for SystemInstructions
Source§fn clone(&self) -> SystemInstructions
fn clone(&self) -> SystemInstructions
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 SystemInstructions
impl Debug for SystemInstructions
Source§impl Default for SystemInstructions
impl Default for SystemInstructions
Source§impl PartialEq for SystemInstructions
impl PartialEq for SystemInstructions
Source§impl TryFrom<&str> for SystemInstructions
impl TryFrom<&str> for SystemInstructions
Source§impl TryFrom<InstructionsText> for SystemInstructions
impl TryFrom<InstructionsText> for SystemInstructions
Source§impl TryFrom<String> for SystemInstructions
impl TryFrom<String> for SystemInstructions
impl Eq for SystemInstructions
impl StructuralPartialEq for SystemInstructions
Auto Trait Implementations§
impl Freeze for SystemInstructions
impl RefUnwindSafe for SystemInstructions
impl Send for SystemInstructions
impl Sync for SystemInstructions
impl Unpin for SystemInstructions
impl UnsafeUnpin for SystemInstructions
impl UnwindSafe for SystemInstructions
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