Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
Chat2DB-Pro committed Jun 20, 2023
1 parent a8c0d8d commit c80bd60
Show file tree
Hide file tree
Showing 49 changed files with 2,815 additions and 174 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.css linguist-language=java
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### Visual Studio Code ###
package-lock.json
yarn.lock

### Mac
.DS_Store
/ali-dbhub-server/ali-dbhub-server-start/src/main/resources/static/front/*

### docker 数据不用上传
/docker/redis/data/*
/docker/test/reds/*
/docker/test/mongodb/*
/ali-dbhub-server/ali-dbhub-server-domain/ali-dbhub-server-domain-support/src/main/resources/lib/*
/ali-dbhub-server/ali-dbhub-server-domain/ali-dbhub-server-domain-support/lib/*
/lib
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 1.0.11
* fixed: SQL有特殊字符时AI功能无法正常使用 [Issue #291](https://github.com/alibaba/Chat2DB/issues/291)
* 增减版本信息检测

# 1.0.10
* fixed: 格式化SQL异常[Issue #266](https://github.com/alibaba/Chat2DB/issues/266)
* 优化AI网络连接异常提示
* 自定义AI添加本地样例
* Support OceanBase Presto DB2 Redis MongoDB Hive KingBase

# 1.0.9
* 修复Open Ai 无法连接的问题

Expand Down
16 changes: 12 additions & 4 deletions CHAT2DB_AI_SQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ Chat2DB包含一系列基于ChatGPT的AI SQL使用功能,主要包括自然语
## 使用配置
### 点击设置
<a><img src="https://img.alicdn.com/imgextra/i2/O1CN01hecdtO1acLegtiP9k_!!6000000003350-2-tps-2400-1600.png" width="100%"/></a>
### 配置OPENAI_API_KEY
使用ChatSql功能之前必须配置OPENAI_API_KEY,也可在客户端中设置代理HOST和PORT
<a><img src="https://img.alicdn.com/imgextra/i2/O1CN01mkVmEd1FTY7SBG6Lq_!!6000000000488-0-tps-1212-788.jpg" width="100%"/></a>

### 配置AI
#### 配置OPENAI
使用OPENAI的ChatSql功能需要满足两个条件
- 配置OPENAI_API_KEY,如没有OPENAI_API_KEY可加入答疑群根据群公告指引获取chat2db自定义key
- 客户端网络可以连接到OPENAI官网,如果本地VPN未能全局生效,可以通过在客户端中设置网络代理HOST和PORT来保证网络连通性
<a><img src="https://img.alicdn.com/imgextra/i2/O1CN01anrJMI1FEtSBbmTau_!!6000000000456-0-tps-1594-964.jpg" width="100%"/></a>
#### 配置自定义AI
- 自定义AI可以是用户自己部署的任意AI模型,例如ChatGLM、ChatGPT、文心一言、通义千问等等,但是自定义的接口输入和输出需要符合自定义的协议规范才可快速使用,否则可能需要二次开发。代码中提供了两个DEMO,只需要配置自定义AI接口地址,以及接口是否流式输出即可查看。具体使用中可以参考DEMO接口来编写自定义接口,或者直接在DEMO接口中进行二次开发,封装自己的自定义接口
- 自定义的流式输出接口配置DEMO
<a><img src="https://img.alicdn.com/imgextra/i1/O1CN01xMqnRH1DlkdSekvSF_!!6000000000257-0-tps-591-508.jpg" width="100%"/></a>
- 自定义的非流式输出接口配置DEMO
<a><img src="https://img.alicdn.com/imgextra/i1/O1CN01JqmbGo1fW0GAQhRu4_!!6000000004013-0-tps-587-489.jpg" width="100%"/></a>
## 自然语言转SQL
### 功能描述
输入自然语言,选中执行并传入查询相关的表结构信息,则会返回相应的SQL
Expand Down
66 changes: 66 additions & 0 deletions Chat2DB_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
The Chat2DB License

一、定义

“许可方”是指分发其软件的 Chat2DB 软件团队。

“软件”是指根据本许可提供的 Chat2DB 软件。

2. 许可授予

根据本许可的条款和条件,许可方特此授予您非排他性、全球性、不可转让、不可再许可、可撤销、免版税的版权许可,仅用于您的非商业研究目的。

上述版权声明和本许可声明应包含在本软件的所有副本或重要部分中。

3.限制

您不得出于任何商业、军事或非法目的使用、复制、修改、合并、发布、分发、复制或创建本软件的全部或部分衍生作品。

您不得利用本软件从事任何危害国家安全和国家统一、危害社会公共利益、侵犯人身权益的行为。

4.免责声明

本软件“按原样”提供,不提供任何明示或暗示的保证,包括但不限于对适销性、特定用途的适用性和非侵权性的保证。 在任何情况下,作者或版权持有人均不对任何索赔、损害或其他责任负责,无论是在合同诉讼、侵权行为还是其他方面,由软件或软件的使用或其他交易引起、由软件引起或与之相关 软件。

5. 责任限制

除适用法律禁止的范围外,在任何情况下且根据任何法律理论,无论是基于侵权行为、疏忽、合同、责任或其他原因,任何许可方均不对您承担任何直接、间接、特殊、偶然、示范性、 或间接损害,或任何其他商业损失,即使许可人已被告知此类损害的可能性。

6.争议解决

本许可受中华人民共和国法律管辖并按其解释。 因本许可引起的或与本许可有关的任何争议应提交北京市海淀区人民法院。

请注意,许可证可能会更新到更全面的版本。 有关许可和版权的任何问题,请通过1558143046@qq.com 与我们联系。


1. Definitions

"Licensor" refers to the Chat2DB software team that distributes its software.

"Software" refers to the Chat2DB software provided under this license.

2. License Grant

Subject to the terms and conditions of this License, the Licensor hereby grants to you a non-exclusive, worldwide, non-transferable, non-sublicensable, revocable, royalty-free copyright license to use the Software solely for your non-commercial research purposes.

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

3. Restriction

You will not use, copy, modify, merge, publish, distribute, reproduce, or create derivative works of the Software, in whole or in part, for any commercial, military, or illegal purposes.

You will not use the Software for any act that may undermine China's national security and national unity, harm the public interest of society, or infringe upon the rights and interests of human beings.

4. Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

5. Limitation of Liability

EXCEPT TO THE EXTENT PROHIBITED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER BASED IN TORT, NEGLIGENCE, CONTRACT, LIABILITY, OR OTHERWISE WILL ANY LICENSOR BE LIABLE TO YOU FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES, OR ANY OTHER COMMERCIAL LOSSES, EVEN IF THE LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

6. Dispute Resolution

This license shall be governed and construed in accordance with the laws of People’s Republic of China. Any dispute arising from or in connection with this License shall be submitted to Haidian District People's Court in Beijing.

Note that the license is subject to update to a more comprehensive version. For any questions related to the license and copyright, please contact us at 1558143046@qq.com.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright Pengfei Ji

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit c80bd60

Please sign in to comment.