Skip to main content

CallToolMessageAgent

Struct CallToolMessageAgent 

Source
pub struct CallToolMessageAgent { /* private fields */ }
Expand description

Agent that processes tool calls from LLM messages.

When an LLM response contains tool calls, this agent executes them and outputs the results as tool response messages. Consecutive calls to tools registered with ExecutionMode::Parallel run concurrently (bounded by max_concurrency); calls to Sequential tools — the default — run one at a time and act as barriers. Results are emitted in input order.

§Configuration

  • tools - Optional regex patterns to filter which tools can be called
  • max_concurrency - Maximum number of Parallel-mode tool calls in flight at once; values below 1 are treated as 1 (default: 8)

§Ports

  • Input message - LLM message that may contain tool calls
  • Output message - Tool response messages (one per tool call)

Implementations§

Source§

impl CallToolMessageAgent

Source

pub const DEF_NAME: &'static str = "modular_agent_core::tool::CallToolMessageAgent"

Source

pub fn def_name() -> &'static str

Source

pub fn agent_definition() -> AgentDefinition

Source

pub fn register(ma: &ModularAgent)

Trait Implementations§

Source§

impl AsAgent for CallToolMessageAgent

Source§

fn new( ma: ModularAgent, id: String, spec: AgentSpec, ) -> Result<Self, AgentError>

Constructs a new agent instance.
Source§

fn stop<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when the agent stops. Read more
Source§

fn process<'life0, 'async_trait>( &'life0 mut self, ctx: AgentContext, _port: String, value: AgentValue, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Processes an input message. Read more
Source§

fn configs_changed(&mut self) -> Result<(), AgentError>

Called when configuration values change. Read more
Source§

fn start<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called when the agent starts. Read more
Source§

impl HasAgentData for CallToolMessageAgent

Source§

fn data(&self) -> &AgentData

Source§

fn mut_data(&mut self) -> &mut AgentData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: FloatComponent, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
Source§

impl<T> Agent for T
where T: AsAgent,

Source§

fn new(ma: ModularAgent, id: String, spec: AgentSpec) -> Result<T, AgentError>

Constructs a new agent instance.
Source§

fn ma(&self) -> &ModularAgent

Returns the ModularAgent.
Source§

fn id(&self) -> &str

Returns the unique agent ID.
Source§

fn spec(&self) -> &AgentSpec

Returns the agent specification.
Source§

fn update_spec(&mut self, value: &Value) -> Result<(), AgentError>

Updates the agent specification.
Source§

fn status(&self) -> &AgentStatus

Returns the current lifecycle status.
Source§

fn def_name(&self) -> &str

Returns the agent definition name.
Source§

fn configs(&self) -> Result<&AgentConfigs, AgentError>

Returns the agent’s configuration. Read more
Source§

fn set_config( &mut self, key: String, value: AgentValue, ) -> Result<(), AgentError>

Sets a configuration value.
Source§

fn set_configs(&mut self, configs: AgentConfigs) -> Result<(), AgentError>

Sets the entire configuration.
Source§

fn preset_id(&self) -> &str

Returns the preset ID this agent belongs to.
Source§

fn set_preset_id(&mut self, preset_id: String)

Sets the preset ID.
Source§

fn start<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Starts the agent. Read more
Source§

fn stop<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Stops the agent.
Source§

fn process<'life0, 'async_trait>( &'life0 mut self, ctx: AgentContext, port: String, value: AgentValue, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Processes an input message. Read more
Source§

fn get_global_configs(&self) -> Option<AgentConfigs>

Gets global configuration for this agent.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

fn runtime(&self) -> &Runtime

Returns the tokio runtime.
Source§

impl<T> AgentOutput for T
where T: Agent,

Source§

fn output_raw( &self, ctx: AgentContext, port: String, value: AgentValue, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + '_>>

Sends a value to an output port asynchronously (raw version with String port). Read more
Source§

fn try_output_raw( &self, ctx: AgentContext, port: String, value: AgentValue, ) -> Result<(), AgentError>

Tries to send a value to an output port without blocking (raw version). Read more
Source§

fn emit_config_updated_raw(&self, key: String, value: AgentValue)

Emits a configuration update event (raw version with String key).
Source§

fn emit_agent_spec_updated_raw(&self)

Emits an agent spec update event (raw version).
Source§

fn emit_error_raw(&self, message: String)

Emits an error event (raw version with String message).
Source§

fn output<S: Into<String>>( &self, ctx: AgentContext, port: S, value: AgentValue, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + '_>>

Sends a value to an output port asynchronously. Read more
Source§

fn try_output<S: Into<String>>( &self, ctx: AgentContext, port: S, value: AgentValue, ) -> Result<(), AgentError>

Tries to send a value to an output port without blocking.
Source§

fn emit_config_updated<S: Into<String>>(&self, key: S, value: AgentValue)

Emits a configuration update event. Read more
Source§

fn emit_agent_spec_updated(&self)

Emits an agent spec update event. Read more
Source§

fn emit_error<S: Into<String>>(&self, message: S)

Emits an error event. Read more
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
Source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

Source§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
Source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, Dst> ConvAsUtil<Dst> for T

Source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
Source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
Source§

impl<T> ConvUtil for T

Source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
Source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
Source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
Source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
Source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Source§

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Source§

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Source§

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<Src> TryFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Source§

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<Src> ValueFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
Source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

Source§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more