Tool-augmented large language models (LLMs) have achieved remarkable progress in tackling a broad range of queries. However, existing work are still in the experimental stage and has limitations in extensibility and robustness, especially facing the real-world applications. In this paper, we consider a more realistic scenario, connecting LLMs with RESTful APIs, which use the commonly adopted REST software architectural style for web service development. To address the practical challenges of planning and API usage, we introduce RestGPT, which leverages LLMs to solve user requests by connecting with RESTful APIs. Specifically, we propose a coarse-to-fine online planning mechanism to enhance the ability of planning and API selection. For the complex scenario of calling RESTful APIs, we also specially designed an API executor to formulate parameters and parse API responses. Experiments show that RestGPT is able to achieve impressive results in complex tasks and has strong robustness, which paves a new way towards AGI.
翻译:工具增强型大型语言模型(LLMs)在处理广泛查询方面取得了显著进展。然而,现有工作仍处于实验阶段,在可扩展性和鲁棒性方面存在局限性,尤其是面对真实世界应用时。本文考虑了一个更现实的情景:连接LLMs与RESTful API,即采用广泛使用的REST软件架构风格进行Web服务开发。为解决规划和API使用的实际挑战,我们提出RestGPT,通过连接RESTful API利用LLMs解决用户请求。具体而言,我们提出了一种从粗到细的在线规划机制,以增强规划和API选择能力。针对调用RESTful API的复杂场景,我们还专门设计了一个API执行器,用于参数公式化和API响应解析。实验表明,RestGPT能够在复杂任务中取得令人印象深刻的结果,并具有很强的鲁棒性,这为迈向AGI开辟了一条新路径。