1 Star 1 Fork 6

RLwater / ai-beehive

forked from hncboy / ai-beehive 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

ai-beehive

介绍

  • chatgpt-web-java 2.0 版本,更名为 ai-beehive(爱蜂巢、AI 蜂巢),体验站:https://front.aibeehive.icu
  • chatgpt-web-java 1.0 最终版分支地址,体验地址:https://front3.stargpt.top/#/
  • 前端开发:https://github.com/mjjh1717
  • 前端项目地址:https://github.com/mjjh1717/chatgpt-shuowen
  • 描述:ai-beehive 项目的名字取自蜂巢,这源于我们构建房间的方式,即通过图纸塑造出独特的模块化房间,每个房间都是一个具有个性的聊天室,类似于蜂巢中的单独蜂窝。六边形的蜂窝设计启示我们,系统具有无限的扩展能力。在我们的 ai-beehive项目中,我们提供了一种方式,即通过添加新的图纸来扩展和丰富房间类型.

框架

部署运行

  • 数据库在 beehive-bootstrap/src/main/resources/db/schema-mysql.sql
  • 数据库中存在默认的账号密码是 hellobee@aibeehive.icu——123456
  • 部署运行方式待完善 ing......,Java 开发者运行应该不成问题
  • 先安装 MySQL 和 Redis

IDEA 运行

  • 待更新......

功能介绍

登录注册

1.邮箱登录注册

使用 satoken 实现 token 存储,token 目前存在 redis

1

2.权限校验

  • 增加登录和注册邮箱后缀校验,可以选择允许哪种邮箱后缀的邮箱登录

  • 增加是否开启注册,未开启情况下不允许注册

  • 增加注册审核,开启后,用户注册完状态为待审核,需管理员将用户的状态改为通过才可登录

  • 增加用户登录状态,包含禁止登录、待审核以及正常。禁止登录状态的用户无法登录,可以通过移除 Redis 用户 Token 强制退出。

3.相关参数

通过 bh_sys_param 表的 email-registerLoginConfig param key 实现控制

{
	"registerVerificationRedirectUrl": "http://localhost:1002/#/emailValidation?type=email&verifyCode=",
	"registerVerifyCodeExpireMinutes": "验证码过期时间(分钟)",
	"registerTemplateSubject": "邮件标题",
	"registerAllowSuffix": "@qq.com,*",  // 允许注册的邮箱后缀,多个用逗号分隔
	"registerEnabled": true,         // 是否开启注册
	"loginAllowSuffix": "@qq.com,*", // 允许登录的邮箱后缀,多个用逗号分隔
	"registerCheckEnabled": true // 是否开启注册审核
}

图纸管理

  • 目前已经实现的图纸有 OpenAi GPT 3.5、OpenAi GPT 4、官网 ChatGPT 3.5、、官网 ChatGPT 4、OpenAi Image 绘图、Midjourney、NewBing,可能存在一些问题待修复。图纸和配置项管理目前都得手动改数据库。

图纸状态

  • 包含了图纸的状态,不同图纸对应前端的展示不一样,只有 published 状态的图纸才可以被使用,如果图纸状态不为 published,那么就算是已经创建好的房间也无法发送内容。用于图纸出现问题时可以即使停止使用。

图纸权限

  • 基于 published 状态的图纸可以控制权限,分配哪些用户可以使用图纸或者全体用户都可以使用,通过 bh_cell_permission 表控制
  • cell_code 表示图纸编码,type 表示权限类型,1 表示浏览权限 2 表示使用权限,权限 2 包含 1。浏览权限表示能看到图纸,使用权限表示可以使用状态为 published 的图纸。user_id 为 0 表示任意用于都拥有该权限。
类型 Not Null 注释
id bigint true 主键
user_id int true 用户 id
cell_code varchar true cell code
type tinyint true 类型
create_time datetime true 创建时间
update_time datetime true 更新时间

图纸配置项管理

  • 每种图纸都拥有其配置项,配置项是在数据库维护,基本图纸的所有参数都可以存在配置项表里,初始化 SQL 中包含了已使用到的一些图纸配置项。
  • 配置项表的字段有点多,每个配置项也可以配置权限,不过因为配置项有点多,所以用到情况应该很少。
  • 配置项样式后续更新,房间编辑配置项功能后续更新。
  • 配置项支持配置默认值、是否必填、用户是否可以使用默认值、用户是否可见、用户是否可见默认值、用户是否可修改、用户创建房间后是否可修改等等。
  • 后续更新......

房间类型

Midjourney

Imagine

文生图功能,默认从输入框发送的消息就是 imagine 指令,需要输入英文提示词,过程中会显示进度条。如果输入非法内容,不会有提示,此时消息相当于异常,通过定时任务重置任务状态。默认展示的图片是缩放的,减少流量传输,有需要时点击查看原图。

Upscale

放大其中一张图片,Imagine 生成的图片 Upscale 只能点一次,不能重复点击

Variation

基于一张图片生成新的四张图片

Describe

图生文

点击图标上传图片

会生成四句提示语,1234 四个选项分别代表这四句提示语,点击即可自动将对应的提示语发送 Imagine 消息

OpenAi Image

  • 图生文的功能,直接输入提示语

OpenAi GPT 3.5 & 4

  • 将调用 OpenAi 接口的所有参数都封装成了配置项,可以根据情况是否让用户可配置参数

官网 ChatGPT

  • 与原先相比增加了返回值错误的类型判断

NewBing

  • 本地可行,线上不可行,查找问题修复中

计划功能

  • 管理端图纸管理、图纸配置项管理
  • 其他图纸,文心一眼、通义千问、chatglm 等等
  • 绘图的图片画廊
  • 配置项样式处理,openai 的提示词商店
  • 等等

实现方案

  • 增加了 OpenAi ApiKey 轮询
  • 待更新......,

联系方式

加群添加微信备注 Github

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

AI 蜂巢,基于 Java 使用 Spring Boot 3 和 JDK 17,支持的功能有 ChatGPT、OpenAi Image、Midjourney、NewBing 等等 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/RLwater/ai-beehive.git
git@gitee.com:RLwater/ai-beehive.git
RLwater
ai-beehive
ai-beehive
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891