pub struct IgnoreMessageTool {
pub teammate_manager: Option<Arc<Mutex<TeammateManager>>>,
}Expand description
IgnoreMessage 工具:显式声明「我看到了广播但选择不响应」
用于避免被无关 broadcast 唤醒后被迫凑话回应(thrash)。 调用本工具时,本轮的 assistant 文本不会被广播到聊天室, 因此不会触发其他 agent 的 wake_flag,loop 自然回到 idle。
teammate 与 Main 共用此工具:
- teammate 通过
teammate_manager=None注册,始终可用 - Main 通过
teammate_manager=Some(_)注册,仅在有活跃 teammate 时可用
Fields§
§teammate_manager: Option<Arc<Mutex<TeammateManager>>>Implementations§
Trait Implementations§
Source§impl Tool for IgnoreMessageTool
impl Tool for IgnoreMessageTool
Source§fn description(&self) -> Cow<'_, str>
fn description(&self) -> Cow<'_, str>
返回工具功能描述,静态描述返回
Cow::Borrowed,动态描述返回 Cow::OwnedSource§fn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
返回工具参数的 JSON Schema
Source§fn execute(&self, arguments: &str, _cancelled: &Arc<AtomicBool>) -> ToolResult
fn execute(&self, arguments: &str, _cancelled: &Arc<AtomicBool>) -> ToolResult
执行工具,传入参数字符串和取消信号,返回执行结果
Source§fn requires_confirmation(&self) -> bool
fn requires_confirmation(&self) -> bool
该工具是否需要用户确认后才能执行
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
工具是否当前可用(默认
true)。 Read moreSource§fn confirmation_message(&self, arguments: &str) -> String
fn confirmation_message(&self, arguments: &str) -> String
生成用户确认时显示的提示消息
Auto Trait Implementations§
impl Freeze for IgnoreMessageTool
impl RefUnwindSafe for IgnoreMessageTool
impl Send for IgnoreMessageTool
impl Sync for IgnoreMessageTool
impl Unpin for IgnoreMessageTool
impl UnsafeUnpin for IgnoreMessageTool
impl UnwindSafe for IgnoreMessageTool
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
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.