#[non_exhaustive]pub struct SystemMessageConfig {
pub mode: Option<String>,
pub content: Option<String>,
pub sections: Option<HashMap<String, SectionOverride>>,
}Expand description
Controls how the system message is constructed.
Use mode: "append" (default) to add content after the built-in system
message, "replace" to substitute it entirely, or "customize" for
section-level overrides.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.mode: Option<String>How content is applied: "append" (default), "replace", or "customize".
content: Option<String>Content string to append or replace.
sections: Option<HashMap<String, SectionOverride>>Section-level overrides (used with mode: "customize").
Implementations§
Source§impl SystemMessageConfig
impl SystemMessageConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct an empty SystemMessageConfig; all fields default to
unset.
Sourcepub fn with_mode(self, mode: impl Into<String>) -> Self
pub fn with_mode(self, mode: impl Into<String>) -> Self
Set the application mode: "append" (default), "replace", or
"customize".
Sourcepub fn with_content(self, content: impl Into<String>) -> Self
pub fn with_content(self, content: impl Into<String>) -> Self
Set the system message content (used by "append" and "replace"
modes).
Sourcepub fn with_sections(self, sections: HashMap<String, SectionOverride>) -> Self
pub fn with_sections(self, sections: HashMap<String, SectionOverride>) -> Self
Set the section-level overrides (used with mode: "customize").
Trait Implementations§
Source§impl Clone for SystemMessageConfig
impl Clone for SystemMessageConfig
Source§fn clone(&self) -> SystemMessageConfig
fn clone(&self) -> SystemMessageConfig
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 SystemMessageConfig
impl Debug for SystemMessageConfig
Source§impl Default for SystemMessageConfig
impl Default for SystemMessageConfig
Source§fn default() -> SystemMessageConfig
fn default() -> SystemMessageConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SystemMessageConfig
impl<'de> Deserialize<'de> for SystemMessageConfig
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 SystemMessageConfig
impl RefUnwindSafe for SystemMessageConfig
impl Send for SystemMessageConfig
impl Sync for SystemMessageConfig
impl Unpin for SystemMessageConfig
impl UnsafeUnpin for SystemMessageConfig
impl UnwindSafe for SystemMessageConfig
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