# ai-code-helper **Repository Path**: tuom/ai-code-helper ## Basic Information - **Project Name**: ai-code-helper - **Description**: 基于 Spring Boot + LangChain4j + 通义千问的智能编程助手 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-17 - **Last Updated**: 2026-04-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AI Code Helper - 智能编程助手 基于 Spring Boot + LangChain4j + 通义千问的智能编程助手 ## 项目简介 AI Code Helper 是一个智能编程辅助应用,利用阿里云通义千问大语言模型(Qwen)为开发者提供智能问答和代码辅助功能。 ## 技术栈 ### 后端 - **框架**: Spring Boot 3.5.13 - **AI框架**: LangChain4j (整合 DashScope 通义千问) - **向量数据库**: Redis - **语言**: Java 21 ### 前端 - **技术**: HTML5 + CSS3 + JavaScript - **Markdown渲染**: marked.js - **代码高亮**: highlight.js ## 核心功能 ### 1. 智能对话 - 支持流式响应,提供流畅的对话体验 - Markdown 格式完美渲染(代码块、表格、列表等) - 代码语法高亮 ### 2. 任务队列 - 支持多个问题排队等待回答 - 手动选择执行队列中的问题 - 可编辑和删除排队中的问题 ### 3. 重试机制 - 用户可随时终止当前回答 - 支持重新发送问题 - 每个消息都有独立的重试按钮 ### 4. 聊天历史 - Redis 持久化存储聊天记录 - 支持多会话管理 - 聊天标题自动生成 ### 5. 现代化界面 - 响应式设计 - 渐变配色方案 - 流畅的动画效果 ## 项目结构 ``` ai-code-helper/ ├── src/main/ │ ├── java/com/mingyu/aicodehelper/ │ │ ├── ai/ │ │ │ ├── store/ │ │ │ │ └── RedisChatMemoryStore.java # Redis聊天记忆存储 │ │ │ └── AiCodeHelpFactory.java # AI工厂类 │ │ ├── config/ │ │ │ │ └── WebConfig.java # Web配置 │ │ ├── controller/ │ │ │ ├── AiController.java # AI对话控制器 │ │ │ ├── ChatHistoryController.java # 聊天历史控制器 │ │ ├── dao/ │ │ │ │ └── ChatMessage.java # 聊天消息实体 │ │ ├── service/ │ │ │ ├── AiCodeHelpService.java # AI服务接口 │ │ │ ├── ChatHistoryService.java # 历史服务接口 │ │ │ └── impl/ │ │ │ └── ChatHistoryServiceImpl.java # 历史服务实现 │ │ └── AiCodeHelperApplication.java # 启动类 │ └── resources/ │ ├── static/ │ │ └── index.html # 前端页面 │ └── application.yml # 配置文件 └── pom.xml # Maven配置 ``` ## API 接口 ### 聊天对话 | 方法 | 路径 | 说明 | |------|------|------| | POST | `/ai/flux/chat` | 流式对话 | ### 聊天历史 | 方法 | 路径 | 说明 | |------|------|------| | POST | `/ai/flux/chat/history` | 保存聊天历史 | | GET | `/ai/flux/chat/getHistoryList` | 获取历史列表 | | POST | `/ai/flux/chat/getHistory/{memoryId}` | 获取聊天记录 | | DELETE | `/ai/flux/chat/deleteHistory/{memoryId}` | 删除历史 | ## 配置说明 在 `application.yml` 中配置: ```yaml spring: data: redis: host: your-redis-host port: 6379 langchain4j: community: dashscope: api-key: your-dashscope-api-key ``` ## 快速开始 ### 1. 克隆项目 ```bash https://gitee.com/tuom/ai-code-helper.git