pub enum StructuredOutputMode {
Native,
JsonObject,
Off,
}Expand description
Transport shape for structured output (an OpenAiProvider construction
setting): decides how response_format is sent.
Only affects the endpoint-side best-effort constraint strength —
structural conformance is always guaranteed by framework-side validation
(jsonschema validation of the final answer + failure-feedback retries; see
ReActAgent and
ModelOptions::structured).
§Choosing a mode
Native: OpenAI-native structured output (thejson_schemashape); when the schema satisfies the strict-mode preconditions,strict: trueis enabled automatically — the strongest endpoint-side constraint;JsonObject: constrains only “must be valid JSON”, not the structure — use it when older compatible endpoints do not support thejson_schemashape; structure relies on framework-side validation (which may cost extra retry rounds);Off: does not sendresponse_format— no structured constraint in the prompt; structure relies entirely on framework-side validation.
Variants§
Native
Sends the json_schema shape of response_format (default).
JsonObject
Sends the json_object shape of response_format.
Off
Does not send response_format.
Trait Implementations§
Source§impl Clone for StructuredOutputMode
impl Clone for StructuredOutputMode
Source§fn clone(&self) -> StructuredOutputMode
fn clone(&self) -> StructuredOutputMode
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 moreimpl Copy for StructuredOutputMode
Source§impl Debug for StructuredOutputMode
impl Debug for StructuredOutputMode
Source§impl Default for StructuredOutputMode
impl Default for StructuredOutputMode
Source§fn default() -> StructuredOutputMode
fn default() -> StructuredOutputMode
Returns the “default value” for a type. Read more
impl Eq for StructuredOutputMode
Source§impl PartialEq for StructuredOutputMode
impl PartialEq for StructuredOutputMode
impl StructuralPartialEq for StructuredOutputMode
Auto Trait Implementations§
impl Freeze for StructuredOutputMode
impl RefUnwindSafe for StructuredOutputMode
impl Send for StructuredOutputMode
impl Sync for StructuredOutputMode
impl Unpin for StructuredOutputMode
impl UnsafeUnpin for StructuredOutputMode
impl UnwindSafe for StructuredOutputMode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.