pub enum ModelRequestError {
Show 24 variants
EmptyMessages,
TooManyMessages,
InvalidMessage,
InvalidSystemPrompt,
InvalidToolName,
InvalidToolDescription,
InvalidWebSearchDomain,
TooManyWebSearchDomains,
ConflictingWebSearchDomainFilters,
InvalidWebSearchLocation,
ToolSchemaMustBeObject,
ToolSchemaMustDeclareObject,
ToolSchemaOutOfBounds,
TooManyTools,
DuplicateToolName,
ModelMismatch,
ImageInputUnsupported,
ReasoningUnsupported,
ReasoningEffortUnsupported,
ToolsUnsupported,
ParallelToolsUnsupported,
HostedToolUnsupported,
OutputLimitUnsupported,
ReasoningBudgetUnsupported,
}Expand description
Error returned when building or validating a model request.
Variants§
EmptyMessages
At least one canonical message is required.
TooManyMessages
The canonical message count exceeds the request limit.
InvalidMessage
A message fails its protocol wire invariant.
InvalidSystemPrompt
System prompt is empty, oversized, or contains a null character.
InvalidToolName
Tool name is not canonical.
InvalidToolDescription
Tool description is empty, oversized, or contains a null character.
InvalidWebSearchDomain
A portable web-search domain is invalid.
TooManyWebSearchDomains
A portable web-search policy exceeds the domain limit.
ConflictingWebSearchDomainFilters
Portable allow and block domain policies cannot be combined.
InvalidWebSearchLocation
An approximate web-search location field is invalid.
ToolSchemaMustBeObject
Tool schema root must be a JSON object value.
ToolSchemaMustDeclareObject
Tool schema must explicitly declare type: object.
ToolSchemaOutOfBounds
Tool schema exceeds encoded-byte or nesting limits.
TooManyTools
Request contains too many tool definitions.
DuplicateToolName
Request contains duplicate tool names.
ModelMismatch
Request selects a different model than the specification.
ImageInputUnsupported
Request includes an image but model accepts text only.
ReasoningUnsupported
Request asks for reasoning from a model without reasoning support.
ReasoningEffortUnsupported
Request asks for an effort not supported by the selected model.
ToolsUnsupported
Request includes tools for a model without tool support.
ParallelToolsUnsupported
Request allows parallel tools for a serial-tool model.
HostedToolUnsupported
Request contains a hosted tool unsupported by the selected model.
OutputLimitUnsupported
Request output limit is zero or exceeds the model limit.
ReasoningBudgetUnsupported
Reasoning budget is zero or exceeds the selected output limit.
Trait Implementations§
Source§impl Clone for ModelRequestError
impl Clone for ModelRequestError
Source§fn clone(&self) -> ModelRequestError
fn clone(&self) -> ModelRequestError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ModelRequestError
Source§impl Debug for ModelRequestError
impl Debug for ModelRequestError
Source§impl Display for ModelRequestError
impl Display for ModelRequestError
impl Eq for ModelRequestError
Source§impl Error for ModelRequestError
impl Error for ModelRequestError
1.30.0 · 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()