pub struct NoopReflector;Expand description
A no-op reflector that marks everything as non-recoverable.
Useful as a safe default when reflection is disabled, or as a base for building composite reflectors via the decorator pattern.
§Example
ⓘ
let reflector = NoopReflector;
let context = ReflectionContext {
task: "test".to_string(),
attempt: 0,
max_attempts: 3,
};
let analysis = reflector
.analyze("error", "tool", &json!({}), None, &context)
.await
.unwrap();
assert!(!analysis.is_recoverable);Trait Implementations§
Source§impl Debug for NoopReflector
impl Debug for NoopReflector
Source§impl Reflector for NoopReflector
impl Reflector for NoopReflector
Source§fn analyze(
&self,
error: &str,
_tool_name: &str,
_tool_input: &Value,
_tool_schema: Option<&ToolSchema>,
_context: &ReflectionContext,
) -> Pin<Box<dyn Future<Output = Result<FailureAnalysis, ReflectionError>> + Send + '_>>
fn analyze( &self, error: &str, _tool_name: &str, _tool_input: &Value, _tool_schema: Option<&ToolSchema>, _context: &ReflectionContext, ) -> Pin<Box<dyn Future<Output = Result<FailureAnalysis, ReflectionError>> + Send + '_>>
Analyse a failed tool call. Read more
Auto Trait Implementations§
impl Freeze for NoopReflector
impl RefUnwindSafe for NoopReflector
impl Send for NoopReflector
impl Sync for NoopReflector
impl Unpin for NoopReflector
impl UnsafeUnpin for NoopReflector
impl UnwindSafe for NoopReflector
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