pub enum OutputMode {
Auto,
Tool,
Native,
Prompted,
}Expand description
Select how requests convey an agent’s output schema. Native enforcement depends on provider support. Tool and prompted modes are best-effort; callers must validate returned values before relying on the schema.
Variants§
Auto
Resolve to tool output when a schema and function tools are present, tool choice permits it, and native output cannot compose with tools. Otherwise use native output.
Tool
Offer the schema as a synthetic final-answer tool instead of a native constraint. Calling it is best-effort; callers must validate the result.
Native
Send a native structured-output constraint on every turn. Enforcement and compatibility with tool calls depend on provider capabilities.
Prompted
Put the schema in the system prompt and return final text verbatim. Callers must extract and validate JSON; prose and markdown may be present.
Trait Implementations§
Source§impl Clone for OutputMode
impl Clone for OutputMode
Source§impl Debug for OutputMode
impl Debug for OutputMode
Source§impl Default for OutputMode
impl Default for OutputMode
Source§impl<'de> Deserialize<'de> for OutputMode
impl<'de> Deserialize<'de> for OutputMode
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>,
impl Eq for OutputMode
Source§impl PartialEq for OutputMode
impl PartialEq for OutputMode
Source§impl Serialize for OutputMode
impl Serialize for OutputMode
impl StructuralPartialEq for OutputMode
Auto Trait Implementations§
impl Freeze for OutputMode
impl RefUnwindSafe for OutputMode
impl Send for OutputMode
impl Sync for OutputMode
impl Unpin for OutputMode
impl UnsafeUnpin for OutputMode
impl UnwindSafe for OutputMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.