#[non_exhaustive]pub struct TurnFailure {
pub kind: FailureKind,
pub retryable: bool,
pub retry_after_ms: Option<u64>,
pub side_effects: bool,
pub message: String,
}Expand description
A turn’s failure, as the engine, the pool and the wire all carry it.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: FailureKind§retryable: bool§retry_after_ms: Option<u64>How long the provider asked to be left alone, when it said — also past what the client’s backoff was willing to wait.
side_effects: boolA tool already ran in this turn, so sending it again repeats that.
message: StringImplementations§
Source§impl TurnFailure
impl TurnFailure
pub fn new(kind: FailureKind, message: impl Into<String>) -> Self
pub fn model(error: &ModelError, side_effects: bool) -> Self
pub fn with_side_effects(self, side_effects: bool) -> Self
Trait Implementations§
Source§impl Clone for TurnFailure
impl Clone for TurnFailure
Source§impl Debug for TurnFailure
impl Debug for TurnFailure
Source§impl<'de> Deserialize<'de> for TurnFailure
impl<'de> Deserialize<'de> for TurnFailure
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TurnFailure
impl Display for TurnFailure
impl Eq for TurnFailure
Source§impl Error for TurnFailure
impl Error for TurnFailure
1.30.0 · 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 JsonSchema for TurnFailure
impl JsonSchema for TurnFailure
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for TurnFailure
impl PartialEq for TurnFailure
Source§impl Serialize for TurnFailure
impl Serialize for TurnFailure
impl StructuralPartialEq for TurnFailure
Auto Trait Implementations§
impl Forget for TurnFailure
impl Freeze for TurnFailure
impl Move for TurnFailure
impl RefUnwindSafe for TurnFailure
impl Send for TurnFailure
impl Sync for TurnFailure
impl Unpin for TurnFailure
impl UnsafeUnpin for TurnFailure
impl UnwindSafe for TurnFailure
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