pub struct JsonEventLayer { /* private fields */ }Expand description
RuntimeLayer that forwards tool events to a JsonEventSink.
Implementations§
Source§impl JsonEventLayer
impl JsonEventLayer
Sourcepub fn new(sink: Arc<JsonEventSink>) -> Self
pub fn new(sink: Arc<JsonEventSink>) -> Self
Create a new layer sharing sink with JsonCliChannel.
Trait Implementations§
Source§impl RuntimeLayer for JsonEventLayer
impl RuntimeLayer for JsonEventLayer
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).
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).
Auto Trait Implementations§
impl Freeze for JsonEventLayer
impl RefUnwindSafe for JsonEventLayer
impl Send for JsonEventLayer
impl Sync for JsonEventLayer
impl Unpin for JsonEventLayer
impl UnsafeUnpin for JsonEventLayer
impl UnwindSafe for JsonEventLayer
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