Skip to main content

ModelResponseError

Enum ModelResponseError 

Source
#[non_exhaustive]
pub enum ModelResponseError {
Show 26 variants TooManyOutputItems { max: usize, observed: usize, }, TooManyContentItems { max: usize, observed: usize, }, TooManyToolCalls { max: usize, observed: usize, }, InvalidOutputItem { index: usize, error: ModelOutputItemError, }, DuplicateProviderToolCallId, InlinePayloadBytesOverflow, InlinePayloadTooLarge { maximum: ByteCount, observed: ByteCount, }, ToolCallsFinishRequiresProposal, ProviderReplayWithoutToolCalls, FinishForbidsToolCalls { finish_reason: ModelFinishReason, tool_calls: ExecutionCount, }, UnsupportedArtifactModality { index: usize, modality: ArtifactModality, }, ModelIdentityMismatch { expected: Box<CapabilityIdentity>, actual: Box<CapabilityIdentity>, }, InputUsageExceedsRequest { maximum: TokenCount, actual: TokenCount, }, OutputUsageExceedsRequest { maximum: TokenCount, actual: TokenCount, }, OutputModalityNotRequested { index: usize, modality: ModelModality, }, ReasoningSummaryNotRequested { index: usize, }, ToolCallsExceedRequest { maximum: ExecutionCount, actual: ExecutionCount, }, ToolNotRequested { index: usize, tool: Box<CapabilityIdentity>, }, ToolIdentityMismatch { index: usize, expected: Box<CapabilityIdentity>, actual: Box<CapabilityIdentity>, }, SpecificToolMismatch { index: usize, expected: CapabilityName, actual: CapabilityName, }, RequiredToolCallMissing, PlainTextCompletionContainsJson { index: usize, }, StructuredCompletionContainsText { index: usize, }, StructuredCompletionJsonCount { actual: usize, }, UnexpectedOutputSchema { index: usize, }, OutputSchemaMismatch { index: usize, expected: Box<SchemaReference>, actual: Option<Box<SchemaReference>>, },
}
Expand description

Invalid provider-neutral model response.

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.
§

TooManyOutputItems

The ordered output exceeded its total hard ceiling.

Fields

§max: usize

Immutable v1 maximum.

§observed: usize

Minimum count observed before validation stopped.

§

TooManyContentItems

User-visible content plus summaries exceeded their hard ceiling.

Fields

§max: usize

Immutable v1 maximum.

§observed: usize

Minimum count observed before validation stopped.

§

TooManyToolCalls

Tool proposals exceeded their hard ceiling.

Fields

§max: usize

Immutable v1 maximum.

§observed: usize

Minimum count observed before validation stopped.

§

InvalidOutputItem

An ordered item carried invalid intrinsic metadata.

Fields

§index: usize

Zero-based provider-order index.

§error: ModelOutputItemError

Intrinsic item validation failure.

§

DuplicateProviderToolCallId

Two proposals carried the same present provider correlation identifier.

§

InlinePayloadBytesOverflow

Inline payload accounting could not be represented.

§

InlinePayloadTooLarge

Aggregate retained inline payload exceeded the hard ceiling.

Fields

§maximum: ByteCount

Immutable v1 maximum.

§observed: ByteCount

First observed aggregate beyond the maximum.

§

ToolCallsFinishRequiresProposal

A tool-call terminal state had no complete proposal.

§

ProviderReplayWithoutToolCalls

Replay evidence was attached to a response that needs no tool continuation.

§

FinishForbidsToolCalls

A non-tool terminal state carried executable proposals.

Fields

§finish_reason: ModelFinishReason

Rejected portable terminal state.

§tool_calls: ExecutionCount

Number of complete proposals present.

§

UnsupportedArtifactModality

An output artifact had no portable model modality.

Fields

§index: usize

Zero-based provider-order index.

§modality: ArtifactModality

Rejected artifact modality.

§

ModelIdentityMismatch

The response claimed a different stable model binding.

Fields

§expected: Box<CapabilityIdentity>

Exact immutable descriptor identity.

§actual: Box<CapabilityIdentity>

Rejected response claim.

§

InputUsageExceedsRequest

Provider input accounting exceeded the request ceiling.

Fields

§maximum: TokenCount

Request input-token ceiling.

§actual: TokenCount

Provider-reported normalized input.

§

OutputUsageExceedsRequest

Provider output accounting exceeded the request ceiling.

Fields

§maximum: TokenCount

Request generated-output ceiling.

§actual: TokenCount

Provider-reported normalized output.

§

OutputModalityNotRequested

A user-visible output modality was not requested.

Fields

§index: usize

Zero-based provider-order index.

§modality: ModelModality

Unrequested modality.

§

ReasoningSummaryNotRequested

A reasoning summary was returned without explicit opt-in.

Fields

§index: usize

Zero-based provider-order index.

§

ToolCallsExceedRequest

Tool-call count exceeded the request-specific ceiling.

Fields

§maximum: ExecutionCount

Request-specific call ceiling.

§actual: ExecutionCount

Complete proposal count.

§

ToolNotRequested

A proposal named no tool in the request snapshot.

Fields

§index: usize

Zero-based provider-order index.

§tool: Box<CapabilityIdentity>

Rejected identity claim.

§

ToolIdentityMismatch

A proposal reused a requested name with a different owner or version.

Fields

§index: usize

Zero-based provider-order index.

§expected: Box<CapabilityIdentity>

Exact identity from the request snapshot.

§actual: Box<CapabilityIdentity>

Rejected model claim.

§

SpecificToolMismatch

A specific-tool request received a different proposed name.

Fields

§index: usize

Zero-based provider-order index.

§expected: CapabilityName

Requested exact tool name.

§actual: CapabilityName

Rejected proposed name.

§

RequiredToolCallMissing

A nominal completion violated required or specific tool selection.

§

PlainTextCompletionContainsJson

A nominal plain-text completion returned typed JSON content.

Fields

§index: usize

Zero-based provider-order index.

§

StructuredCompletionContainsText

A nominal structured completion returned text or a text artifact.

Fields

§index: usize

Zero-based provider-order index.

§

StructuredCompletionJsonCount

A nominal structured completion did not contain exactly one JSON value.

Fields

§actual: usize

Observed typed JSON item count.

§

UnexpectedOutputSchema

Generic JSON output asserted an unrequested schema binding.

Fields

§index: usize

Zero-based provider-order index.

§

OutputSchemaMismatch

Schema-constrained output did not retain the exact requested binding.

Fields

§index: usize

Zero-based provider-order index.

§expected: Box<SchemaReference>

Exact digest-pinned requested schema.

§actual: Option<Box<SchemaReference>>

Missing or different response claim.

Trait Implementations§

Source§

impl Clone for ModelResponseError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ModelResponseError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ModelResponseError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ModelResponseError

Source§

impl Error for ModelResponseError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for ModelResponseError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ModelResponseError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.