pub enum StructuredOutputError {
Prompt(PromptError),
Deserialization {
output: String,
error: Error,
},
EmptyResponse,
}Expand description
Why a typed run produced no value.
Variants§
Prompt(PromptError)
The underlying run failed.
Deserialization
The accepted output did not deserialize into the requested type.
EmptyResponse
The model returned no accepted content.
Implementations§
Source§impl StructuredOutputError
impl StructuredOutputError
Sourcepub fn provider_response_body(&self) -> Option<&str>
pub fn provider_response_body(&self) -> Option<&str>
Returns the provider response body exposed by a wrapped prompt error.
Sourcepub fn provider_response_json(&self) -> Result<Option<Value>, Error>
pub fn provider_response_json(&self) -> Result<Option<Value>, Error>
Parses the provider response body of a wrapped prompt error as JSON when present.
Sourcepub fn provider_request_id(&self) -> Option<&str>
pub fn provider_request_id(&self) -> Option<&str>
Returns the provider transport request id exposed by a wrapped prompt error, or carried by a wire report.
Sourcepub fn provider_response_status(&self) -> Option<StatusCode>
pub fn provider_response_status(&self) -> Option<StatusCode>
Returns the HTTP status exposed by a wrapped prompt error, or carried by a wire report.
Sourcepub fn provider_response_headers(&self) -> Option<&HeaderMap>
pub fn provider_response_headers(&self) -> Option<&HeaderMap>
Returns the response headers exposed by a wrapped prompt error or report.
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<PromptError> for StructuredOutputError
impl From<PromptError> for StructuredOutputError
Source§fn from(source: PromptError) -> Self
fn from(source: PromptError) -> Self
Converts to this type from the input type.
Source§impl From<StructuredOutputError> for ScenarioError
Available on crate feature test-utils only.
impl From<StructuredOutputError> for ScenarioError
Available on crate feature
test-utils only.Source§fn from(source: StructuredOutputError) -> Self
fn from(source: StructuredOutputError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for StructuredOutputError
impl !UnwindSafe for StructuredOutputError
impl Forget for StructuredOutputError
impl Freeze for StructuredOutputError
impl Move for StructuredOutputError
impl Send for StructuredOutputError
impl Sync for StructuredOutputError
impl Unpin for StructuredOutputError
impl UnsafeUnpin 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