Skip to main content

SkillManager

Struct SkillManager 

Source
pub struct SkillManager { /* private fields */ }

Implementations§

Source§

impl SkillManager

Source

pub fn new( tool_registry: Arc<ToolRegistry>, capability_registry: Arc<CapabilityRegistry>, ) -> Self

Source

pub fn new_with_tool_registry(tool_registry: Arc<ToolRegistry>) -> Self

创建仅支持工具的 SkillManager(用于向后兼容)

Source

pub fn new_with_registries( tool_registry: Arc<ToolRegistry>, capability_registry: Arc<CapabilityRegistry>, ) -> Self

创建支持工具和功能的 SkillManager

Source

pub fn new_with_capability_registry( capability_registry: Arc<CapabilityRegistry>, ) -> Self

创建仅支持功能的 SkillManager(用于仅能力场景)

Source

pub fn register_skill(&self, skill: Skill) -> Result<()>

注册技能

Source

pub fn set_tool_access( &self, tool_id: &str, access_type: ToolAccessType, ) -> Result<()>

设置工具访问类型

Source

pub fn set_capability_access( &self, capability_id: &str, access_type: CapabilityAccessType, ) -> Result<()>

设置功能访问类型

Source

pub fn bind_skill_tool(&self, binding: SkillToolBinding) -> Result<()>

绑定技能和工具

Source

pub fn bind_skill_capability( &self, binding: SkillCapabilityBinding, ) -> Result<()>

绑定技能和功能

Source

pub fn get_skill_tools(&self, skill_id: &str) -> Vec<Tool>

获取技能可用的工具列表

Source

pub fn get_skill_capabilities(&self, skill_id: &str) -> Vec<Capability>

获取技能可用的功能列表

Source

pub fn can_call_tool(&self, tool_id: &str, caller_skills: &[String]) -> bool

检查工具是否可以被调用(基于技能绑定)

Source

pub fn can_call_capability( &self, capability_id: &str, caller_skills: &[String], ) -> bool

检查功能是否可以被调用(基于技能绑定)

Source

pub fn get_skills(&self) -> Vec<Skill>

获取技能列表

Source

pub fn get_skill(&self, skill_id: &str) -> Option<Skill>

获取技能

Source

pub fn get_tool_bound_skills(&self, tool_id: &str) -> Vec<String>

获取工具的绑定技能

Source

pub fn get_capability_bound_skills(&self, capability_id: &str) -> Vec<String>

获取功能的绑定技能

Source

pub fn get_skill_bound_tools(&self, skill_id: &str) -> Vec<String>

获取技能的绑定工具

Source

pub fn get_skill_bound_capabilities(&self, skill_id: &str) -> Vec<String>

获取技能的绑定功能

Source

pub fn get_skill_ids(&self) -> Vec<String>

获取所有技能ID

Source

pub fn get_tool_ids(&self) -> Vec<String>

获取所有工具ID

Source

pub fn get_capability_ids(&self) -> Vec<String>

获取所有功能ID

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> 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> PolicyExt for T
where T: ?Sized,

Source§

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

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

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

Source§

fn vzip(self) -> V

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