pub enum ToolBinding {
Client {
resolver: Arc<dyn ToolResourceResolver>,
executor: Arc<dyn ToolExecutor>,
},
Hosted {
options: HostedToolOptions,
},
Hybrid {
options: HostedToolOptions,
resolver: Arc<dyn ToolResourceResolver>,
executor: Arc<dyn ToolExecutor>,
preference: ToolRoutePreference,
},
}Expand description
Complete executable binding associated with one portable ToolSpec.
Variants§
Client
A function tool resolved and executed by the client runtime.
Fields
resolver: Arc<dyn ToolResourceResolver>Resource resolver used before policy evaluation.
executor: Arc<dyn ToolExecutor>Local executor invoked after policy approval.
Hosted
A tool executed entirely inside a capable model provider.
Fields
options: HostedToolOptionsProvider-neutral hosted tool kind and common policy.
Hybrid
A tool with both provider-hosted and real client execution routes.
Fields
options: HostedToolOptionsProvider-neutral hosted tool kind and common policy.
resolver: Arc<dyn ToolResourceResolver>Resource resolver for the client fallback.
executor: Arc<dyn ToolExecutor>Executor for the client fallback.
preference: ToolRoutePreferenceRoute preference applied when freezing a model request.
Implementations§
Source§impl ToolBinding
impl ToolBinding
Sourcepub fn client(
resolver: Arc<dyn ToolResourceResolver>,
executor: Arc<dyn ToolExecutor>,
) -> Self
pub fn client( resolver: Arc<dyn ToolResourceResolver>, executor: Arc<dyn ToolExecutor>, ) -> Self
Creates a client-only binding.
Sourcepub const fn hosted(options: HostedToolOptions) -> Self
pub const fn hosted(options: HostedToolOptions) -> Self
Creates a provider-hosted-only binding.
Sourcepub fn hybrid(
options: HostedToolOptions,
preference: ToolRoutePreference,
resolver: Arc<dyn ToolResourceResolver>,
executor: Arc<dyn ToolExecutor>,
) -> Self
pub fn hybrid( options: HostedToolOptions, preference: ToolRoutePreference, resolver: Arc<dyn ToolResourceResolver>, executor: Arc<dyn ToolExecutor>, ) -> Self
Creates a binding with hosted and client routes.
Sourcepub const fn has_client_execution(&self) -> bool
pub const fn has_client_execution(&self) -> bool
Returns whether this binding has a real client execution route.
Trait Implementations§
Source§impl Clone for ToolBinding
impl Clone for ToolBinding
Source§fn clone(&self) -> ToolBinding
fn clone(&self) -> ToolBinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more