pub struct NoopLayer;Expand description
No-op layer that passes everything through unchanged.
Useful as a placeholder, for testing, or as a base for custom layers that only need to override a subset of hooks.
Trait Implementations§
Source§impl RuntimeLayer for NoopLayer
impl RuntimeLayer for NoopLayer
Source§fn before_chat<'a>(
&'a self,
_ctx: &'a LayerContext<'_>,
_messages: &'a [Message],
_tools: &'a [ToolDefinition],
) -> Pin<Box<dyn Future<Output = Option<ChatResponse>> + Send + 'a>>
fn before_chat<'a>( &'a self, _ctx: &'a LayerContext<'_>, _messages: &'a [Message], _tools: &'a [ToolDefinition], ) -> Pin<Box<dyn Future<Output = Option<ChatResponse>> + Send + 'a>>
Called before an LLM chat call. Read more
Source§fn after_chat<'a>(
&'a self,
_ctx: &'a LayerContext<'_>,
_response: &'a ChatResponse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
fn after_chat<'a>( &'a self, _ctx: &'a LayerContext<'_>, _response: &'a ChatResponse, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
Called after an LLM chat call completes (or was short-circuited).
Source§fn before_tool<'a>(
&'a self,
_ctx: &'a LayerContext<'_>,
_call: &'a ToolCall,
) -> Pin<Box<dyn Future<Output = BeforeToolResult> + Send + 'a>>
fn before_tool<'a>( &'a self, _ctx: &'a LayerContext<'_>, _call: &'a ToolCall, ) -> Pin<Box<dyn Future<Output = BeforeToolResult> + Send + 'a>>
Called before tool execution. Read more
Source§fn after_tool<'a>(
&'a self,
_ctx: &'a LayerContext<'_>,
_call: &'a ToolCall,
_result: &'a Result<Option<ToolOutput>, ToolError>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
fn after_tool<'a>( &'a self, _ctx: &'a LayerContext<'_>, _call: &'a ToolCall, _result: &'a Result<Option<ToolOutput>, ToolError>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'a>>
Called after tool execution completes (or was short-circuited).
Auto Trait Implementations§
impl Freeze for NoopLayer
impl RefUnwindSafe for NoopLayer
impl Send for NoopLayer
impl Sync for NoopLayer
impl Unpin for NoopLayer
impl UnsafeUnpin for NoopLayer
impl UnwindSafe for NoopLayer
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request