tooluniverse.compose_scripts 包¶
子模块¶
tooluniverse.compose_scripts.biomarker_discovery module¶
生物标志物发现工作流程 使用组合工具发现并验证特定疾病状态的生物标志物
tooluniverse.compose_scripts.comprehensive_drug_discovery 模块¶
综合药物研发流程 完整的端到端药物研发工作流程,从疾病到优化候选药物
tooluniverse.compose_scripts.drug_safety_analyzer module¶
药物安全分析流程 综合药物安全分析,结合不良事件数据、文献综述和分子信息
tooluniverse.compose_scripts.enhanced_multi_agent_literature_search 模块¶
增强型多代理文献检索系统使用MemoryManager进行基于会话的内存管理
tooluniverse.compose_scripts.literature_tool module¶
文献搜索与摘要工具 适用于论文截图的简约编辑工具
tooluniverse.compose_scripts.multi_agent_literature_search module¶
多代理文献检索组合功能¶
该模块实现了多代理文献检索系统的组合功能。
- tooluniverse.compose_scripts.multi_agent_literature_search.compose(arguments, tooluniverse, call_tool, stream_callback=None)[源代码]¶
多代理文献检索组合功能
- 参数:
arguments (
dict) – 工具调用的输入参数tooluniverse (
ToolUniverse) – 引用 ToolUniverse 实例call_tool (
function) – 调用其他工具的功能stream_callback (
callable, optional) – 用于流式输出的回调函数
- 返回
dict:多智能体搜索的结果
tooluniverse.compose_scripts.output_summarizer module¶
输出摘要编写器脚本
该脚本通过以下方式处理工具输出的智能摘要: 1. 将较大的输出分块为可管理的部分 2. 使用人工智能驱动的摘要功能处理每个分块 3. 将摘要后的分块合并为连贯的最终摘要
脚本利用ToolUniverse的AgenticTool基础架构,提供智能、上下文感知的摘要功能,专注于与原始查询相关的信息。
- tooluniverse.compose_scripts.output_summarizer.compose(arguments, tooluniverse, call_tool)[源代码]¶
主要组成功能用于输出摘要。
此功能协调完整的摘要工作流程: - 将输入文本分割为可管理的片段 - 使用人工智能对每个片段进行摘要 - 将所有摘要合并为最终连贯的结果
- 参数:
arguments (
Dict[str, Any]) – 字典包含: - tool_output (str):需要总结的原始工具输出 - query_context (str):关于原始查询的上下文信息 - tool_name (str):生成输出的工具名称 - chunk_size (int, 可选):处理时每个块的大小 - focus_areas (str, 可选):总结时需要关注的领域 - max_summary_length (int, 可选):最终总结的最大长度tooluniverse – ToolUniverse 实例用于工具执行
call_tool – 在组合内调用其他工具的功能
- 返回
- Dict[str, Any]:包含以下内容的字典:
success (bool):是否成功完成摘要
original_length (int):原始输出的长度
summary_length (int):最终摘要的长度
chunks_processed(整数):已处理的数据块数量
摘要 (str): 汇总输出
tool_name(字符串):原始工具的名称
error(字符串,可选):如果摘要失败,则显示错误消息
tooluniverse.compose_scripts.tool_description_optimizer module¶
tooluniverse.compose_scripts.tool_discover module¶
- tooluniverse.compose_scripts.tool_discover.iterative_comprehensive_optimization(tool_config, call_tool, max_iterations=5, target_score=8.5, temp_dir=None)[源代码]¶
Comprehensive optimization with guaranteed minimum iterations and multi-agent improvement strategy
tooluniverse.compose_scripts.tool_graph_composer module¶
简化并修复了 tool_graph_composer.py。本版本包含更完善的错误处理,并避免了“不可哈希类型”问题。
tooluniverse.compose_scripts.tool_graph_generation module¶
工具图生成组合脚本
使用单一自主工具高效评估所有提供的工具配置之间的方向性数据流关系。
工具关系检测器
输出一个图结构,其中的边表示有效的方向关系。每条边包含:源节点、目标节点、依据。
- 性能注意事项:
迭代 i<j 一次(O(N^2/2) 对)。
轻量级 JSON 序列化的最小字段
可选的批处理钩子(当前为顺序执行,因为 call_tool 可能是远程调用)
- 参数工具配置:
- 类型 tool_configs:
列表[字典]- 参数 max_tools:
- 类型 max_tools:
- 参数 output_path:
- 类型 output_path:
str) path to write resulting graph JSON (default './tool_relationship_graph.json'- 参数 save_intermediate_every:
- 类型 save_intermediate_every:
int) 检查点频率(默认处理5000对)- 返回:
节点、边、统计
- rtype:
带有键的字典
tooluniverse.compose_scripts.tool_metadata_generator module¶
工具元数据生成管道通过从工具的配置文件中提取详细信息,为工具列表生成全面的元数据