ToolCompositeEntry

Enum ToolCompositeEntry 

Source
pub enum ToolCompositeEntry {
    Function(Arc<dyn ToolFunction>),
    BuiltIn(Tool),
    Agent {
        name: String,
        description: String,
        agent: Arc<dyn TextAgent>,
    },
    Mcp {
        params: String,
    },
    A2a {
        url: String,
        skill: String,
    },
    Mock {
        name: String,
        description: String,
        response: Value,
    },
    OpenApi {
        name: String,
        spec_url: String,
    },
    Search {
        name: String,
        description: String,
    },
    Schema {
        name: String,
        schema: Value,
    },
    Transform {
        inner: Box<ToolCompositeEntry>,
        transformer: Arc<dyn Fn(Value) -> Pin<Box<dyn Future<Output = Value> + Send>> + Send + Sync>,
    },
}
Expand description

An entry in a tool composite.

Variants§

§

Function(Arc<dyn ToolFunction>)

A runtime tool function.

§

BuiltIn(Tool)

A built-in Gemini tool declaration.

§

Agent

A text agent wrapped as a tool.

Fields

§name: String

Tool name exposed to the model.

§description: String

Tool description exposed to the model.

§agent: Arc<dyn TextAgent>

The text agent to invoke.

§

Mcp

An MCP (Model Context Protocol) toolset connection.

Fields

§params: String

Connection params (e.g. URL or command string).

§

A2a

A remote agent-to-agent tool.

Fields

§url: String

URL of the remote agent.

§skill: String

Skill to invoke on the remote agent.

§

Mock

A mock tool that returns a fixed response (useful for testing).

Fields

§name: String

Tool name.

§description: String

Tool description.

§response: Value

Fixed response to return.

§

OpenApi

An OpenAPI spec-driven tool (placeholder/marker).

Fields

§name: String

Tool name.

§spec_url: String

URL to the OpenAPI spec.

§

Search

A BM25 search tool (placeholder/marker).

Fields

§name: String

Tool name.

§description: String

Tool description.

§

Schema

A schema-defined tool (placeholder/marker).

Fields

§name: String

Tool name.

§schema: Value

JSON Schema defining the tool’s parameters.

§

Transform

A tool wrapped with a result transformer.

Fields

§inner: Box<ToolCompositeEntry>

The inner tool entry.

§transformer: Arc<dyn Fn(Value) -> Pin<Box<dyn Future<Output = Value> + Send>> + Send + Sync>

Transformer function applied to the tool result.

Trait Implementations§

Source§

impl Clone for ToolCompositeEntry

Source§

fn clone(&self) -> ToolCompositeEntry

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

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<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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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