feat: 支持 accessToken 请求 web api 调用 (#80)

* feat: 支持 markdown 格式和图片

* perf: 重载的时候滚动条保持

* chore: version 2.5.2

* feat: 添加文字换行

* chore: 添加新封面

* chore: 更新 cover

* feat: 支持 web api 的形式

* feat: 支持新模型和调整超时

* feat: 添加反向代理

* chore: 更新 README.md

* feat: 添加超时和反向代理显示

* chore: version 2.6.0

* chore: update README
This commit is contained in:
Redon
2023-02-21 15:26:23 +08:00
committed by GitHub
parent ac9536ab87
commit f40048fb08
18 changed files with 236 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
import express from 'express'
import type { ChatContext } from './chatgpt'
import { chatReply } from './chatgpt'
import { chatConfig, chatReply } from './chatgpt'
const app = express()
const router = express.Router()
@@ -26,6 +26,16 @@ router.post('/chat', async (req, res) => {
}
})
router.post('/config', async (req, res) => {
try {
const response = await chatConfig()
res.send(response)
}
catch (error) {
res.send(error)
}
})
app.use('', router)
app.use('/api', router)