用大模型根据自然语言生成可执行代码,复用现有库接口。
Capability-Driven Skill Generation with LLMs: A RAG-Based Approach for Reusing Existing Libraries and Interfaces
- 将能力视为代码契约,用大模型生成符合规范的实现
- 通过检索增强生成整合外部库,支持多语言代码输出
- 适合希望快速构建自动化系统的人,尤其在机器人领域
现代自动化系统越来越多地采用模块化架构,以能力和技能作为解决方案。能力以机器可读形式定义资源的功能,而技能则提供实现这些能力的具体实现。然而,开发符合特定能力规范的技能实现仍是一项耗时且具有挑战性的任务。本文提出一种方法,将能力视为技能实现的契约,并利用大语言模型根据自然语言用户输入生成可执行代码。该方法的关键特征是集成现有软件库和接口技术,实现跨目标语言的技能实现生成。我们引入一个框架,通过检索增强生成架构,允许用户将其自有的库和资源接口融入代码生成过程。所提方法在通过 Python 和 ROS 2 控制的自主移动机器人上进行了评估,验证了该方法的可行性和灵活性。
原文摘要 · Abstract (English)
Modern automation systems increasingly rely on modular architectures, with capabilities and skills as one solution approach. Capabilities define the functions of resources in a machine-readable form and skills provide the concrete implementations that realize those capabilities. However, the development of a skill implementation conforming to a corresponding capability remains a time-consuming and challenging task. In this paper, we present a method that treats capabilities as contracts for skill implementations and leverages large language models to generate executable code based on natural language user input. A key feature of our approach is the integration of existing software libraries and interface technologies, enabling the generation of skill implementations across different target languages. We introduce a framework that allows users to incorporate their own libraries and resource interfaces into the code generation process through a retrieval-augmented generation architecture. The proposed method is evaluated using an autonomous mobile robot controlled via Python and ROS 2, demonstrating the feasibility and flexibility of the approach.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。