Skip to content

Commit

Permalink
## [0.2.3] - 2023-11-7
Browse files Browse the repository at this point in the history
### Changed
- 新增OpenAI最新模型支持:gpt-3.5-turbo-1106
- 增加OpenAI TTS模型语音朗读回复功能及相关设置

### Fixed
- 修复无法保存配置的问题
- 修复无法弹出MessageBox的问题
- 修复使用"分割对话"命令后的当前对话无法关联的问题
  • Loading branch information
danger-dream committed Nov 7, 2023
1 parent 0b1bdc3 commit 8f67419
Show file tree
Hide file tree
Showing 17 changed files with 452 additions and 104 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ release
*.local
build
config.ts
audios

# Editor directories and files
.vscode/.debug.env
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file.

## [0.2.3] - 2023-11-7

### Changed
- 新增OpenAI最新模型支持:gpt-3.5-turbo-1106
- 增加OpenAI TTS模型语音朗读回复功能及相关设置

### Fixed
- 修复无法保存配置的问题
- 修复无法弹出MessageBox的问题
- 修复使用"分割对话"命令后的当前对话无法关联的问题

## [0.2.2] - 2023-11-7

### Changed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ desktop chatai plus 是一个高效、轻量级的桌面版AI工具,为用户
- **即将到来的功能**:web检索、图文对话、文档问答、图片生成、语音交互等。

## 截图
![7.png](images/7.png)
![1.png](./images/1.png)
![2.png](images/2.png)
![3.png](images/3.png)
Expand Down
31 changes: 11 additions & 20 deletions electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,16 @@ function platformIntegration(win) {
ipcMain.handle('os:writeFile', async (e, path, data) => {
try {
if (!path || !data) return false
fs.writeFileSync(path, typeof data === 'string' || Buffer.isBuffer(data) ? data : JSON.stringify(data))
} catch {
return false
}
})

ipcMain.handle('os:writeJSONFile', async (e, path, data, beautify) => {
try {
if (!path || !data) return false
fs.writeFileSync(path, typeof data === 'string' || Buffer.isBuffer(data) ? data : (beautify ? JSON.stringify(data, null, '\t') : JSON.stringify(data)))
let buf
if (typeof data === 'string' || Buffer.isBuffer(data)) {
buf = data
} else if (data instanceof ArrayBuffer) {
buf = Buffer.from(data)
} else {
buf = JSON.stringify(data, undefined, '\t')
}
fs.writeFileSync(path, buf)
return true
} catch {
return false
}
Expand All @@ -124,15 +124,6 @@ function platformIntegration(win) {
return fs.readFileSync(path, encoding)
})

ipcMain.handle('os:readJSONFile', async (e, path) => {
if (!path || !fs.existsSync(path) || fs.statSync(path).isDirectory()) return ''
try {
return JSON.parse(fs.readFileSync(path, 'utf8'))
} catch {
return ''
}
})

ipcMain.handle('os:exists', async (e, path) => {
return path && fs.existsSync(path)
})
Expand Down Expand Up @@ -206,7 +197,7 @@ function platformIntegration(win) {
dialog.showErrorBox(title, content)
})

ipcMain.handle('os:showMessageBox', async (e, title, content, type, buttons) => {
ipcMain.handle('os:showMessageBox', async (e, title, content, type = 'info', buttons = []) => {
return dialog.showMessageBox({
title,
message: content,
Expand Down
5 changes: 1 addition & 4 deletions electron/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ contextBridge.exposeInMainWorld('__electron_', {
readFile: async (path, encoding = 'utf8') => {
return await ipcRenderer.invoke('os:readFile', path, encoding)
},
readJSONFile: async (path) => {
return await ipcRenderer.invoke('os:readJSONFile', path)
},
exists: async (path) => {
return await ipcRenderer.invoke('os:exists', path)
},
Expand All @@ -34,7 +31,7 @@ contextBridge.exposeInMainWorld('__electron_', {
showErrorBox: async (title, content) => {
return await ipcRenderer.invoke('os:showErrorBox', title, content)
},
showMessageBox: async (title, content, type = '', buttons = []) => {
showMessageBox: async (title, content, type = 'info', buttons = []) => {
return await ipcRenderer.invoke('os:showMessageBox', title, content, type, buttons)
},
showOpenDialog: async (opts = {}) => {
Expand Down
Binary file added images/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "desktop-chatai-plus",
"version": "0.2.2",
"version": "0.2.3",
"main": "dist-electron/index.js",
"description": "Desktop ChatAI Plus",
"private": true,
Expand Down
Loading

0 comments on commit 8f67419

Please sign in to comment.