We introduce AnyTool, a large language model agent designed to revolutionize the utilization of a vast array of tools in addressing user queries. We utilize over 16,000 APIs from Rapid API, operating under the assumption that a subset of these APIs could potentially resolve the queries. AnyTool primarily incorporates three elements: an API retriever with a hierarchical structure, a solver aimed at resolving user queries using a selected set of API candidates, and a self-reflection mechanism, which re-activates AnyTool if the initial solution proves impracticable. AnyTool is powered by the function calling feature of GPT-4, eliminating the need for training external modules. We also revisit the evaluation protocol introduced by previous works and identify a limitation in this protocol that leads to an artificially high pass rate. By revising the evaluation protocol to better reflect practical application scenarios, we introduce an additional benchmark, termed AnyToolBench. Experiments across various datasets demonstrate the superiority of our AnyTool over strong baselines such as ToolLLM and a GPT-4 variant tailored for tool utilization. For instance, AnyTool outperforms ToolLLM by +35.4% in terms of average pass rate on ToolBench. Code will be available at https://github.com/dyabel/AnyTool.
翻译:我们提出AnyTool,一个旨在革新大规模工具调用以解决用户查询的大语言模型代理系统。该系统利用Rapid API中的超过16,000个API接口,其核心假设是其中部分API能够有效解决用户查询。AnyTool主要由三个组件构成:具有分层结构的API检索器、通过选定候选API集合解决用户查询的求解器,以及当初始方案不可行时重新激活AnyTool的自反思机制。该系统基于GPT-4的函数调用功能实现,无需训练外部模块。此外,我们重新审视了先前工作提出的评估协议,并发现该协议存在导致通过率虚高的局限性。通过修正评估协议以更好反映实际应用场景,我们引入了一个额外基准测试——AnyToolBench。跨多个数据集的实验表明,AnyTool在性能上显著优于ToolLLM和专为工具使用优化的GPT-4变体等强基线模型。例如,在ToolBench上,AnyTool的平均通过率相比ToolLLM提升35.4%。相关代码将发布于https://github.com/dyabel/AnyTool。