#[non_exhaustive]pub struct ContentBlockEvent<'a> { /* private fields */ }Expand description
A content block the model finished (ContentBlockEvent).
Implementations§
Source§impl<'a> ContentBlockEvent<'a>
impl<'a> ContentBlockEvent<'a>
Sourcepub fn agent(&self) -> &LocalAgent
pub fn agent(&self) -> &LocalAgent
The agent.
Sourcepub fn agent_mut(&mut self) -> &mut LocalAgent
pub fn agent_mut(&mut self) -> &mut LocalAgent
The agent, mutably: hooks may change its messages, system prompt, tools and state.
Sourcepub fn invocation_state(&self) -> &InvocationState
pub fn invocation_state(&self) -> &InvocationState
The caller’s per-invocation state.
Sourcepub fn invocation_context(&self) -> Option<&InvocationContext>
pub fn invocation_context(&self) -> Option<&InvocationContext>
The request this event belongs to.
Source§impl<'a> ContentBlockEvent<'a>
impl<'a> ContentBlockEvent<'a>
Sourcepub fn content_block(&self) -> &ContentBlock
pub fn content_block(&self) -> &ContentBlock
The finished block.
Trait Implementations§
Source§impl Debug for ContentBlockEvent<'_>
impl Debug for ContentBlockEvent<'_>
Source§impl From<&ContentBlockEvent<'_>> for ContentBlockEventData
impl From<&ContentBlockEvent<'_>> for ContentBlockEventData
Source§fn from(event: &ContentBlockEvent<'_>) -> Self
fn from(event: &ContentBlockEvent<'_>) -> Self
Converts to this type from the input type.
Source§impl From<&ContentBlockEvent<'_>> for AgentStreamEvent
impl From<&ContentBlockEvent<'_>> for AgentStreamEvent
Source§fn from(event: &ContentBlockEvent<'_>) -> Self
fn from(event: &ContentBlockEvent<'_>) -> Self
Converts to this type from the input type.
Source§impl HookEvent for ContentBlockEvent<'static>
impl HookEvent for ContentBlockEvent<'static>
Source§type Event<'a> = ContentBlockEvent<'a>
type Event<'a> = ContentBlockEvent<'a>
The event type for an agent borrow of lifetime
'a.impl<H> IntoHookImpl<ContentBlockEvent<'static>> for Hwhere
H: for<'a> Hook<ContentBlockEvent<'a>>,
impl<F, R> IntoSyncHook<ContentBlockEvent<'static>> for F
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ContentBlockEvent<'a>
impl<'a> !UnwindSafe for ContentBlockEvent<'a>
impl<'a> Freeze for ContentBlockEvent<'a>
impl<'a> Send for ContentBlockEvent<'a>
impl<'a> Sync for ContentBlockEvent<'a>
impl<'a> Unpin for ContentBlockEvent<'a>
impl<'a> UnsafeUnpin for ContentBlockEvent<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreCreates a shared type from an unshared type.