pub enum PromptError {
CompletionError(CompletionError),
MemoryError(MemoryError),
MaxTurnsError {
max_turns: usize,
chat_history: Box<Vec<Message>>,
prompt: Box<Message>,
},
PromptCancelled {
chat_history: Vec<Message>,
reason: String,
},
UnknownToolCall {
tool_name: String,
available_tools: Vec<String>,
allowed_tools: Vec<String>,
chat_history: Box<Vec<Message>>,
},
}Expand description
Errors from classic agent prompting.
Variants§
CompletionError(CompletionError)
A provider completion failed.
MemoryError(MemoryError)
Conversation memory failed to load or persist history.
MaxTurnsError
The run exhausted its total model-call budget.
Fields
PromptCancelled
A prompting loop was cancelled.
Fields
UnknownToolCall
The model attempted to call a tool unavailable for the current turn.
Implementations§
Source§impl PromptError
impl PromptError
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 completion 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 completion 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 completion error (rig#2314).
Sourcepub fn provider_response_status(&self) -> Option<StatusCode>
pub fn provider_response_status(&self) -> Option<StatusCode>
Returns the HTTP status exposed by a wrapped completion error.
Sourcepub fn provider_response_headers(&self) -> Option<&HeaderMap>
pub fn provider_response_headers(&self) -> Option<&HeaderMap>
Returns the response headers exposed by a wrapped completion error — e.g. Retry-After on a 429 (rig#2210).
Trait Implementations§
Source§impl Debug for PromptError
impl Debug for PromptError
Source§impl Display for PromptError
impl Display for PromptError
Source§impl Error for PromptError
impl Error for PromptError
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()
Source§impl From<Box<PromptError>> for StreamingError
impl From<Box<PromptError>> for StreamingError
Source§fn from(source: Box<PromptError>) -> Self
fn from(source: Box<PromptError>) -> Self
Source§impl From<Box<PromptError>> for StructuredOutputError
impl From<Box<PromptError>> for StructuredOutputError
Source§fn from(source: Box<PromptError>) -> Self
fn from(source: Box<PromptError>) -> Self
Source§impl From<CompletionError> for PromptError
impl From<CompletionError> for PromptError
Source§fn from(source: CompletionError) -> Self
fn from(source: CompletionError) -> Self
Source§impl From<MemoryError> for PromptError
impl From<MemoryError> for PromptError
Source§fn from(source: MemoryError) -> Self
fn from(source: MemoryError) -> Self
Source§impl From<PromptError> for ExtractionError
impl From<PromptError> for ExtractionError
Source§fn from(source: PromptError) -> Self
fn from(source: PromptError) -> Self
Source§impl From<PromptError> for ScenarioError
Available on crate feature test-utils only.
impl From<PromptError> for ScenarioError
test-utils only.Source§fn from(source: PromptError) -> Self
fn from(source: PromptError) -> Self
Auto Trait Implementations§
impl !Freeze for PromptError
impl !RefUnwindSafe for PromptError
impl !UnwindSafe for PromptError
impl Send for PromptError
impl Sync for PromptError
impl Unpin for PromptError
impl UnsafeUnpin for PromptError
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
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.