This paper presents a system that uses Large Language Models (LLMs)-based agents to automate the API-first development of RESTful microservices. This system helps to create an OpenAPI specification, generate server code from it, and refine the code through a feedback loop that analyzes execution logs and error messages. The integration of log analysis enables the LLM to detect and address issues efficiently, reducing the number of iterations required to produce functional and robust services. This study's main goal is to advance API-first development automation for RESTful web services and test the capability of LLM-based multi-agent systems in supporting the API-first development approach. To test the proposed system's potential, we utilized the PRAB benchmark. The results indicate that if we keep the OpenAPI specification small and focused, LLMs are capable of generating complete functional code with business logic that aligns to the specification. The code for the system is publicly available at https://github.com/sirbh/code-gen
翻译:本文提出了一种基于大语言模型(LLM)智能体的系统,用于自动化实现RESTful微服务的API优先开发。该系统能够协助创建OpenAPI规范,根据规范生成服务器端代码,并通过分析执行日志与错误消息的反馈循环对代码进行优化改进。日志分析功能的集成使得大语言模型能够高效地检测并解决问题,从而减少生成功能完善、鲁棒性强的服务所需的迭代次数。本研究的主要目标是推进RESTful网络服务的API优先开发自动化进程,并测试基于大语言模型的多智能体系统对API优先开发方法的支持能力。为验证所提出系统的潜力,我们采用了PRAB基准进行评估。结果表明,若保持OpenAPI规范精简且聚焦,大语言模型能够生成符合规范且包含完整业务逻辑的功能性代码。系统代码已公开于 https://github.com/sirbh/code-gen。