Skip to content

Commit

Permalink
Merge pull request alibaba#295 from alibaba/developing
Browse files Browse the repository at this point in the history
Developing
  • Loading branch information
Chat2DB-Pro authored Jun 13, 2023
2 parents d10ca9b + 1b967be commit 75bf5c8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 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网络连接异常提示
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ Option 2 (recommended): We provide a unified proxy service.
- No OPENAI_API_KEY is required.
- No proxy or VPN is required, as long as the network is connected.

To facilitate users' quick use of AI capabilities, you can add WeChat ID "yxccw132" to apply for our custom API_KEY. After the application is completed, refer to the following figure for configuration and usage.
To facilitate users' quick use of AI capabilities, you can add WeChat to apply for our custom API_KEY. After the application is completed, refer to the following figure for configuration and usage.
<a><img src="https://img.alicdn.com/imgextra/i2/O1CN01xNobD21mo3B1ILrs2_!!6000000005000-0-tps-592-515.jpg" width="100%"/></a>
WeChat:

<a><img src="https://chat2db.oss-accelerate.aliyuncs.com/static/qiye_weichat.PNG" width="30%"/></a>

### CONFIGURE CUSTOM AI
- Customized AI can be any LLM that you deployed, such as ChatGLM、ChatGPT、ERNIE Bot、Tongyi Qianwen, and so on. However, the customized interface need to conform to the protocol definition. Otherwise, secondary development may be required. Two DEMOs are provided in the code, the configuration is as shown below. In specific use, you can refer to the DEMO interface to write a custom interface, or directly perform secondary development in the DEMO interface.
Expand Down Expand Up @@ -192,7 +195,11 @@ Please star and fork on GitHub before joining the group.
<a><img src="https://chat2db.oss-accelerate.aliyuncs.com/static/dingding_1.PNG" width="40%"/></a>


微信:yxccw132 钉钉:9135032392
WeiChat:

<a><img src="https://chat2db.oss-accelerate.aliyuncs.com/static/qiye_weichat.PNG" width="30%"/></a>

Ding Talk:9135032392

## ❤️ Acknowledgements
Thanks to all the students who contributed to Chat2DB~
Expand Down
11 changes: 9 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ Languages: 中文 [English](README.md)
- 1、不需要opeanAI的key
- 2、不需要代理,不需要VPN只要可以联网即可使用。

为了方便大家更快速的使用AI的能力,可以加微信 yxccw132 申请我们的自定义API_KEY,申请完成之后参考下图进行配置即可进行使用
为了方便大家更快速的使用AI的能力,可以加微信 申请我们的自定义API_KEY,申请完成之后参考下图进行配置即可进行使用
<a><img src="https://img.alicdn.com/imgextra/i2/O1CN01xNobD21mo3B1ILrs2_!!6000000005000-0-tps-592-515.jpg" width="70%"/></a>

微信:

<a><img src="https://chat2db.oss-accelerate.aliyuncs.com/static/qiye_weichat.PNG" width="30%"/></a>


## 📦 Docker部署

Expand Down Expand Up @@ -213,8 +217,11 @@ $ # 注:前端页面完全赖服务,所以前端同学调试也需要把后
<a><img src="https://chat2db.oss-accelerate.aliyuncs.com/static/weichat_2.PNG" width="40%"/></a>
<a><img src="https://chat2db.oss-accelerate.aliyuncs.com/static/dingding_1.PNG" width="40%"/></a>

微信:

<a><img src="https://chat2db.oss-accelerate.aliyuncs.com/static/qiye_weichat.PNG" width="30%"/></a>

微信:yxccw132 钉钉:9135032392
钉钉:9135032392



Expand Down
18 changes: 9 additions & 9 deletions ali-dbhub-client/src/components/DatabaseQuery/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ let monacoEditorExternalList: any = {};
const initModal = {
open: false,
title: '',
handleOk: () => {},
handleCancel: () => {},
handleOk: () => { },
handleCancel: () => { },
content: <></>,
};
export default function DatabaseQuery(props: IProps) {
Expand Down Expand Up @@ -166,7 +166,7 @@ export default function DatabaseQuery(props: IProps) {
myEditorHintData[item.name] = [];
});
monacoHint.current = setEditorHint(myEditorHintData);
} catch {}
} catch { }
};

const getEditor = (editor: any) => {
Expand All @@ -177,8 +177,8 @@ export default function DatabaseQuery(props: IProps) {
localStorage.getItem(
`window-sql-${windowTab.dataSourceId}-${windowTab.databaseName}-${windowTab.consoleId}`,
) ||
windowTab.ddl ||
'',
windowTab.ddl ||
'',
);
};

Expand Down Expand Up @@ -262,7 +262,7 @@ export default function DatabaseQuery(props: IProps) {
const formatValue = () => {
const model = monacoEditor.current.getModel(monacoEditor.current);
const value = model.getValue();
setMonacoValue(monacoEditor.current,format(value, {}))
setMonacoValue(monacoEditor.current, format(value, {}))
};

const onClickChatbot = () => {
Expand Down Expand Up @@ -303,7 +303,7 @@ export default function DatabaseQuery(props: IProps) {
dataSourceId,
databaseName,
promptType,
message: sentence,
message: encodeURIComponent(sentence),
ext,
destSqlType,
}) + tableNames;
Expand Down Expand Up @@ -360,7 +360,7 @@ export default function DatabaseQuery(props: IProps) {
}

const { apiKey } = await configService.getChatGptSystemConfig();
if(!apiKey){
if (!apiKey) {
message.warning('请在设置中配置AI的apiKey!')
return;
}
Expand Down Expand Up @@ -403,7 +403,7 @@ export default function DatabaseQuery(props: IProps) {
label: item.name,
value: item.name,
}));
} catch (error) {}
} catch (error) { }
// --------

setModalConfig({
Expand Down

0 comments on commit 75bf5c8

Please sign in to comment.