#[non_exhaustive]pub enum ScenarioError {
Prompt(PromptError),
Completion(CompletionError),
Streaming(StreamingError),
Json(Error),
Extraction(ExtractionError),
Contract {
scenario: &'static str,
details: String,
},
}Available on crate feature
test-utils only.Expand description
Typed failure from a portable model-conformance scenario.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Prompt(PromptError)
A buffered agent run failed.
Completion(CompletionError)
A direct model completion failed.
Streaming(StreamingError)
A streaming agent run failed.
Json(Error)
Structured content could not be decoded.
Extraction(ExtractionError)
Rig’s structured extractor failed.
Contract
The model or agent violated the portable behavioral contract.
Trait Implementations§
Source§impl Debug for ScenarioError
impl Debug for ScenarioError
Source§impl Display for ScenarioError
impl Display for ScenarioError
Source§impl Error for ScenarioError
impl Error for ScenarioError
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<CompletionError> for ScenarioError
impl From<CompletionError> for ScenarioError
Source§fn from(source: CompletionError) -> Self
fn from(source: CompletionError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for ScenarioError
impl From<Error> for ScenarioError
Source§impl From<ExtractionError> for ScenarioError
impl From<ExtractionError> for ScenarioError
Source§fn from(source: ExtractionError) -> Self
fn from(source: ExtractionError) -> Self
Converts to this type from the input type.
Source§impl From<PromptError> for ScenarioError
impl From<PromptError> for ScenarioError
Source§fn from(source: PromptError) -> Self
fn from(source: PromptError) -> Self
Converts to this type from the input type.
Source§impl From<StreamingError> for ScenarioError
impl From<StreamingError> for ScenarioError
Source§fn from(source: StreamingError) -> Self
fn from(source: StreamingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for ScenarioError
impl !RefUnwindSafe for ScenarioError
impl !UnwindSafe for ScenarioError
impl Send for ScenarioError
impl Sync for ScenarioError
impl Unpin for ScenarioError
impl UnsafeUnpin for ScenarioError
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
impl<T> DebuggableStorage for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.