Skip to main content

ToolExt

Trait ToolExt 

Source
pub trait ToolExt: Tool {
    // Required methods
    fn category(&self) -> ToolCategory;
    fn as_any(&self) -> &(dyn Any + 'static);

    // Provided method
    fn to_openai_schema(&self) -> Value { ... }
}
Expand description

扩展的 Tool trait (Foundation 特有方法)

注意:这是 Foundation 层提供的扩展 trait,不是 kernel 层的 Tool trait

Required Methods§

Source

fn category(&self) -> ToolCategory

工具分类

Source

fn as_any(&self) -> &(dyn Any + 'static)

Get this tool as Any for downcasting

Provided Methods§

Source

fn to_openai_schema(&self) -> Value

转换为 OpenAI function schema 格式 (兼容性方法)

Implementors§

Source§

impl ToolExt for EchoTool

Source§

impl<T> ToolExt for SimpleToolAdapter<T>
where T: SimpleTool + 'static,