pub struct ReplyDirective {
pub format: ReplyFormat,
pub max_length: Option<usize>,
pub tone: Option<ReplyTone>,
pub language: Option<String>,
pub audience: Option<String>,
pub include_sources: bool,
pub structured_output: Option<Value>,
}Expand description
A directive controlling how a response is formatted and delivered — the battle plan for output.
Fields§
§format: ReplyFormatThe format to use for the response.
max_length: Option<usize>Maximum length in characters (truncate if exceeded).
tone: Option<ReplyTone>Desired tone of the response.
language: Option<String>Language for the response (e.g., “en”, “ja”).
audience: Option<String>Target audience description.
include_sources: boolWhether to include source citations.
structured_output: Option<Value>JSON schema for structured output validation.
Implementations§
Source§impl ReplyDirective
impl ReplyDirective
Sourcepub fn new(format: ReplyFormat) -> Self
pub fn new(format: ReplyFormat) -> Self
Create a new reply directive with the given format and sensible defaults.
Sourcepub fn with_max_length(self, max_length: usize) -> Self
pub fn with_max_length(self, max_length: usize) -> Self
Set the maximum length.
Sourcepub fn with_language(self, language: impl Into<String>) -> Self
pub fn with_language(self, language: impl Into<String>) -> Self
Set the language.
Sourcepub fn with_audience(self, audience: impl Into<String>) -> Self
pub fn with_audience(self, audience: impl Into<String>) -> Self
Set the audience.
Sourcepub fn with_sources(self) -> Self
pub fn with_sources(self) -> Self
Enable source inclusion.
Sourcepub fn with_structured_output(self, schema: Value) -> Self
pub fn with_structured_output(self, schema: Value) -> Self
Set a JSON schema for structured output.
Trait Implementations§
Source§impl Clone for ReplyDirective
impl Clone for ReplyDirective
Source§fn clone(&self) -> ReplyDirective
fn clone(&self) -> ReplyDirective
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 ReplyDirective
impl Debug for ReplyDirective
Source§impl<'de> Deserialize<'de> for ReplyDirective
impl<'de> Deserialize<'de> for ReplyDirective
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 ReplyDirective
impl RefUnwindSafe for ReplyDirective
impl Send for ReplyDirective
impl Sync for ReplyDirective
impl Unpin for ReplyDirective
impl UnsafeUnpin for ReplyDirective
impl UnwindSafe for ReplyDirective
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