tooluniverse.compose_scripts.tool_graph_generation 模块

工具图生成组合脚本

高效评估所有提供工具配置中唯一配对之间的方向性数据流关系,使用单一智能工具:

  • 工具关系检测器

输出一个图结构,其中边表示有效的有向关系。每条边包含:源节点、目标节点、理由。

性能考虑:
  • 迭代 i<j 一次(O(N²/2) 对)

  • 轻量级 JSON 序列化的最小字段

  • 可选批处理钩子(当前为顺序执行,因为 call_tool 可能是远程调用)

参数 tool_configs:

键入 tool_configs:

列表[字典]

参数 max_tools:

类型 max_tools:

int

参数 output_path:

输入 output_path:

str) path to write resulting graph JSON (default './tool_relationship_graph.json'

参数 save_intermediate_every:

类型 save_intermediate_every:

:py:class:`int) 检查点频率(默认值为处理 5000 对数据)

返回:

节点、边、统计

rtype:

具有键的字典

tooluniverse.compose_scripts.tool_graph_generation.compose(arguments, tooluniverse, call_tool)[源代码]