pub enum StructuredOutputError {
Stream(Error),
Parse {
error: String,
raw: String,
attempts: u32,
},
MaxRetriesExceeded {
max_retries: u32,
last_error: String,
},
}Expand description
Failure modes for a structured-output LLM call.
Produced by gglib_agent::structured_output::get_structured when the
LLM cannot produce a valid JSON response within the allowed retry budget.
Variants§
Stream(Error)
The underlying super::LlmCompletionPort::chat_stream call failed
before any response was collected.
Parse
The LLM produced output but it could not be parsed as valid JSON (or as the expected type). Includes the raw text and the number of attempts made so far.
Fields
MaxRetriesExceeded
All max_retries + 1 attempts were exhausted without a successful
parse. The last parse error is included for diagnostics.
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()
Auto Trait Implementations§
impl Freeze for StructuredOutputError
impl RefUnwindSafe for StructuredOutputError
impl Send for StructuredOutputError
impl Sync for StructuredOutputError
impl Unpin 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