ai-langchain4j
基于若依-vue-plus框架的LangChain4j AI大模型集成标准规范。全面规范模型配置管理、类型安全服务定义、RAG(检索增强生成)实现、流式响应处理及安全性保障。 触发场景: - 开发智能客服系统、文档问答助手、代码生成工具 - 集成LLM大模型接口(OpenAI、智谱AI、通义千问等) - 实现知识库问答、文档检索、语义搜索功能 - 开发需要流式响应的AI交互界面 - 构建RAG(检索增强生成)应用 触发词:AI集成、LangChain4j、大模型、RAG、流式输出、智谱AI、通义千问、OpenAI、向量检索、嵌入模型、Prompt工程
npx skills add majiayu000/claude-skill-registry --skill ai-langchain4j --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# AI 大模型集成规范 > 本规范基于LangChain4j框架,为若依-vue-plus项目定义统一的AI大模型集成标准。确保代码的可维护性、安全性和扩展性。 ## 核心规范 ### 规范1:模型配置与类型安全服务 **目标**:实现模型配置的集中管理和类型安全的AI服务定义。 **详细说明**: 1. **配置管理**:使用`ChatLanguageModel`构建器配置大模型,严禁在代码中硬编码API Key 2. **配置来源**:API Key必须从配置中心(如Nacos)或`application.yml`读取 3. **接口定义**:推荐使用LangChain4j的`AiServices`接口定义模式,将系统提示词(System Message)与业务逻辑解耦 4. **动态参数**:模型参数(temperature、topK、maxTokens等)应支持动态配置 5. **多模型支持**:设计时应考虑多模型切换能力(智谱AI、通义千问、OpenAI等) **实现要点**: - 使用`@ConfigurationProperties`绑定配置 - 通过工厂模式支持多模型动态切换 - 提供模型健康检查接口 ```java // ============ 配置属性类 ============ @Data @Component @ConfigurationProperties(prefix = "ai.model") public class AiProperties { private String provider; // openai/zhipu/qwen private String baseUrl; private String apiKey; private String modelName; private Double temperature = 0.7; private Integer maxTokens = 2000; private Integer timeout = 60; // 秒 } // ============ 配置类:动态初始化模型 ============ @Configuration @EnableConfigurationProperties(AiProperties.class) public class LangChain4jConfig { @Bean public ChatLanguageModel chatLanguageModel(AiProperties properties) { // 根据provider动态选择模型 return switch (properties.getProvider()) { case "openai" -> OpenAiChatModel.builder() .b
- 核心规范
- 规范1:模型配置与类型安全服务
- 规范2:RAG检索增强与向量化存储
- 规范3:流式响应处理
- 规范4:Prompt工程最佳实践
- 禁止事项
- 安全相关
- 性能相关
- 质量相关
- 成本相关
- 实施指南
- 快速开始
- 典型应用场景
- 参考代码
What does the ai-langchain4j skill do?
基于若依-vue-plus框架的LangChain4j AI大模型集成标准规范。全面规范模型配置管理、类型安全服务定义、RAG(检索增强生成)实现、流式响应处理及安全性保障。 触发场景: - 开发智能客服系统、文档问答助手、代码生成工具 - 集成LLM大模型接口(OpenAI、智谱AI、通义千问等) - 实现知识库问答、文档检索、语义搜索功能 - 开发需要流式响应的AI交互界面 - 构建RAG(检索增强生成)应用 触发词:AI集成、LangChain4j、大模型、RAG、流式输出、智谱AI、通义千问、OpenAI、向量检索、嵌入模型、Prompt工程
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill ai-langchain4j --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
