pub struct DefaultBackgroundTaskHandler { /* private fields */ }Expand description
Opt-in default message/send handler wired up by
[A2AServerBuilder::with_default_background_task_handler] /
[A2AServerBuilder::with_default_task_handlers].
When an Agent is configured, delegates to the inference gateway via a
single non-streaming generate_content call and returns the resulting
task with state == Completed and the reply attached. Without an agent,
returns the static [NO_AGENT_REPLY] message - processWithoutAgentBackground.
Implementations§
Source§impl DefaultBackgroundTaskHandler
impl DefaultBackgroundTaskHandler
pub fn new(agent: Option<Arc<Agent>>) -> Self
Sourcepub fn set_enable_usage_metadata(&mut self, enable: bool)
pub fn set_enable_usage_metadata(&mut self, enable: bool)
Override whether terminal tasks carry usage / execution_stats
metadata. A2AServerBuilder calls this to
honour AgentConfig::enable_usage_metadata.
Sourcepub fn is_usage_metadata_enabled(&self) -> bool
pub fn is_usage_metadata_enabled(&self) -> bool
Whether terminal tasks will carry usage/execution metadata.
Trait Implementations§
Source§impl Debug for DefaultBackgroundTaskHandler
impl Debug for DefaultBackgroundTaskHandler
Auto Trait Implementations§
impl !RefUnwindSafe for DefaultBackgroundTaskHandler
impl !UnwindSafe for DefaultBackgroundTaskHandler
impl Freeze for DefaultBackgroundTaskHandler
impl Send for DefaultBackgroundTaskHandler
impl Sync for DefaultBackgroundTaskHandler
impl Unpin for DefaultBackgroundTaskHandler
impl UnsafeUnpin for DefaultBackgroundTaskHandler
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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 more