pub enum ModelError {
Show 15 variants
Request(Box<dyn Error + Send + Sync>),
InvalidResponse,
IncompleteResponse {
reason: String,
},
ResponseBodyTooLarge,
UnsupportedOutputSchema {
reason: String,
},
ResponseContentTooLarge,
InvalidJson {
reason: String,
},
SchemaViolation {
path: String,
reason: String,
},
MissingToolCall,
MultipleToolCalls,
ToolCallWithContent,
TerminalResponseWithToolCalls,
UnsupportedToolType {
kind: String,
},
UnsupportedToolName {
name: String,
},
InvalidToolArguments {
reason: String,
},
}Expand description
Failure returned while completing a model request.
Variants§
Request(Box<dyn Error + Send + Sync>)
The provider request or response decoding failed.
InvalidResponse
The provider returned a successful response without assistant content.
IncompleteResponse
The provider stopped before completing the model response.
ResponseBodyTooLarge
The successful provider response body exceeds the adapter safety limit.
UnsupportedOutputSchema
The provider cannot represent the requested output schema.
ResponseContentTooLarge
The decoded provider response content exceeds the harness safety limit.
InvalidJson
The provider returned malformed JSON for a structured request.
SchemaViolation
The returned JSON does not conform to the requested schema.
Fields
MissingToolCall
The provider returned tool calls without any call entries.
MultipleToolCalls
The provider returned more than the single supported call.
ToolCallWithContent
A tool-call response also contained terminal assistant content.
TerminalResponseWithToolCalls
A terminal response also contained native tool calls.
UnsupportedToolType
The provider returned an unsupported tool-call type.
UnsupportedToolName
The provider returned an unsupported or unadvertised native function.
InvalidToolArguments
The provider returned malformed or invalid native function arguments.
Implementations§
Trait Implementations§
Source§impl Debug for ModelError
impl Debug for ModelError
Source§impl Display for ModelError
impl Display for ModelError
Source§impl Error for ModelError
impl Error for ModelError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()