pub enum OutputMode {
Auto,
Tool,
Native,
Prompted,
}Expand description
Select how requests convey an agent’s output schema.
Whatever the mode, and whether or not the provider enforces the schema, a
run ends only on an answer that is JSON fitting the schema, as
rig_core::tool::validate::validate checks it: it asks the model again
while its output-retry budget lasts, then fails.
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. A text answer that satisfies the schema is also accepted.
Native
Send a native structured-output constraint on every turn. Enforcement and compatibility with tool calls depend on provider capabilities; a provider that drops the constraint is checked by the run.
Prompted
Put the schema in the system prompt and return final text verbatim. Prose or a markdown fence around the JSON 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 Forget for OutputMode
impl Freeze for OutputMode
impl Move 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.