Compare commits
136 Commits
v2.0.5
...
63ec00cd71
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63ec00cd71 | ||
|
|
7eebd87cc8 | ||
|
|
285aa2ae62 | ||
|
|
99114d3301 | ||
|
|
138fa5f0e9 | ||
|
|
241c6dc57a | ||
|
|
6005339ec8 | ||
|
|
db892d35fb | ||
|
|
e117ec8e27 | ||
|
|
5e8db861ea | ||
|
|
fa2791e2e3 | ||
|
|
f1f7cb1084 | ||
|
|
acb1f27c37 | ||
|
|
e46245d97d | ||
|
|
0eff37fa51 | ||
|
|
c1a178c0be | ||
|
|
94d4446321 | ||
|
|
d7930ad713 | ||
|
|
48270add01 | ||
|
|
3786644a25 | ||
|
|
53532681d3 | ||
|
|
daa7b7315b | ||
|
|
df3b687be4 | ||
|
|
ecb5ef32fc | ||
|
|
e5116472ed | ||
|
|
e58aeb5361 | ||
|
|
b4306289f0 | ||
|
|
d9c47bd983 | ||
|
|
8ddbb43dde | ||
|
|
dfe8c7dc85 | ||
|
|
fd94a1772f | ||
|
|
c105d47d99 | ||
|
|
4e2ec2dc82 | ||
|
|
614280d8ea | ||
|
|
2fae8d0ad0 | ||
|
|
d7c2d1bcf3 | ||
|
|
122f63dfbd | ||
|
|
719e968192 | ||
|
|
bf790ceb51 | ||
|
|
de5488bd8c | ||
|
|
c77a245a4d | ||
|
|
6dcd8823cd | ||
|
|
8be480e06c | ||
|
|
11286de676 | ||
|
|
5aaf0a672c | ||
|
|
0089706336 | ||
|
|
cc129801b9 | ||
|
|
e1dc22348c | ||
|
|
f37e4da669 | ||
|
|
3e097d9a68 | ||
|
|
97ae5a46cd | ||
|
|
baa664ac4f | ||
|
|
353fbf26b8 | ||
|
|
f79b4ec012 | ||
|
|
0a73cb4e17 | ||
|
|
d635e30b4a | ||
|
|
ca50d1ddfb | ||
|
|
bd94a3eae8 | ||
|
|
fcdcf534f1 | ||
|
|
deefb6cc0b | ||
|
|
fa96c3d12f | ||
|
|
77069fdecd | ||
|
|
db4a264a52 | ||
|
|
70ae7ea8f1 | ||
|
|
6a93856d90 | ||
|
|
71cae94815 | ||
|
|
a2905d08f9 | ||
|
|
463ad6c583 | ||
|
|
abcde9e36e | ||
|
|
8e723f5b78 | ||
|
|
2021fb5071 | ||
|
|
ecbab7df7b | ||
|
|
d6fcaa0a11 | ||
|
|
58faded4ff | ||
|
|
7cc7af70f0 | ||
|
|
4312a729a2 | ||
|
|
5d972d66f4 | ||
|
|
1bff2791a6 | ||
|
|
a76769e540 | ||
|
|
bedffffd86 | ||
|
|
2884c37599 | ||
|
|
c25749c9ca | ||
|
|
147b3fd8f5 | ||
|
|
373424bd01 | ||
|
|
287a0b3d70 | ||
|
|
cd7e07bea6 | ||
|
|
7edfae09bc | ||
|
|
a1759ddf5a | ||
|
|
5517a5d19b | ||
|
|
8fb72ba4fe | ||
|
|
24511fac8f | ||
|
|
ce9f2a82da | ||
|
|
b81fb7cb3f | ||
|
|
676a63c0d6 | ||
|
|
427736271c | ||
|
|
c39dd7a917 | ||
|
|
c491a98dc7 | ||
|
|
2a4978c668 | ||
|
|
5b4eeee756 | ||
|
|
93ddcd53b1 | ||
|
|
0ee47a5c00 | ||
|
|
3ceef41ab0 | ||
|
|
57693059a1 | ||
|
|
d18e307e10 | ||
|
|
eed708c6d3 | ||
|
|
1093888889 | ||
|
|
e58a420f9f | ||
|
|
4a0c3d132a | ||
|
|
0d81aa640e | ||
|
|
951524bff7 | ||
|
|
c7d0e9337a | ||
|
|
6955f3c7dc | ||
|
|
a52b017e1a | ||
|
|
158a0190b5 | ||
|
|
096fc11313 | ||
|
|
e9ac795d23 | ||
|
|
32f1a6bab1 | ||
|
|
052069a2df | ||
|
|
e1c997883f | ||
|
|
031b7da198 | ||
|
|
931af963b1 | ||
|
|
f5fa7d5da8 | ||
|
|
c6ffbcb3cf | ||
|
|
05ae200ff5 | ||
|
|
e745f772ef | ||
|
|
584212c569 | ||
|
|
dc9bf3e25d | ||
|
|
da84a26c47 | ||
|
|
7d3282c347 | ||
|
|
4454be44c3 | ||
|
|
52e0feda01 | ||
|
|
c89f5d07fb | ||
|
|
778a7bc21b | ||
|
|
50f5f38996 | ||
|
|
32da85daab | ||
|
|
3666157d14 |
393
README.md
@@ -1,10 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
# RuoYi AI
|
# RuoYi AI
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
<!-- PROJECT SHIELDS -->
|
|
||||||
|
|
||||||
[![Contributors][contributors-shield]][contributors-url]
|
[![Contributors][contributors-shield]][contributors-url]
|
||||||
[![Forks][forks-shield]][forks-url]
|
[![Forks][forks-shield]][forks-url]
|
||||||
@@ -12,246 +8,149 @@
|
|||||||
[![Issues][issues-shield]][issues-url]
|
[![Issues][issues-shield]][issues-url]
|
||||||
[![MIT License][license-shield]][license-url]
|
[![MIT License][license-shield]][license-url]
|
||||||
|
|
||||||
|
<img src="image/00.png" alt="RuoYi AI Logo" width="120" height="120">
|
||||||
|
|
||||||
<!-- PROJECT LOGO -->
|
### 企业级AI助手平台
|
||||||
<br />
|
|
||||||
|
|
||||||
|
*开箱即用的智能AI平台,深度集成 FastGPT、扣子(Coze)、DIFY 等主流AI平台,提供先进的RAG技术和多模型支持*
|
||||||
|
|
||||||
<img style="text-align: center;" src="image/00.png" alt="Logo" width="150" height="150">
|
**[🇺🇸 English](README_EN.md)** | **[📖 使用文档](https://doc.pandarobot.chat)** | **[🚀 在线体验](https://web.pandarobot.chat)** | **[🐛 问题反馈](https://github.com/ageerle/ruoyi-ai/issues)** | **[💡 功能建议](https://github.com/ageerle/ruoyi-ai/issues)**
|
||||||
|
|
||||||
<h3 style="text-align: center;">快速搭建属于自己的 AI 助手平台</h3>
|
|
||||||
|
|
||||||
<p style="text-align: center;">
|
|
||||||
全新升级,开箱即用,简单高效
|
|
||||||
<br />
|
|
||||||
<a href="https://doc.pandarobot.chat"><strong>探索本项目的文档 »</strong></a>
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<a href="https://web.pandarobot.chat">项目预览</a>
|
|
||||||
·
|
|
||||||
<a href="https://github.com/ageerle/ruoyi-ai/issues">报告Bug</a>
|
|
||||||
·
|
|
||||||
<a href="https://github.com/ageerle/ruoyi-ai/issues">提出新特性</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
## 目录
|
|
||||||
|
|
||||||
- [系统体验](#系统体验)
|
|
||||||
- [源码地址](#源码地址)
|
|
||||||
- [配套文档](#项目文档)
|
|
||||||
- [核心功能](#核心功能)
|
|
||||||
- [项目演示](#项目演示)
|
|
||||||
- [管理端](#管理端)
|
|
||||||
- [用户端](#用户端)
|
|
||||||
- [小程序端](#小程序端)
|
|
||||||
- [开发环境](#开发环境)
|
|
||||||
- [项目结构](#项目结构)
|
|
||||||
- [ruoyi-ai](#ruoyi-ai)
|
|
||||||
- [注意事项](#注意事项)
|
|
||||||
- [vben模板](#vben模板)
|
|
||||||
- [贡献者](#贡献者)
|
|
||||||
- [如何参与开源项目](#如何参与开源项目)
|
|
||||||
- [版本控制](#版本控制)
|
|
||||||
- [作者](#作者)
|
|
||||||
- [鸣谢](#鸣谢)
|
|
||||||
- [技术讨论群](#技术讨论群)
|
|
||||||
|
|
||||||
### 系统体验
|
|
||||||
- 用户端:https://web.pandarobot.chat
|
|
||||||
- 管理端:https://admin.pandarobot.chat
|
|
||||||
- 用户名: admin 密码:admin123
|
|
||||||
|
|
||||||
### 源码地址
|
|
||||||
[1]github
|
|
||||||
- 前端服务-用户端: https://github.com/ageerle/ruoyi-web
|
|
||||||
- 前端服务-管理端: https://github.com/ageerle/ruoyi-admin
|
|
||||||
- 前端服务-小程序端: https://github.com/ageerle/ruoyi-uniapp
|
|
||||||
- 后端服务:https://github.com/ageerle/ruoyi-ai
|
|
||||||
|
|
||||||
[2]gitcode
|
|
||||||
- 前端服务-用户端:https://gitcode.com/ageerle/ruoyi-web
|
|
||||||
- 前端服务-管理端: https://gitcode.com/ageerle/ruoyi-admin
|
|
||||||
- 前端服务-小程序端: https://gitcode.com/ageerle/ruoyi-uniapp
|
|
||||||
- 后端服务:https://gitcode.com/ageerle/ruoyi-ai
|
|
||||||
|
|
||||||
### 配套文档
|
|
||||||
- 配套文档: https://doc.pandarobot.chat
|
|
||||||
- 项目部署文档:https://doc.pandarobot.chat/guide/introduction/
|
|
||||||
|
|
||||||
### 核心功能与技术亮点
|
|
||||||
#### 1. 全栈式开源系统
|
|
||||||
- 全套开源系统:提供完整的前端应用、后台管理以及小程序应用,基于MIT协议,开箱即用。
|
|
||||||
#### 2. 本地化 RAG 方案
|
|
||||||
- 基于 **Langchain4j** 框架,支持 Milvus/Weaviate/Qdrant 向量库,结合 BGE-large-zh-v1.5 本地向量化模型 实现高效文档检索与知识库构建。
|
|
||||||
- 支持 本地 LLM 接入,结合私有知识库实现安全可控的问答系统,避免依赖云端服务的隐私风险。
|
|
||||||
#### 3. 多模态 AI 引擎与工具集成
|
|
||||||
- 智能对话:支持 OpenAI GPT-4、Azure、ChatGLM 等主流模型,内置 SSE/WebSocket 协议实现低延迟交互,兼容 **扣子**、**DIFY** 等平台 API 调用。
|
|
||||||
- **Spring AI MCP** 支持:通过注解快速定义本地工具,支持调用 MCP 广场 的海量 MCP Server 服务,扩展模型能力边界。
|
|
||||||
#### 4. 企业级扩展与商业化支持
|
|
||||||
- 即时通讯集成:支持对接个人微信、企业微信及微信公众号,实现消息自动回复、用户管理与智能客服。
|
|
||||||
- 支付系统:集成易支付、微信支付、Stripe 国际信用卡支付,满足商业化场景需求。
|
|
||||||
#### 5. 多媒体处理与创新功能
|
|
||||||
- AI 绘画:集成 DALL·E-3、MidJourney、Stable Diffusion,支持文生图、图生图及风格化创作,适用于营销素材生成与创意设计。
|
|
||||||
- PPT 制作:根据文本输入自动生成结构化幻灯片,支持自定义模板(需要使用三方平台 如:文多多)。
|
|
||||||
|
|
||||||
### 项目演示
|
|
||||||
|
|
||||||
#### mcp支持
|
|
||||||
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
|
||||||
<img src="image/mcp-01.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
<img src="image/mcp-02.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
<img src="image/mcp-03.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
<img src="image/mcp-04.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
#### 管理端
|
## ✨ 核心亮点
|
||||||
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
|
||||||
<img src="image/02.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
### 🤖 智能AI引擎
|
||||||
<img src="image/03.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
- **多模型接入**:支持 OpenAI GPT-4、Azure、ChatGLM、通义千问、智谱AI 等主流模型
|
||||||
<img src="image/04.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
- **AI平台集成**:深度集成 **FastGPT**、**扣子(Coze)**、**DIFY** 等主流AI应用平台
|
||||||
<img src="image/05.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
- **Spring AI MCP 集成**:基于模型上下文协议,打造可扩展的AI工具生态系统
|
||||||
|
- **实时流式对话**:采用 SSE/WebSocket 技术,提供丝滑的对话体验
|
||||||
|
- **AI 编程助手**:内置智能代码分析和项目脚手架生成能力
|
||||||
|
|
||||||
|
### 🌟 AI平台生态集成
|
||||||
|
- **FastGPT 深度集成**:原生支持 FastGPT API,包括知识库检索、工作流编排和上下文管理
|
||||||
|
- **扣子(Coze) 官方SDK**:集成字节跳动扣子平台官方SDK,支持Bot对话和流式响应
|
||||||
|
- **DIFY 完整兼容**:使用 DIFY Java Client,支持应用编排、工作流和知识库管理
|
||||||
|
- **统一聊天接口**:提供统一的聊天服务接口,支持多平台无缝切换和负载均衡
|
||||||
|
|
||||||
|
### 🧠 本地化RAG方案
|
||||||
|
- **私有知识库**:基于 Langchain4j 框架 + BGE-large-zh-v1.5 中文向量模型
|
||||||
|
- **多种向量库**:支持 Milvus、Weaviate、Qdrant 等主流向量数据库
|
||||||
|
- **数据安全可控**:支持完全本地部署,保护企业数据隐私
|
||||||
|
- **灵活模型部署**:兼容 Ollama、vLLM 等本地推理框架
|
||||||
|
|
||||||
|
### 🎨 AI创作工具
|
||||||
|
- **AI 绘画创作**:深度集成 DALL·E-3、MidJourney、Stable Diffusion
|
||||||
|
- **智能PPT生成**:一键将文本内容转换为精美演示文稿
|
||||||
|
- **多模态理解**:支持文本、图片、文档等多种格式的智能处理
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 🚀 快速体验
|
||||||
|
|
||||||
|
### 在线演示
|
||||||
|
- **用户端体验**:[web.pandarobot.chat](https://web.pandarobot.chat) (账号:demo 密码:demo123)
|
||||||
|
- **管理后台**:[admin.pandarobot.chat](https://admin.pandarobot.chat) (账号:admin 密码:admin123)
|
||||||
|
|
||||||
|
### 项目源码
|
||||||
|
| 项目模块 | GitHub 仓库 | Gitee 仓库 | GitCode 仓库 |
|
||||||
|
|---------|------------|-----------|-------------|
|
||||||
|
| 🔧 后端服务 | [ruoyi-ai](https://github.com/ageerle/ruoyi-ai) | [ruoyi-ai](https://gitee.com/ageerle/ruoyi-ai) | [ruoyi-ai](https://gitcode.com/ageerle/ruoyi-ai) |
|
||||||
|
| 🎨 用户前端 | [ruoyi-web](https://github.com/ageerle/ruoyi-web) | [ruoyi-web](https://gitee.com/ageerle/ruoyi-web) | [ruoyi-web](https://gitcode.com/ageerle/ruoyi-web) |
|
||||||
|
| 🛠️ 管理后台 | [ruoyi-admin](https://github.com/ageerle/ruoyi-admin) | [ruoyi-admin](https://gitee.com/ageerle/ruoyi-admin) | [ruoyi-admin](https://gitcode.com/ageerle/ruoyi-admin) |
|
||||||
|
|
||||||
|
### 合作项目
|
||||||
|
| 项目介绍 | GitHub 仓库 | Gitee 仓库 |
|
||||||
|
|:--------:|:----------:|:----------:|
|
||||||
|
| 前端简化版 | [ruoyi-element-ai](https://github.com/element-plus-x/ruoyi-element-ai) | [ruoyi-element-ai](https://gitee.com/he-jiayue/ruoyi-element-ai) |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 🛠️ 技术架构
|
||||||
|
|
||||||
|
### 🏗️ 核心框架
|
||||||
|
- **后端架构**:Spring Boot 3.4 + Spring AI + Langchain4j
|
||||||
|
- **数据存储**:MySQL 8.0 + Redis + 向量数据库(Milvus/Weaviate/Qdrant)
|
||||||
|
- **前端技术**:Vue 3 + Vben Admin + Naive UI
|
||||||
|
- **安全认证**:Sa-Token + JWT 双重保障
|
||||||
|
|
||||||
|
### 🔧 系统组件
|
||||||
|
- **文档处理**:PDF、Word、Excel 解析,图像智能分析
|
||||||
|
- **实时通信**:WebSocket 实时通信,SSE 流式响应
|
||||||
|
- **系统监控**:完善的日志体系、性能监控、服务健康检查
|
||||||
|
|
||||||
|
## 📚 使用文档
|
||||||
|
|
||||||
|
想要深入了解安装部署、功能配置和二次开发?
|
||||||
|
|
||||||
|
**👉 [完整使用文档](https://doc.pandarobot.chat)**
|
||||||
|
|
||||||
|
## 🤝 参与贡献
|
||||||
|
|
||||||
|
我们热烈欢迎社区贡献!无论您是资深开发者还是初学者,都可以为项目贡献力量 💪
|
||||||
|
|
||||||
|
### 贡献方式
|
||||||
|
1. **Fork** 项目到您的账户
|
||||||
|
2. **创建分支** (`git checkout -b feature/新功能名称`)
|
||||||
|
3. **提交代码** (`git commit -m '添加某某功能'`)
|
||||||
|
4. **推送分支** (`git push origin feature/新功能名称`)
|
||||||
|
5. **发起 Pull Request**
|
||||||
|
|
||||||
|
> 💡 **小贴士**:建议将 PR 提交到 GitHub,我们会自动同步到其他代码托管平台
|
||||||
|
|
||||||
|
## 📄 开源协议
|
||||||
|
|
||||||
|
本项目采用 **MIT 开源协议**,详情请查看 [LICENSE](LICENSE) 文件。
|
||||||
|
|
||||||
|
## 🙏 特别鸣谢
|
||||||
|
|
||||||
|
感谢以下优秀的开源项目为本项目提供支持:
|
||||||
|
|
||||||
|
- [Spring AI Alibaba Copilot](https://github.com/springaialibaba/spring-ai-alibaba-copilot) - 基于spring-ai-alibaba 的智能编码助手
|
||||||
|
- [Spring AI](https://spring.io/projects/spring-ai) - Spring 官方 AI 集成框架
|
||||||
|
- [Langchain4j](https://github.com/langchain4j/langchain4j) - 强大的 Java LLM 开发框架
|
||||||
|
- [RuoYi-Vue-Plus](https://gitee.com/dromara/RuoYi-Vue-Plus) - 成熟的企业级快速开发框架
|
||||||
|
- [Vben Admin](https://github.com/vbenjs/vue-vben-admin) - 现代化的 Vue 后台管理模板
|
||||||
|
- [chatgpt-java](https://github.com/Grt1228/chatgpt-java) - 优秀的 ChatGPT Java SDK
|
||||||
|
|
||||||
|
## 🌐 生态伙伴
|
||||||
|
|
||||||
|
- [PPIO 派欧云](https://ppinfra.com/user/register?invited_by=P8QTUY&utm_source=github_ruoyi-ai) - 提供高性价比的 GPU 算力和模型 API 服务
|
||||||
|
- [优云智算](https://www.compshare.cn/?ytag=GPU_YY-gh_ruoyi) - 万卡RTX40系GPU+海内外主流模型API服务,秒级响应,按量计费,新客免费用。
|
||||||
|
|
||||||
|
## 💬 社区交流
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td align="center">
|
||||||
|
<img src="image/wx.png" alt="微信二维码" width="200" height="200"><br>
|
||||||
|
<strong>扫码添加作者微信</strong><br>
|
||||||
|
<em>邀请进群学习</em>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<img src="image/qq.png" alt="QQ群二维码" width="200" height="200"><br>
|
||||||
|
<strong>QQ技术交流群</strong><br>
|
||||||
|
<em>技术讨论</em>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
#### 用户端
|
---
|
||||||
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
|
||||||
<img src="image/08.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
<div align="center">
|
||||||
<img src="image/09.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
<img src="image/10.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
**[⭐ 点个Star支持一下](https://github.com/ageerle/ruoyi-ai)** • **[🍴 Fork 开始贡献](https://github.com/ageerle/ruoyi-ai/fork)** • **[📚 English](README_EN.md)** • **[📖 查看完整文档](https://doc.pandarobot.chat)**
|
||||||
<img src="image/11.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
|
*用 ❤️ 打造,由 RuoYi AI 开源社区维护*
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
#### 小程序端
|
<!-- Badge Links -->
|
||||||
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: flex-start;">
|
|
||||||
<img src="image/06.png" alt="drawing" style="width: 320px; height: 600px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
<img src="image/07.png" alt="drawing" style="width: 320px; height: 600px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
### 开发环境
|
|
||||||
|
|
||||||
1. jdk 17
|
|
||||||
2. mysql 5.7、8.0
|
|
||||||
3. redis 版本必须 >= 5.X
|
|
||||||
4. maven 3.8+
|
|
||||||
5. nodejs 20+ & pnpm
|
|
||||||
|
|
||||||
- 附-部署配套视频:https://www.bilibili.com/video/BV1jDXkYWEba
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<img src="image/教程搭建.png" alt="drawing" width="600px" height="300px"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
### 项目结构
|
|
||||||
- RuoYi-AI
|
|
||||||
|
|
||||||
```
|
|
||||||
├─ ruoyi-admin // 管理模块
|
|
||||||
│ └─ RuoYiApplication // 启动类
|
|
||||||
│ └─ RuoYiServletInitializer // 容器部署初始化类
|
|
||||||
│ └─ resources // 资源文件
|
|
||||||
│ └─ i18n/messages.properties // 国际化配置文件
|
|
||||||
│ └─ application.yml // 框架总配置文件
|
|
||||||
│ └─ application-dev.yml // 开发环境配置文件
|
|
||||||
│ └─ application-prod.yml // 生产环境配置文件
|
|
||||||
│ └─ banner.txt // 框架启动图标
|
|
||||||
│ └─ logback-plus.xml // 日志配置文件
|
|
||||||
│ └─ ip2region.xdb // IP区域地址库
|
|
||||||
├─ ruoyi-common // 通用模块
|
|
||||||
│ └─ ruoyi-common-bom // common依赖包管理
|
|
||||||
└─ ruoyi-common-chat // 聊天模块
|
|
||||||
│ └─ ruoyi-common-core // 核心模块
|
|
||||||
│ └─ ruoyi-common-doc // 系统接口模块
|
|
||||||
│ └─ ruoyi-common-encrypt // 数据加解密模块
|
|
||||||
│ └─ ruoyi-common-excel // excel模块
|
|
||||||
│ └─ ruoyi-common-idempotent // 幂等功能模块
|
|
||||||
│ └─ ruoyi-common-json // 序列化模块
|
|
||||||
│ └─ ruoyi-common-log // 日志模块
|
|
||||||
│ └─ ruoyi-common-mail // 邮件模块
|
|
||||||
│ └─ ruoyi-common-mybatis // 数据库模块
|
|
||||||
│ └─ ruoyi-common-oss // oss服务模块
|
|
||||||
│ └─ ruoyi-common-pay // 支付模块
|
|
||||||
│ └─ ruoyi-common-ratelimiter // 限流功能模块
|
|
||||||
│ └─ ruoyi-common-redis // 缓存服务模块
|
|
||||||
│ └─ ruoyi-common-satoken // satoken模块
|
|
||||||
│ └─ ruoyi-common-security // 安全模块
|
|
||||||
│ └─ ruoyi-common-sensitive // 脱敏模块
|
|
||||||
│ └─ ruoyi-common-sms // 短信模块
|
|
||||||
│ └─ ruoyi-common-tenant // 租户模块
|
|
||||||
│ └─ ruoyi-common-translation // 通用翻译模块
|
|
||||||
│ └─ ruoyi-common-web // web模块
|
|
||||||
├─ ruoyi-modules // 模块组
|
|
||||||
│ └─ ruoyi-demo // 演示模块
|
|
||||||
│ └─ ruoyi-system // 业务模块
|
|
||||||
├─ .run // 执行脚本文件
|
|
||||||
├─ .editorconfig // 编辑器编码格式配置
|
|
||||||
├─ LICENSE // 开源协议
|
|
||||||
├─ pom.xml // 公共依赖
|
|
||||||
├─ README.md // 框架说明文件
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
### 注意事项
|
|
||||||
- vben模板
|
|
||||||
|
|
||||||
Q:vben5 的模板默认是没有的吗?
|
|
||||||
|
|
||||||
A:vben模板是收费的 请联系vben-vue-plus作者获取。
|
|
||||||
|
|
||||||
### 版本控制
|
|
||||||
|
|
||||||
该项目使用Git进行版本管理。您可以在repository参看当前可用版本。
|
|
||||||
|
|
||||||
|
|
||||||
### 版权说明
|
|
||||||
|
|
||||||
该项目使用了MIT授权许可,详情请参阅 [LICENSE.txt](https://github.com/ageerle/ruoyi-ai/blob/main/LICENSE)
|
|
||||||
|
|
||||||
### 项目现状
|
|
||||||
|
|
||||||
目前,项目还处于早期阶段,距离成熟还有很长的路要走。由于个人精力有限,项目的发展速度受到了一定的限制。为了加快项目的进度,我真诚地希望更多人能够参与到项目中来。无论是经验丰富的开发者,还是刚刚入门的小白,我都热烈欢迎你们提交Pull Request(PR)👏👏👏。即使代码修改得很少,或者存在一些错误,都没有关系。我会认真审核每一位贡献者的代码,并和大家一起完善项目⛽️⛽️⛽️。
|
|
||||||
|
|
||||||
### 开发计划
|
|
||||||
|
|
||||||
| 主题 | 方向 | 时间节点 |
|
|
||||||
| --- |-----------------------------------|--------|
|
|
||||||
| 前端简化版 | 与element-plus-x框架合作,推出基于该框架的前端简化版 | 2025.5 |
|
|
||||||
| agent2agent | Agent2Agent协议支持 | 2025.6 |
|
|
||||||
| 流程编排 | 通过可视化界面和灵活的配置方式,快速构建AI应用 | 2025.7 |
|
|
||||||
|
|
||||||
|
|
||||||
- 感谢
|
|
||||||
|
|
||||||
最后,我要感谢RuoYi-Vue-Plus、chatgpt-java、chatgpt-web-midjourney-proxy等优秀框架。正是因为这些项目的开源和共享,我才能够在这个基础上进行开发,使我们的项目能够取得今天的成果。再次感谢这些项目及其背后的开发者们!
|
|
||||||
|
|
||||||
希望更多志同道合的朋友能够加入我们,共同推动这个项目的发展。让我们一起努力,将这个项目打造成一个真正成熟、实用的AI平台!
|
|
||||||
|
|
||||||
#### 如何参与开源项目
|
|
||||||
|
|
||||||
贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献,我们都非常感谢!🙏
|
|
||||||
|
|
||||||
1. Fork 这个项目
|
|
||||||
2. 创建你的功能分支 (`git checkout -b feature/dev`)
|
|
||||||
3. 提交你的更改 (`git commit -m 'Add some dev'`)
|
|
||||||
4. 推送到分支 (`git push origin feature/dev`)
|
|
||||||
5. 打开拉取请求
|
|
||||||
6. pr请提交到GitHub上,会定时同步到gitee
|
|
||||||
|
|
||||||
#### 项目文档
|
|
||||||
1. 项目文档基于vitepress构建
|
|
||||||
2. 按照[如何参与开源项目](#如何参与开源项目)拉取https://github.com/ageerle/ruoyi-doc
|
|
||||||
3. 安装依赖:npm install
|
|
||||||
4. 启动项目:npm run docs:dev
|
|
||||||
5. 主页路径:docs/guide/introduction/index.md
|
|
||||||
|
|
||||||
### 鸣谢
|
|
||||||
- [chatgpt-java](https://github.com/Grt1228/chatgpt-java)
|
|
||||||
- [RuoYi-Vue-Plus](https://gitee.com/dromara/RuoYi-Vue-Plus)
|
|
||||||
- [chatgpt-web-midjourney-proxy](https://github.com/Dooy/chatgpt-web-midjourney-proxy)
|
|
||||||
- [Vben Admin](https://github.com/vbenjs/vue-vben-admin)
|
|
||||||
- [Naive UI](https://www.naiveui.com)
|
|
||||||
|
|
||||||
<!-- links -->
|
|
||||||
[your-project-path]:https://github.com/ageerle/ruoyi-ai
|
|
||||||
[contributors-shield]: https://img.shields.io/github/contributors/ageerle/ruoyi-ai.svg?style=flat-square
|
[contributors-shield]: https://img.shields.io/github/contributors/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
[contributors-url]: https://github.com/ageerle/ruoyi-ai/graphs/contributors
|
[contributors-url]: https://github.com/ageerle/ruoyi-ai/graphs/contributors
|
||||||
[forks-shield]: https://img.shields.io/github/forks/ageerle/ruoyi-ai.svg?style=flat-square
|
[forks-shield]: https://img.shields.io/github/forks/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
@@ -259,26 +158,6 @@
|
|||||||
[stars-shield]: https://img.shields.io/github/stars/ageerle/ruoyi-ai.svg?style=flat-square
|
[stars-shield]: https://img.shields.io/github/stars/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
[stars-url]: https://github.com/ageerle/ruoyi-ai/stargazers
|
[stars-url]: https://github.com/ageerle/ruoyi-ai/stargazers
|
||||||
[issues-shield]: https://img.shields.io/github/issues/ageerle/ruoyi-ai.svg?style=flat-square
|
[issues-shield]: https://img.shields.io/github/issues/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
[issues-url]: https://img.shields.io/github/issues/ageerle/ruoyi-ai.svg
|
[issues-url]: https://github.com/ageerle/ruoyi-ai/issues
|
||||||
[license-shield]: https://img.shields.io/github/license/ageerle/ruoyi-ai.svg?style=flat-square
|
[license-shield]: https://img.shields.io/github/license/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
[license-url]: https://github.com/ageerle/ruoyi-ai/blob/master/LICENSE.txt
|
[license-url]: https://github.com/ageerle/ruoyi-ai/blob/main/LICENSE
|
||||||
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
|
|
||||||
|
|
||||||
## 🌿 第三方生态
|
|
||||||
- [PPIO 派欧云:一键调用高性价比的开源模型 API 和 GPU 容器](https://ppinfra.com/user/register?invited_by=P8QTUY&utm_source=github_ruoyi-ai)
|
|
||||||
|
|
||||||
### 附:技术讨论群
|
|
||||||
|
|
||||||
#### 进群学习
|
|
||||||
🏠 wx:ruoyi-ai(加人备注:ruoyi-ai)
|
|
||||||
|
|
||||||
<img src="image/小助手wx.png" alt="drawing" style="width: 400px; height: 400px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
|
|
||||||
🏠 qq:1603234088 (加人备注:ruoyi-ai)
|
|
||||||
|
|
||||||
👏👏👏 ruoyi-ai官方交流1群(qq区):1034554687
|
|
||||||
|
|
||||||
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
|
||||||
<img src="image/QQ区-官方交流1群.png" alt="drawing" style="width: 400px; height: 400px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|||||||
167
README_EN.md
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
|
||||||
|
# RuoYi AI
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
[![Contributors][contributors-shield]][contributors-url]
|
||||||
|
[![Forks][forks-shield]][forks-url]
|
||||||
|
[![Stargazers][stars-shield]][stars-url]
|
||||||
|
[![Issues][issues-shield]][issues-url]
|
||||||
|
[![MIT License][license-shield]][license-url]
|
||||||
|
|
||||||
|
<img src="image/00.png" alt="RuoYi AI Logo" width="120" height="120">
|
||||||
|
|
||||||
|
### Enterprise-Grade AI Assistant Platform
|
||||||
|
|
||||||
|
*Production-ready AI platform with deep integration of FastGPT, Coze, DIFY and advanced RAG technology*
|
||||||
|
|
||||||
|
**[📖 中文文档](README.md)** | **[📚 Documentation](https://doc.pandarobot.chat)** | **[🚀 Live Demo](https://web.pandarobot.chat)** | **[🐛 Report Bug](https://github.com/ageerle/ruoyi-ai/issues)** | **[💡 Request Feature](https://github.com/ageerle/ruoyi-ai/issues)**
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
## ✨ Key Features
|
||||||
|
|
||||||
|
### 🤖 Advanced AI Engine
|
||||||
|
- **Multi-Model Support**: OpenAI GPT-4, Azure, ChatGLM, Qwen, ZhipuAI
|
||||||
|
- **AI Platform Integration**: Deep integration with **FastGPT**, **Coze**, **DIFY** and other leading AI platforms
|
||||||
|
- **Spring AI MCP Integration**: Extensible tool ecosystem with Model Context Protocol
|
||||||
|
- **Streaming Chat**: Real-time SSE/WebSocket communication
|
||||||
|
- **AI Copilot**: Intelligent code analysis and project scaffolding
|
||||||
|
|
||||||
|
### 🌟 AI Platform Ecosystem
|
||||||
|
- **FastGPT Deep Integration**: Native FastGPT API support with knowledge base retrieval, workflow orchestration and context management
|
||||||
|
- **Coze Official SDK**: Integration with ByteDance Coze platform official SDK, supporting Bot conversations and streaming responses
|
||||||
|
- **DIFY Full Compatibility**: Using DIFY Java Client for app orchestration, workflows and knowledge base management
|
||||||
|
- **Unified Chat Interface**: Standardized chat service interface supporting seamless platform switching and load balancing
|
||||||
|
|
||||||
|
### 🧠 Enterprise RAG Solution
|
||||||
|
- **Local Knowledge Base**: Langchain4j + BGE-large-zh-v1.5 embeddings
|
||||||
|
- **Vector Database Support**: Milvus, Weaviate, Qdrant
|
||||||
|
- **Privacy-First**: On-premise deployment with local LLM support
|
||||||
|
- **Ollama & vLLM Compatible**: Flexible model deployment options
|
||||||
|
|
||||||
|
### 🎨 Creative AI Tools
|
||||||
|
- **AI Art Generation**: DALL·E-3, MidJourney, Stable Diffusion integration
|
||||||
|
- **PPT Creation**: Automated slide generation from text input
|
||||||
|
- **Multi-Modal Processing**: Text, image, and document understanding
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 🚀 Quick Start
|
||||||
|
|
||||||
|
### Live Demo
|
||||||
|
- **User Portal**: [web.pandarobot.chat](https://web.pandarobot.chat) (demo/demo123)
|
||||||
|
- **Admin Panel**: [admin.pandarobot.chat](https://admin.pandarobot.chat) (admin/admin123)
|
||||||
|
|
||||||
|
### Source Code
|
||||||
|
| Component | GitHub | Gitee | GitCode |
|
||||||
|
|-----------|--------|-------|---------|
|
||||||
|
| Backend API | [ruoyi-ai](https://github.com/ageerle/ruoyi-ai) | [ruoyi-ai](https://gitee.com/ageerle/ruoyi-ai) | [ruoyi-ai](https://gitcode.com/ageerle/ruoyi-ai) |
|
||||||
|
| User Frontend | [ruoyi-web](https://github.com/ageerle/ruoyi-web) | [ruoyi-web](https://gitee.com/ageerle/ruoyi-web) | [ruoyi-web](https://gitcode.com/ageerle/ruoyi-web) |
|
||||||
|
| Admin Frontend | [ruoyi-admin](https://github.com/ageerle/ruoyi-admin) | [ruoyi-admin](https://gitee.com/ageerle/ruoyi-admin) | [ruoyi-admin](https://gitcode.com/ageerle/ruoyi-admin) |
|
||||||
|
|
||||||
|
### Collaborative Projects
|
||||||
|
| Project Description | GitHub Repository | Gitee Repository |
|
||||||
|
|:-------------------:|:-----------------:|:----------------:|
|
||||||
|
| Simplified Frontend | [ruoyi-element-ai](https://github.com/element-plus-x/ruoyi-element-ai) | [ruoyi-element-ai](https://gitee.com/he-jiayue/ruoyi-element-ai) |
|
||||||
|
|
||||||
|
|
||||||
|
## 🛠️ Tech Stack
|
||||||
|
|
||||||
|
### Core Framework
|
||||||
|
- **Backend**: Spring Boot 3.4, Spring AI, Langchain4j
|
||||||
|
- **Database**: MySQL 8.0, Redis, Vector Databases (Milvus/Weaviate/Qdrant)
|
||||||
|
- **Frontend**: Vue 3, Vben Admin, Naive UI
|
||||||
|
- **Authentication**: Sa-Token, JWT
|
||||||
|
|
||||||
|
### System Components
|
||||||
|
- **File Processing**: PDF, Word, Excel parsing, intelligent image analysis
|
||||||
|
- **Real-time Communication**: WebSocket real-time communication, SSE streaming
|
||||||
|
- **System Monitoring**: Comprehensive logging, performance monitoring, health checks
|
||||||
|
|
||||||
|
## 📚 Documentation
|
||||||
|
|
||||||
|
For detailed setup, configuration, and development guides, visit our comprehensive documentation:
|
||||||
|
|
||||||
|
**[📖 Official Documentation](https://doc.pandarobot.chat)**
|
||||||
|
|
||||||
|
## 🤝 Contributing
|
||||||
|
|
||||||
|
We welcome contributions from developers of all skill levels! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
|
||||||
|
|
||||||
|
### How to Contribute
|
||||||
|
1. Fork the repository
|
||||||
|
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
||||||
|
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
||||||
|
4. Push to the branch (`git push origin feature/amazing-feature`)
|
||||||
|
5. Open a Pull Request
|
||||||
|
|
||||||
|
*Please submit PRs to GitHub - they will be synchronized to other platforms automatically.*
|
||||||
|
|
||||||
|
## 📄 License
|
||||||
|
|
||||||
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||||
|
|
||||||
|
|
||||||
|
## 🙏 Acknowledgments
|
||||||
|
|
||||||
|
Special thanks to these amazing open source projects:
|
||||||
|
|
||||||
|
- [Spring AI Alibaba Copilot](https://github.com/springaialibaba/spring-ai-alibaba-copilot) - Intelligent coding assistant based on spring-ai-alibaba with MCP protocol integration for project analysis and code generation
|
||||||
|
- [Spring AI](https://spring.io/projects/spring-ai) - Spring's AI integration framework
|
||||||
|
- [Langchain4j](https://github.com/langchain4j/langchain4j) - Java LLM framework
|
||||||
|
- [RuoYi-Vue-Plus](https://gitee.com/dromara/RuoYi-Vue-Plus) - Enterprise development framework
|
||||||
|
- [Vben Admin](https://github.com/vbenjs/vue-vben-admin) - Vue admin template
|
||||||
|
- [chatgpt-java](https://github.com/Grt1228/chatgpt-java) - ChatGPT Java SDK
|
||||||
|
|
||||||
|
## 🌐 Ecosystem Partners
|
||||||
|
|
||||||
|
- [PPIO Cloud](https://ppinfra.com/user/register?invited_by=P8QTUY&utm_source=github_ruoyi-ai) - Cost-effective GPU containers and model APIs
|
||||||
|
|
||||||
|
## 💬 Community
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td align="center">
|
||||||
|
<img src="image/wx.png" alt="WeChat" width="200" height="200"><br>
|
||||||
|
<strong>Add Author WeChat</strong><br>
|
||||||
|
<em>Scan to join learning group</em>
|
||||||
|
</td>
|
||||||
|
<td align="center">
|
||||||
|
<img src="image/qq.png" alt="QQ Group" width="200" height="200"><br>
|
||||||
|
<strong>QQ Group</strong><br>
|
||||||
|
<em>Technical discussion</em>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
**[⭐ Star this repo](https://github.com/ageerle/ruoyi-ai)** • **[🍴 Fork it](https://github.com/ageerle/ruoyi-ai/fork)** • **[📖 中文文档](README.md)** • **[📚 Documentation](https://doc.pandarobot.chat)**
|
||||||
|
|
||||||
|
*Built with ❤️ by the RuoYi AI community*
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Badge Links -->
|
||||||
|
[contributors-shield]: https://img.shields.io/github/contributors/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
|
[contributors-url]: https://github.com/ageerle/ruoyi-ai/graphs/contributors
|
||||||
|
[forks-shield]: https://img.shields.io/github/forks/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
|
[forks-url]: https://github.com/ageerle/ruoyi-ai/network/members
|
||||||
|
[stars-shield]: https://img.shields.io/github/stars/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
|
[stars-url]: https://github.com/ageerle/ruoyi-ai/stargazers
|
||||||
|
[issues-shield]: https://img.shields.io/github/issues/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
|
[issues-url]: https://github.com/ageerle/ruoyi-ai/issues
|
||||||
|
[license-shield]: https://img.shields.io/github/license/ageerle/ruoyi-ai.svg?style=flat-square
|
||||||
|
[license-url]: https://github.com/ageerle/ruoyi-ai/blob/main/LICENSE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BIN
image/01.png
|
Before Width: | Height: | Size: 232 KiB |
BIN
image/02.png
|
Before Width: | Height: | Size: 329 KiB |
BIN
image/03.png
|
Before Width: | Height: | Size: 123 KiB |
BIN
image/04.png
|
Before Width: | Height: | Size: 127 KiB |
BIN
image/05.png
|
Before Width: | Height: | Size: 129 KiB |
BIN
image/06.png
|
Before Width: | Height: | Size: 284 KiB |
BIN
image/07.png
|
Before Width: | Height: | Size: 674 KiB |
BIN
image/08.png
|
Before Width: | Height: | Size: 35 KiB |
BIN
image/09.png
|
Before Width: | Height: | Size: 100 KiB |
BIN
image/10.png
|
Before Width: | Height: | Size: 65 KiB |
BIN
image/11.png
|
Before Width: | Height: | Size: 26 KiB |
BIN
image/12.png
|
Before Width: | Height: | Size: 95 KiB |
BIN
image/13.png
|
Before Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 310 KiB |
BIN
image/mcp-01.png
|
Before Width: | Height: | Size: 227 KiB |
BIN
image/mcp-02.png
|
Before Width: | Height: | Size: 251 KiB |
BIN
image/mcp-03.png
|
Before Width: | Height: | Size: 189 KiB |
BIN
image/mcp-04.png
|
Before Width: | Height: | Size: 152 KiB |
BIN
image/qq-msg.png
|
Before Width: | Height: | Size: 391 KiB |
BIN
image/qq.png
Normal file
|
After Width: | Height: | Size: 267 KiB |
BIN
image/wx-msg.png
|
Before Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 148 KiB |
BIN
image/wx.png
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
image/小助手wx.png
|
Before Width: | Height: | Size: 302 KiB |
BIN
image/教程搭建.png
|
Before Width: | Height: | Size: 341 KiB |
11
pom.xml
@@ -54,10 +54,6 @@
|
|||||||
<maven-compiler-plugin.verison>3.11.0</maven-compiler-plugin.verison>
|
<maven-compiler-plugin.verison>3.11.0</maven-compiler-plugin.verison>
|
||||||
<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
|
<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
|
||||||
<flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
|
<flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
|
||||||
<weixin-java-miniapp.version>4.5.0</weixin-java-miniapp.version>
|
|
||||||
<weixin-java-pay.version>4.6.0</weixin-java-pay.version>
|
|
||||||
<weixin-java-cp.version>4.6.0</weixin-java-cp.version>
|
|
||||||
<weixin-java-cp.version>4.6.0</weixin-java-cp.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
@@ -336,13 +332,6 @@
|
|||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-wechat</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|||||||
@@ -57,11 +57,6 @@
|
|||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-wechat</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package org.ruoyi;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动程序
|
* 启动程序
|
||||||
@@ -10,6 +12,8 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt
|
|||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
|
@EnableAsync
|
||||||
public class RuoYiAIApplication {
|
public class RuoYiAIApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -2,21 +2,16 @@ package org.ruoyi.controller;
|
|||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.ruoyi.common.core.constant.Constants;
|
import org.ruoyi.common.core.constant.Constants;
|
||||||
import org.ruoyi.common.core.domain.R;
|
import org.ruoyi.common.core.domain.R;
|
||||||
import org.ruoyi.common.core.domain.model.EmailLoginBody;
|
import org.ruoyi.common.core.domain.model.*;
|
||||||
import org.ruoyi.common.core.domain.model.LoginBody;
|
|
||||||
import org.ruoyi.common.core.domain.model.RegisterBody;
|
|
||||||
import org.ruoyi.common.core.domain.model.SmsLoginBody;
|
|
||||||
import org.ruoyi.common.core.domain.model.VisitorLoginBody;
|
|
||||||
import org.ruoyi.common.core.utils.MapstructUtils;
|
import org.ruoyi.common.core.utils.MapstructUtils;
|
||||||
import org.ruoyi.common.core.utils.StreamUtils;
|
import org.ruoyi.common.core.utils.StreamUtils;
|
||||||
import org.ruoyi.common.core.utils.StringUtils;
|
import org.ruoyi.common.core.utils.StringUtils;
|
||||||
import org.ruoyi.common.satoken.utils.LoginHelper;
|
import org.ruoyi.common.satoken.utils.LoginHelper;
|
||||||
import org.ruoyi.common.tenant.helper.TenantHelper;
|
import org.ruoyi.common.tenant.helper.TenantHelper;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.ruoyi.system.domain.bo.SysTenantBo;
|
import org.ruoyi.system.domain.bo.SysTenantBo;
|
||||||
import org.ruoyi.system.domain.vo.LoginTenantVo;
|
import org.ruoyi.system.domain.vo.LoginTenantVo;
|
||||||
import org.ruoyi.system.domain.vo.LoginVo;
|
import org.ruoyi.system.domain.vo.LoginVo;
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ import cn.hutool.captcha.AbstractCaptcha;
|
|||||||
import cn.hutool.captcha.generator.CodeGenerator;
|
import cn.hutool.captcha.generator.CodeGenerator;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.ruoyi.common.core.constant.Constants;
|
import org.ruoyi.common.core.constant.Constants;
|
||||||
import org.ruoyi.common.core.constant.GlobalConstants;
|
import org.ruoyi.common.core.constant.GlobalConstants;
|
||||||
import org.ruoyi.common.core.domain.R;
|
import org.ruoyi.common.core.domain.R;
|
||||||
import org.ruoyi.common.core.exception.ServiceException;
|
|
||||||
import org.ruoyi.common.core.service.ConfigService;
|
import org.ruoyi.common.core.service.ConfigService;
|
||||||
import org.ruoyi.common.core.utils.SpringUtils;
|
import org.ruoyi.common.core.utils.SpringUtils;
|
||||||
import org.ruoyi.common.core.utils.StringUtils;
|
import org.ruoyi.common.core.utils.StringUtils;
|
||||||
@@ -22,10 +25,6 @@ import org.ruoyi.common.web.config.properties.CaptchaProperties;
|
|||||||
import org.ruoyi.common.web.enums.CaptchaType;
|
import org.ruoyi.common.web.enums.CaptchaType;
|
||||||
import org.ruoyi.system.domain.request.EmailRequest;
|
import org.ruoyi.system.domain.request.EmailRequest;
|
||||||
import org.ruoyi.system.domain.vo.CaptchaVo;
|
import org.ruoyi.system.domain.vo.CaptchaVo;
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.expression.Expression;
|
import org.springframework.expression.Expression;
|
||||||
import org.springframework.expression.ExpressionParser;
|
import org.springframework.expression.ExpressionParser;
|
||||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||||
@@ -36,7 +35,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码操作处理
|
* 验证码操作处理
|
||||||
@@ -67,7 +67,7 @@ public class CaptchaController {
|
|||||||
String key = GlobalConstants.CAPTCHA_CODE_KEY + phonenumber;
|
String key = GlobalConstants.CAPTCHA_CODE_KEY + phonenumber;
|
||||||
String code = RandomUtil.randomNumbers(4);
|
String code = RandomUtil.randomNumbers(4);
|
||||||
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||||
// 验证码模板id 自行处理 (查数据库或写死均可)
|
// 验证码模板id
|
||||||
String templateId = "";
|
String templateId = "";
|
||||||
Map<String, String> map = new HashMap<>(1);
|
Map<String, String> map = new HashMap<>(1);
|
||||||
map.put("code", code);
|
map.put("code", code);
|
||||||
@@ -90,18 +90,6 @@ public class CaptchaController {
|
|||||||
String key = GlobalConstants.CAPTCHA_CODE_KEY + emailRequest.getUsername();
|
String key = GlobalConstants.CAPTCHA_CODE_KEY + emailRequest.getUsername();
|
||||||
String code = RandomUtil.randomNumbers(4);
|
String code = RandomUtil.randomNumbers(4);
|
||||||
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||||
// 检验邮箱后缀
|
|
||||||
String suffix = configService.getConfigValue("mail", "suffix");
|
|
||||||
String prompt = configService.getConfigValue("mail", "prompt");
|
|
||||||
if(StringUtils.isNotEmpty(suffix)){
|
|
||||||
// 动态的域名列表
|
|
||||||
String[] invalidDomains = suffix.split(",");
|
|
||||||
for (String domain : invalidDomains) {
|
|
||||||
if (emailRequest.getUsername().endsWith(domain)) {
|
|
||||||
throw new ServiceException(prompt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 自定义邮箱模板
|
// 自定义邮箱模板
|
||||||
String model = configService.getConfigValue("mail", "mailModel");
|
String model = configService.getConfigValue("mail", "mailModel");
|
||||||
String mailTitle = configService.getConfigValue("mail", "mailTitle");
|
String mailTitle = configService.getConfigValue("mail", "mailTitle");
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
--- # 监控中心配置
|
|
||||||
spring.boot.admin.client:
|
|
||||||
# 增加客户端开关
|
|
||||||
enabled: false
|
|
||||||
url: http://localhost:9090/admin
|
|
||||||
instance:
|
|
||||||
service-host-type: IP
|
|
||||||
username: ruoyi
|
|
||||||
password: 123456
|
|
||||||
|
|
||||||
--- # 数据源配置
|
--- # 数据源配置
|
||||||
spring:
|
spring:
|
||||||
@@ -25,9 +16,9 @@ spring:
|
|||||||
master:
|
master:
|
||||||
type: ${spring.datasource.type}
|
type: ${spring.datasource.type}
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://127.0.0.1:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
username: ry-vue
|
username: ruoyi-ai
|
||||||
password: xx
|
password: ruoyi-ai
|
||||||
|
|
||||||
hikari:
|
hikari:
|
||||||
# 最大连接池数量
|
# 最大连接池数量
|
||||||
@@ -94,3 +85,4 @@ sms:
|
|||||||
# 腾讯专用
|
# 腾讯专用
|
||||||
sdkAppId:
|
sdkAppId:
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ server:
|
|||||||
# 日志配置
|
# 日志配置
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
org.dromara: @logging.level@
|
org.ruoyi: @logging.level@
|
||||||
org.springframework: warn
|
org.springframework: warn
|
||||||
org.mybatis.spring.mapper: error
|
org.mybatis.spring.mapper: error
|
||||||
org.apache.fury: warn
|
org.apache.fury: warn
|
||||||
@@ -120,6 +120,8 @@ sa-token:
|
|||||||
security:
|
security:
|
||||||
# 排除路径
|
# 排除路径
|
||||||
excludes:
|
excludes:
|
||||||
|
# 获取模型信息
|
||||||
|
- /system/model/modelList
|
||||||
# 支付回调
|
# 支付回调
|
||||||
- /pay/returnUrl
|
- /pay/returnUrl
|
||||||
- /pay/notifyUrl
|
- /pay/notifyUrl
|
||||||
@@ -128,7 +130,9 @@ security:
|
|||||||
# 重置密码
|
# 重置密码
|
||||||
- /auth/reset/password
|
- /auth/reset/password
|
||||||
# 聊天接口
|
# 聊天接口
|
||||||
- /chat
|
- /chat/send
|
||||||
|
# 文件上传
|
||||||
|
- /chat/upload
|
||||||
# 静态资源
|
# 静态资源
|
||||||
- /*.html
|
- /*.html
|
||||||
- /**/*.html
|
- /**/*.html
|
||||||
@@ -291,26 +295,6 @@ websocket:
|
|||||||
# 设置访问源地址
|
# 设置访问源地址
|
||||||
allowedOrigins: '*'
|
allowedOrigins: '*'
|
||||||
|
|
||||||
# 微信小程序配置信息
|
|
||||||
wx:
|
|
||||||
miniapp:
|
|
||||||
configs:
|
|
||||||
- appid: # 你的appid
|
|
||||||
secret: # 你的secret
|
|
||||||
token: #微信小程序消息服务器配置的token
|
|
||||||
aesKey: #微信小程序消息服务器配置的EncodingAESKey
|
|
||||||
msgDataFormat: JSON
|
|
||||||
|
|
||||||
# 企业微信应用
|
|
||||||
wechat:
|
|
||||||
cp:
|
|
||||||
corpId:
|
|
||||||
appConfigs:
|
|
||||||
- agentId:
|
|
||||||
secret: ''
|
|
||||||
token: ''
|
|
||||||
aesKey: ''
|
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
ai:
|
ai:
|
||||||
openai:
|
openai:
|
||||||
|
|||||||
@@ -39,9 +39,7 @@
|
|||||||
<module>ruoyi-common-encrypt</module>
|
<module>ruoyi-common-encrypt</module>
|
||||||
<module>ruoyi-common-tenant</module>
|
<module>ruoyi-common-tenant</module>
|
||||||
<module>ruoyi-common-chat</module>
|
<module>ruoyi-common-chat</module>
|
||||||
<module>ruoyi-common-wechat</module>
|
|
||||||
<module>ruoyi-common-pay</module>
|
<module>ruoyi-common-pay</module>
|
||||||
<module>ruoyi-common-live</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package org.ruoyi.common.chat.entity.chat;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
@Data
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class FastGPTAnswerResponse {
|
||||||
|
private String id;
|
||||||
|
private String object;
|
||||||
|
private long created;
|
||||||
|
private String model;
|
||||||
|
private List<FastGPTChatChoice> choices;
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package tech.ordinaryroad.live.chat.client.douyu.client;
|
package org.ruoyi.common.chat.entity.chat;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
@@ -6,15 +6,9 @@ import lombok.Data;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @author https:www.unfbx.com
|
|
||||||
* @since 2023-03-02
|
|
||||||
*/
|
|
||||||
@Data
|
@Data
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class ChatChoice implements Serializable {
|
public class FastGPTChatChoice implements Serializable {
|
||||||
private long index;
|
private long index;
|
||||||
/**
|
/**
|
||||||
* 请求参数stream为true返回是delta
|
* 请求参数stream为true返回是delta
|
||||||
@@ -28,4 +22,4 @@ public class ChatChoice implements Serializable {
|
|||||||
private Message message;
|
private Message message;
|
||||||
@JsonProperty("finish_reason")
|
@JsonProperty("finish_reason")
|
||||||
private String finishReason;
|
private String finishReason;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package org.ruoyi.common.chat.entity.chat;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FastGPTChatCompletion extends ChatCompletion implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否使用FastGPT提供的上下文
|
||||||
|
*/
|
||||||
|
private String chatId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否返回详细信息;stream模式下会通过event进行区分,非stream模式结果保存在responseData中.
|
||||||
|
*/
|
||||||
|
private boolean detail;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行时变量
|
||||||
|
* 模块变量,一个对象,会替换模块中,输入fastgpt框内容里的{{key}}
|
||||||
|
*/
|
||||||
|
private Variables variables;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* responseChatItemId: string | undefined 。
|
||||||
|
* 如果传入,则会将该值作为本次对话的响应消息的 ID,
|
||||||
|
* FastGPT 会自动将该 ID 存入数据库。请确保,
|
||||||
|
* 在当前chatId下,responseChatItemId是唯一的。
|
||||||
|
*/
|
||||||
|
private String responseChatItemId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package org.ruoyi.common.chat.entity.chat;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class Variables implements Serializable {
|
||||||
|
|
||||||
|
private String uid;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
}
|
||||||
@@ -7,9 +7,7 @@ import okhttp3.Response;
|
|||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
import okhttp3.sse.EventSource;
|
import okhttp3.sse.EventSource;
|
||||||
import okhttp3.sse.EventSourceListener;
|
import okhttp3.sse.EventSourceListener;
|
||||||
import org.ruoyi.common.chat.constant.OpenAIConst;
|
|
||||||
import org.ruoyi.common.chat.entity.chat.ChatCompletionResponse;
|
import org.ruoyi.common.chat.entity.chat.ChatCompletionResponse;
|
||||||
import org.ruoyi.common.chat.entity.chat.Message;
|
|
||||||
import org.springframework.web.socket.TextMessage;
|
import org.springframework.web.socket.TextMessage;
|
||||||
import org.springframework.web.socket.WebSocketSession;
|
import org.springframework.web.socket.WebSocketSession;
|
||||||
|
|
||||||
@@ -63,7 +61,7 @@ public class WebSocketEventListener extends EventSourceListener {
|
|||||||
delta = mapper.writeValueAsString(completionResponse.getChoices().get(0).getDelta());
|
delta = mapper.writeValueAsString(completionResponse.getChoices().get(0).getDelta());
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("转换失败{}",e.getMessage());
|
log.error("转换失败{}",e.getMessage());
|
||||||
}
|
}
|
||||||
session.sendMessage(new TextMessage(delta));
|
session.sendMessage(new TextMessage(delta));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import okhttp3.MediaType;
|
|||||||
import okhttp3.MultipartBody;
|
import okhttp3.MultipartBody;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.ruoyi.common.chat.constant.OpenAIConst;
|
import org.ruoyi.common.chat.constant.OpenAIConst;
|
||||||
import org.ruoyi.common.chat.entity.billing.BillingUsage;
|
import org.ruoyi.common.chat.entity.billing.BillingUsage;
|
||||||
import org.ruoyi.common.chat.entity.billing.Subscription;
|
import org.ruoyi.common.chat.entity.billing.Subscription;
|
||||||
@@ -45,7 +46,6 @@ import org.ruoyi.common.chat.openai.interceptor.OpenAiAuthInterceptor;
|
|||||||
import org.ruoyi.common.chat.openai.plugin.PluginAbstract;
|
import org.ruoyi.common.chat.openai.plugin.PluginAbstract;
|
||||||
import org.ruoyi.common.chat.openai.plugin.PluginParam;
|
import org.ruoyi.common.chat.openai.plugin.PluginParam;
|
||||||
import org.ruoyi.common.core.exception.base.BaseException;
|
import org.ruoyi.common.core.exception.base.BaseException;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||||
import retrofit2.converter.jackson.JacksonConverterFactory;
|
import retrofit2.converter.jackson.JacksonConverterFactory;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import okhttp3.*;
|
|||||||
import okhttp3.sse.EventSource;
|
import okhttp3.sse.EventSource;
|
||||||
import okhttp3.sse.EventSourceListener;
|
import okhttp3.sse.EventSourceListener;
|
||||||
import okhttp3.sse.EventSources;
|
import okhttp3.sse.EventSources;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.ruoyi.common.chat.constant.OpenAIConst;
|
import org.ruoyi.common.chat.constant.OpenAIConst;
|
||||||
import org.ruoyi.common.chat.entity.Tts.TextToSpeech;
|
import org.ruoyi.common.chat.entity.Tts.TextToSpeech;
|
||||||
import org.ruoyi.common.chat.entity.billing.BillingUsage;
|
import org.ruoyi.common.chat.entity.billing.BillingUsage;
|
||||||
@@ -27,7 +28,6 @@ import org.ruoyi.common.chat.entity.images.ImageResponse;
|
|||||||
import org.ruoyi.common.chat.entity.models.Model;
|
import org.ruoyi.common.chat.entity.models.Model;
|
||||||
import org.ruoyi.common.chat.entity.models.ModelResponse;
|
import org.ruoyi.common.chat.entity.models.ModelResponse;
|
||||||
import org.ruoyi.common.chat.entity.whisper.Transcriptions;
|
import org.ruoyi.common.chat.entity.whisper.Transcriptions;
|
||||||
import org.ruoyi.common.chat.entity.whisper.Translations;
|
|
||||||
import org.ruoyi.common.chat.entity.whisper.WhisperResponse;
|
import org.ruoyi.common.chat.entity.whisper.WhisperResponse;
|
||||||
import org.ruoyi.common.chat.openai.exception.CommonError;
|
import org.ruoyi.common.chat.openai.exception.CommonError;
|
||||||
import org.ruoyi.common.chat.openai.function.KeyRandomStrategy;
|
import org.ruoyi.common.chat.openai.function.KeyRandomStrategy;
|
||||||
@@ -40,7 +40,6 @@ import org.ruoyi.common.chat.openai.plugin.PluginParam;
|
|||||||
import org.ruoyi.common.chat.sse.DefaultPluginListener;
|
import org.ruoyi.common.chat.sse.DefaultPluginListener;
|
||||||
import org.ruoyi.common.chat.sse.PluginListener;
|
import org.ruoyi.common.chat.sse.PluginListener;
|
||||||
import org.ruoyi.common.core.exception.base.BaseException;
|
import org.ruoyi.common.core.exception.base.BaseException;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||||
@@ -145,13 +144,15 @@ public class OpenAiStreamClient {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
okHttpClient = builder.okHttpClient;
|
okHttpClient = builder.okHttpClient;
|
||||||
|
if (apiHost.endsWith("/")) {
|
||||||
|
this.openAiApi = new Retrofit.Builder()
|
||||||
|
.baseUrl(apiHost)
|
||||||
|
.client(okHttpClient)
|
||||||
|
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
|
||||||
|
.addConverterFactory(JacksonConverterFactory.create())
|
||||||
|
.build().create(OpenAiApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
// this.openAiApi = new Retrofit.Builder()
|
|
||||||
// .baseUrl(apiHost)
|
|
||||||
// .client(okHttpClient)
|
|
||||||
// .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
|
|
||||||
// .addConverterFactory(JacksonConverterFactory.create())
|
|
||||||
// .build().create(OpenAiApi.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,16 +36,6 @@ public class ChatRequest {
|
|||||||
*/
|
*/
|
||||||
private Boolean stream = Boolean.TRUE;
|
private Boolean stream = Boolean.TRUE;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否开启联网搜索(0关闭 1开启)
|
|
||||||
*/
|
|
||||||
private Boolean search = Boolean.FALSE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否开启mcp
|
|
||||||
*/
|
|
||||||
private Boolean isMcp = Boolean.FALSE;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 知识库id
|
* 知识库id
|
||||||
*/
|
*/
|
||||||
@@ -56,7 +46,6 @@ public class ChatRequest {
|
|||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会话id
|
* 会话id
|
||||||
*/
|
*/
|
||||||
@@ -68,14 +57,14 @@ public class ChatRequest {
|
|||||||
private String appId;
|
private String appId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上下文的条数
|
* 对话角色
|
||||||
*/
|
*/
|
||||||
private Integer contentNumber = 10;
|
private String role;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否携带上下文
|
* 对话id(每个聊天窗口都不一样)
|
||||||
*/
|
*/
|
||||||
private Boolean usingContext = Boolean.TRUE;
|
private Long uuid;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package org.ruoyi.common.chat.sse;
|
package org.ruoyi.common.chat.sse;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import okhttp3.sse.EventSourceListener;
|
import okhttp3.sse.EventSourceListener;
|
||||||
import org.ruoyi.common.chat.entity.chat.ChatCompletion;
|
import org.ruoyi.common.chat.entity.chat.ChatCompletion;
|
||||||
import org.ruoyi.common.chat.openai.OpenAiStreamClient;
|
import org.ruoyi.common.chat.openai.OpenAiStreamClient;
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import com.knuddels.jtokkit.api.EncodingRegistry;
|
|||||||
import com.knuddels.jtokkit.api.EncodingType;
|
import com.knuddels.jtokkit.api.EncodingType;
|
||||||
import com.knuddels.jtokkit.api.ModelType;
|
import com.knuddels.jtokkit.api.ModelType;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.ruoyi.common.chat.entity.chat.ChatCompletion;
|
import org.ruoyi.common.chat.entity.chat.ChatCompletion;
|
||||||
import org.ruoyi.common.chat.entity.chat.FunctionCall;
|
import org.ruoyi.common.chat.entity.chat.FunctionCall;
|
||||||
import org.ruoyi.common.chat.entity.chat.Message;
|
import org.ruoyi.common.chat.entity.chat.Message;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|||||||
@@ -82,24 +82,6 @@
|
|||||||
<artifactId>ip2region</artifactId>
|
<artifactId>ip2region</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.binarywang</groupId>
|
|
||||||
<artifactId>weixin-java-cp</artifactId>
|
|
||||||
<version>${weixin-java-cp.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.binarywang</groupId>
|
|
||||||
<artifactId>weixin-java-miniapp</artifactId>
|
|
||||||
<version>${weixin-java-miniapp.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.binarywang</groupId>
|
|
||||||
<artifactId>weixin-java-pay</artifactId>
|
|
||||||
<version>${weixin-java-pay.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- JSON工具类 -->
|
<!-- JSON工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package org.ruoyi.common.core.factory;
|
|||||||
import cn.hutool.core.lang.PatternPool;
|
import cn.hutool.core.lang.PatternPool;
|
||||||
import org.ruoyi.common.core.constant.RegexConstants;
|
import org.ruoyi.common.core.constant.RegexConstants;
|
||||||
|
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.ruoyi.common.core.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 基于ThreadLocal封装工具类,用户保存和获取当前登录用户Sa-Token token值
|
||||||
|
* @author: yzm
|
||||||
|
**/
|
||||||
|
public class BaseContext {
|
||||||
|
private static ThreadLocal<String> threadLocal = new ThreadLocal<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 设置值
|
||||||
|
* @author: yzm
|
||||||
|
* @param: [token] 线程token
|
||||||
|
**/
|
||||||
|
public static void setCurrentToken(String token){
|
||||||
|
threadLocal.set(token);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description: 获取值
|
||||||
|
* @author: yzm
|
||||||
|
**/
|
||||||
|
public static String getCurrentToken(){
|
||||||
|
return threadLocal.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,9 +4,9 @@ import cn.hutool.core.io.FileUtil;
|
|||||||
import cn.hutool.core.io.resource.ClassPathResource;
|
import cn.hutool.core.io.resource.ClassPathResource;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.lionsoul.ip2region.xdb.Searcher;
|
||||||
import org.ruoyi.common.core.exception.ServiceException;
|
import org.ruoyi.common.core.exception.ServiceException;
|
||||||
import org.ruoyi.common.core.utils.file.FileUtils;
|
import org.ruoyi.common.core.utils.file.FileUtils;
|
||||||
import org.lionsoul.ip2region.xdb.Searcher;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
|||||||