arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.16945cs.LGcs.AIcs.CLcs.SE
收藏

ToolFactory:通过利用 LLM 理解 REST API 文档实现工具生成自动化

ToolFactory: Automating Tool Generation by Leveraging LLM to Understand REST API Documentations

Brandeis University(布兰迪斯大学)

Xinyi Ni, Qiuyang Wang, Yukun Zhang, Pengyu Hong

AI总结:

本文提出开源流水线 ToolFactory,通过利用 LLM 理解非结构化 REST API 文档自动生成 AI 兼容工具,结合错误诊断与知识库推断缺失信息,有效促进了科学 API 在 AI 工作流中的无缝集成。

摘要:

基于 LLM 的工具智能体提供自然语言接口,使用户能够无缝地与计算服务进行交互。虽然 REST API 是构建此类智能体的宝贵资源,但它们必须首先被转换为 AI 兼容的工具。从 REST API 文档自动生成 AI 兼容的工具可以极大地简化工具智能体的开发并减少用户的学习成本。然而,API 文档通常缺乏标准化、模式不一致且信息不完整。为了解决这些问题,我们开发了 ToolFactory,这是一个用于从非结构化 API 文档中自动生成工具的开源流水线。为了提高所开发工具的可靠性,我们实现了一种评估方法来诊断错误。此外,我们构建了一个经过验证的工具知识库,并利用它来推断文档记录不全的 API 中缺失的信息。我们开发了 API Extraction Benchmark,包含 167 个 API 文档和 744 个各种格式的端点,并设计了一个 JSON 模式来对它们进行标注。这个标注数据集被用于训练和验证 ToolFactory。实验结果突出了 ToolFactory 的有效性。我们还通过为糖材料研究创建一个特定领域的 AI 智能体来演示了 ToolFactory。ToolFactory 展示出在促进科学 REST API 无缝集成到 AI 工作流方面的巨大潜力。

英文摘要:

LLM-based tool agents offer natural language interfaces, enabling users to seamlessly interact with computing services. While REST APIs are valuable resources for building such agents, they must first be transformed into AI-compatible tools. Automatically generating AI-compatible tools from REST API documents can greatly streamline tool agent development and minimize user learning curves. However, API documentation often suffers from a lack of standardization, inconsistent schemas, and incomplete information. To address these issues, we developed \textbf{ToolFactory}, an open-source pipeline for automating tool generation from unstructured API documents. To enhance the reliability of the developed tools, we implemented an evaluation method to diagnose errors. Furthermore, we built a knowledge base of verified tools, which we leveraged to infer missing information from poorly documented APIs. We developed the API Extraction Benchmark, comprising 167 API documents and 744 endpoints in various formats, and designed a JSON schema to annotate them. This annotated dataset was utilized to train and validate ToolFactory. The experimental results highlight the effectiveness of ToolFactory. We also demonstrated ToolFactory by creating a domain-specific AI agent for glycomaterials research. ToolFactory exhibits significant potential for facilitating the seamless integration of scientific REST APIs into AI workflows.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑