pub struct ToolPresentationPolicy {
pub include_all: bool,
pub include_always_on: bool,
pub families: Vec<ToolFamily>,
pub tools: Vec<String>,
pub backends: Vec<ToolBackendDisclosure>,
}Expand description
Policy for selecting model-visible tool families.
Fields§
§include_all: boolIf true, every registered tool is presented.
include_always_on: boolIf true, the always-on baseline is presented even when not in families.
families: Vec<ToolFamily>Additional families to present.
tools: Vec<String>Additional individual tools to present.
backends: Vec<ToolBackendDisclosure>Conditional backends to present for specific tools.
Implementations§
Source§impl ToolPresentationPolicy
impl ToolPresentationPolicy
Sourcepub fn runtime_default() -> Self
pub fn runtime_default() -> Self
Presents the default runtime surface while keeping advanced tools hidden unless explicitly disclosed.
Sourcepub fn with_families(families: impl IntoIterator<Item = ToolFamily>) -> Self
pub fn with_families(families: impl IntoIterator<Item = ToolFamily>) -> Self
Presents the always-on baseline plus specific families.
Sourcepub fn with_backend(tool: impl Into<String>, backend: impl Into<String>) -> Self
pub fn with_backend(tool: impl Into<String>, backend: impl Into<String>) -> Self
Presents the always-on baseline plus a specific conditional backend.
Sourcepub fn with_tool(tool: impl Into<String>) -> Self
pub fn with_tool(tool: impl Into<String>) -> Self
Presents the always-on baseline plus one specific tool.
Sourcepub fn disclose_tool(self, tool: impl Into<String>) -> Self
pub fn disclose_tool(self, tool: impl Into<String>) -> Self
Adds a tool disclosure entry to this policy.
Sourcepub fn disclose_backend(
self,
tool: impl Into<String>,
backend: impl Into<String>,
) -> Self
pub fn disclose_backend( self, tool: impl Into<String>, backend: impl Into<String>, ) -> Self
Adds a backend disclosure entry to this policy.
Sourcepub fn allows_tool(&self, tool: &dyn AgentTool) -> bool
pub fn allows_tool(&self, tool: &dyn AgentTool) -> bool
Returns true when this policy presents the given tool.
Sourcepub fn allows_backend(&self, tool: &str, backend: &str) -> bool
pub fn allows_backend(&self, tool: &str, backend: &str) -> bool
Returns true when a backend is disclosed for execution.
Sourcepub fn family_set(&self) -> HashSet<ToolFamily>
pub fn family_set(&self) -> HashSet<ToolFamily>
Returns the family set explicitly enabled by this policy.
Sourcepub fn backend_set_for(&self, tool: &str) -> HashSet<String>
pub fn backend_set_for(&self, tool: &str) -> HashSet<String>
Returns the disclosed backend ids for one tool.
Trait Implementations§
Source§impl Clone for ToolPresentationPolicy
impl Clone for ToolPresentationPolicy
Source§fn clone(&self) -> ToolPresentationPolicy
fn clone(&self) -> ToolPresentationPolicy
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 ToolPresentationPolicy
impl Debug for ToolPresentationPolicy
Source§impl Default for ToolPresentationPolicy
impl Default for ToolPresentationPolicy
Source§impl<'de> Deserialize<'de> for ToolPresentationPolicy
impl<'de> Deserialize<'de> for ToolPresentationPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ToolPresentationPolicy
Source§impl JsonSchema for ToolPresentationPolicy
impl JsonSchema for ToolPresentationPolicy
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more