Tools#

struct ConnectInfo#

Tool connection info.

struct ToolMeta#

工具的描述信息

Public Members

std::string docs#

工具的说明信息,如适用场景等

bool is_internal_tool#

是否为内置工具

aidi::Buffer graph#

工具的图序列化数据

std::function<void(const ConnectInfo &connect_info, aidi::graph::storage::ToolGraph &tool_ctx)> connect_action#

工具的连接变化回调函数

class ToolFactory#

工具工厂类,用于创建工具对象.

Public Static Functions

static void Register(const std::string &tool_type, const ToolMeta &meta)#

注册工具

Parameters:
  • tool_type – 工具类型

  • meta – 工具描述信息,包含工具的说明信息,是否为内置工具以及工具的图序列化数据

static void RegisterAllToolInDir(const std::string &tools_dir)#

Register all tools in the given directory.

Parameters:

tools_dir – The directory containing tools.

static void Unregister(const std::string &tool_type)#

取消工具注册

Parameters:

tool_type

static void UnregisterAllExternalTool()#

卸载所有已经注册的外部工具

static std::vector<std::string> GetAllToolNames()#

获取所有工具的名称

Returns:

std::vector<std::string>

static const ToolMeta &GetMeta(const std::string &tool_type)#

获取工具的说明信息

Parameters:

tool_type

Returns:

const ToolMeta&

static aidi::graph::storage::ToolGraph Create(const std::string &tool_type)#

创建工具

Parameters:

tool_type

Returns:

aidi::graph::storage::ToolGraph

static bool Contains(const std::string &tool_type)#

判断对应名称的工具是否存在

Parameters:

tool_type

Returns:

true

Returns:

false