pub struct Instructions {
pub system_prompt: String,
pub response_schema: Option<Value>,
pub examples: Vec<(String, String)>,
pub metadata: Value,
}Expand description
Static persona + response contract for a cognition backend.
Fields§
§system_prompt: StringSystem prompt. Sent verbatim as the system message.
response_schema: Option<Value>Optional JSON schema the backend must conform to. Backends that support structured outputs should enforce this; others may use it as a hint in the system prompt.
examples: Vec<(String, String)>Few-shot examples. Each entry is (user_message, assistant_reply).
Empty for zero-shot prompting.
metadata: ValueFree-form metadata (model name, temperature hint, persona tag). Backends decide which keys, if any, to honour.
Implementations§
Source§impl Instructions
impl Instructions
Trait Implementations§
Source§impl Clone for Instructions
impl Clone for Instructions
Source§fn clone(&self) -> Instructions
fn clone(&self) -> Instructions
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 Instructions
impl Debug for Instructions
Source§impl Default for Instructions
impl Default for Instructions
Source§fn default() -> Instructions
fn default() -> Instructions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Instructions
impl<'de> Deserialize<'de> for Instructions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Instructions
impl RefUnwindSafe for Instructions
impl Send for Instructions
impl Sync for Instructions
impl Unpin for Instructions
impl UnsafeUnpin for Instructions
impl UnwindSafe for Instructions
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