pub struct ToolSafetyMetadata {Show 14 fields
pub read_only: bool,
pub concurrency_safe: bool,
pub operation: ToolOperationKind,
pub side_effect_level: ToolSideEffectLevel,
pub requires_network: bool,
pub destructive: bool,
pub open_world: bool,
pub host_dependent: bool,
pub requires_user_interaction: bool,
pub supports_cancellation: bool,
pub default_requires_approval: bool,
pub should_defer_schema: bool,
pub max_output_chars: Option<usize>,
pub max_result_size_chars: Option<usize>,
}Expand description
Static safety metadata attached to a tool registration.
Fields§
§read_only: boolTrue when the tool does not mutate local or external state.
concurrency_safe: boolTrue when calls can run concurrently without observable races.
operation: ToolOperationKindDefault operation category for this tool.
side_effect_level: ToolSideEffectLevelDefault side-effect level for this tool.
requires_network: boolTrue when the tool can access the network.
destructive: boolTrue when the tool can destroy or remove state.
open_world: boolTrue when the tool can reach open-ended external resources.
host_dependent: boolTrue when the tool requires a host-provided service.
requires_user_interaction: boolTrue when execution requires user interaction.
supports_cancellation: boolTrue when the executor can cancel the tool cooperatively.
default_requires_approval: boolTrue when policy should require approval unless explicitly allowed.
should_defer_schema: boolTrue when large schemas should be loaded lazily in future registry flows.
max_output_chars: Option<usize>Default maximum model-facing output characters.
max_result_size_chars: Option<usize>Default maximum stored result characters.
Implementations§
Source§impl ToolSafetyMetadata
impl ToolSafetyMetadata
Sourcepub fn conservative_unknown() -> ToolSafetyMetadata
pub fn conservative_unknown() -> ToolSafetyMetadata
Returns fail-closed metadata for tools that do not declare safety details.
Sourcepub fn read_only(operation: ToolOperationKind) -> ToolSafetyMetadata
pub fn read_only(operation: ToolOperationKind) -> ToolSafetyMetadata
Returns metadata for a read-only tool with the given operation kind.
Sourcepub fn compute() -> ToolSafetyMetadata
pub fn compute() -> ToolSafetyMetadata
Returns metadata for deterministic or local compute tools.
Trait Implementations§
Source§impl Clone for ToolSafetyMetadata
impl Clone for ToolSafetyMetadata
Source§fn clone(&self) -> ToolSafetyMetadata
fn clone(&self) -> ToolSafetyMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolSafetyMetadata
impl Debug for ToolSafetyMetadata
Source§impl Default for ToolSafetyMetadata
impl Default for ToolSafetyMetadata
Source§fn default() -> ToolSafetyMetadata
fn default() -> ToolSafetyMetadata
Source§impl<'de> Deserialize<'de> for ToolSafetyMetadata
impl<'de> Deserialize<'de> for ToolSafetyMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolSafetyMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolSafetyMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ToolSafetyMetadata
impl Serialize for ToolSafetyMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ToolSafetyMetadata
impl RefUnwindSafe for ToolSafetyMetadata
impl Send for ToolSafetyMetadata
impl Sync for ToolSafetyMetadata
impl Unpin for ToolSafetyMetadata
impl UnsafeUnpin for ToolSafetyMetadata
impl UnwindSafe for ToolSafetyMetadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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