pub struct JsonModeStrategy {
pub use_system_message: bool,
}Expand description
JSON Mode strategy for providers that only support basic JSON object mode.
This is used for providers like DeepSeek that don’t support JSON Schema but can output JSON objects when instructed via prompt.
This strategy:
- Sets response_format to JsonObject
- Injects the schema into the system prompt to guide the model
Fields§
§use_system_message: boolWhether to inject schema as a system message (true) or append to last user message (false)
Implementations§
Source§impl JsonModeStrategy
impl JsonModeStrategy
Sourcepub fn with_system_message(use_system_message: bool) -> Self
pub fn with_system_message(use_system_message: bool) -> Self
Create a new JSON Mode strategy with configurable message injection
Trait Implementations§
Source§impl Clone for JsonModeStrategy
impl Clone for JsonModeStrategy
Source§fn clone(&self) -> JsonModeStrategy
fn clone(&self) -> JsonModeStrategy
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 JsonModeStrategy
impl Debug for JsonModeStrategy
Source§impl Default for JsonModeStrategy
impl Default for JsonModeStrategy
Auto Trait Implementations§
impl Freeze for JsonModeStrategy
impl RefUnwindSafe for JsonModeStrategy
impl Send for JsonModeStrategy
impl Sync for JsonModeStrategy
impl Unpin for JsonModeStrategy
impl UnwindSafe for JsonModeStrategy
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