pub enum StructuredOutputError {
MissingResponseFormat,
InvalidSchema(String),
NoStructuredOutput,
ProviderOutcome(String),
RetriesExhausted {
attempts: u32,
errors: String,
last_value: Option<Value>,
},
Transport(Error),
}Expand description
Errors from the structured-output runner.
These are typed terminal outcomes — the runner never panics on a model that fails to produce schema-valid output.
Variants§
MissingResponseFormat
The request did not carry a
response_format.
InvalidSchema(String)
The schema supplied in the response format is not a valid JSON Schema.
NoStructuredOutput
The model produced no extractable structured value (no JSON text / no forced tool call).
ProviderOutcome(String)
The provider returned a non-success outcome (rate limit, server error, invalid request).
RetriesExhausted
The re-prompt budget was exhausted and the latest output still failed schema validation. Carries the final validation errors and the last candidate value for diagnostics.
Fields
Transport(Error)
A transport-level error bubbled up from the provider.
Trait Implementations§
Source§impl Debug for StructuredOutputError
impl Debug for StructuredOutputError
Source§impl Display for StructuredOutputError
impl Display for StructuredOutputError
Source§impl Error for StructuredOutputError
impl Error for StructuredOutputError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for StructuredOutputError
impl From<Error> for StructuredOutputError
Source§fn from(source: Error) -> StructuredOutputError
fn from(source: Error) -> StructuredOutputError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StructuredOutputError
impl RefUnwindSafe for StructuredOutputError
impl Send for StructuredOutputError
impl Sync for StructuredOutputError
impl Unpin for StructuredOutputError
impl UnsafeUnpin for StructuredOutputError
impl UnwindSafe for StructuredOutputError
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