#[non_exhaustive]pub struct MessageAddedEvent<'a> { /* private fields */ }Expand description
The framework added a message to the history (MessageAddedEvent).
Implementations§
Source§impl<'a> MessageAddedEvent<'a>
impl<'a> MessageAddedEvent<'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.
Trait Implementations§
Source§impl Debug for MessageAddedEvent<'_>
impl Debug for MessageAddedEvent<'_>
Source§impl From<&MessageAddedEvent<'_>> for MessageAddedEventData
impl From<&MessageAddedEvent<'_>> for MessageAddedEventData
Source§fn from(event: &MessageAddedEvent<'_>) -> Self
fn from(event: &MessageAddedEvent<'_>) -> Self
Converts to this type from the input type.
Source§impl From<&MessageAddedEvent<'_>> for AgentStreamEvent
impl From<&MessageAddedEvent<'_>> for AgentStreamEvent
Source§fn from(event: &MessageAddedEvent<'_>) -> Self
fn from(event: &MessageAddedEvent<'_>) -> Self
Converts to this type from the input type.
Source§impl HookEvent for MessageAddedEvent<'static>
impl HookEvent for MessageAddedEvent<'static>
Source§type Event<'a> = MessageAddedEvent<'a>
type Event<'a> = MessageAddedEvent<'a>
The event type for an agent borrow of lifetime
'a.impl<H> IntoHookImpl<MessageAddedEvent<'static>> for Hwhere
H: for<'a> Hook<MessageAddedEvent<'a>>,
impl<F, R> IntoSyncHook<MessageAddedEvent<'static>> for F
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MessageAddedEvent<'a>
impl<'a> !UnwindSafe for MessageAddedEvent<'a>
impl<'a> Freeze for MessageAddedEvent<'a>
impl<'a> Send for MessageAddedEvent<'a>
impl<'a> Sync for MessageAddedEvent<'a>
impl<'a> Unpin for MessageAddedEvent<'a>
impl<'a> UnsafeUnpin for MessageAddedEvent<'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.