tooluniverse.compose_tool 模块

ComposeTool —— 一款通过自定义代码逻辑组合其他工具的工具。支持智能依赖管理及自动加载工具。

class tooluniverse.compose_tool.ComposeTool[源代码]

基类:BaseTool

一个灵活的工具,能够通过自定义代码逻辑组合其他工具。支持内联 composition_code 及外部 Python 文件。具备智能依赖管理功能,实现自动加载工具。

__init__(tool_config, tooluniverse=None)[源代码]

Initialize the ComposeTool.

参数:
  • tool_config (dict) – Tool configuration containing composition code or file reference

  • tooluniverse (ToolUniverse) – Reference to the ToolUniverse instance

run(arguments, stream_callback=None)[源代码]

执行包含自定义代码逻辑的组合工具。

参数:
  • arguments (dict) – 组成的输入参数

  • stream_callback (callable, optional) – 用于流式输出的回调函数

返回值

Any: Result from the composition execution