优化图片模式发送功能,增加对话队列超时检测 (#188)

* 修复引用转发,默认bing模式并发

* 开启stream增加稳定性

* fix: remove queue element only in non-bing mode

* 使用chatgpt-api自带的超时逻辑,文字过多时启动切换到图片输出防止被吞

* Update chat.js

* 添加Bing专用的图片输出样式

* 添加chatgpt的新图片模式,临时处理切换api导致的对话异常

* 修改bing样式表

* 为图片添加外部页面缓存

* 为图片模式添加MathJax

* feat: add switch for qrcode

* 防止script攻击

* 修复网页模板错误

* 修复bing页面引用错误

* 缓存服务器异常时处理

* 添加默认配置加载

* 修复配置文件路径错误

* 删除重复的模板文件,修复二维码地址错误

* 修正图片渲染错误

* 修复引用渲染错误

* 二维码网址统一改为使用本地配置

* 添加关闭思考提示的配置项

* 修复在Windows上无法载入配置文件的问题

* 修复关闭qr的情况下渲染错误

* 改为使用base64传递返回数据

* 当异常过多时使用图片输出

* 添加锅巴面板配置支持

* 补充遗漏的默认配置

* 修复qr模式下引用未被传递的问题

* 修复未将引用数据传输给缓存服务器的问题

* 删除无用的bingTimeoutMs配置项

* 添加消息队列超时弹出

* 优化图片模式处理,解决对话队列卡住的问题

---------

Co-authored-by: ikechan8370 <geyinchibuaa@gmail.com>
This commit is contained in:
HalcyonAlcedo 2023-02-23 18:47:35 +08:00 committed by GitHub
parent 38f726d92e
commit 7192a8c6fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 107 additions and 76 deletions

View file

@ -81,6 +81,12 @@ export function supportGuoba() {
bottomHelpMessage: '用于缓存图片模式会话内容并渲染的服务器地址。',
component: 'Input',
},
{
field: 'cacheEntry',
label: '预制渲染服务器访问代码',
bottomHelpMessage: '图片内容渲染服务器开启预制访问代码,当渲染服务器访问较慢时可以开启,但无法保证访问代码可以正常访问页面。',
component: 'Switch',
},
{
field: 'proxy',
label: '代理服务器地址',
@ -107,16 +113,6 @@ export function supportGuoba() {
min: 0,
},
},
{
field: 'bingTimeoutMs',
label: 'Bing超时时间',
helpMessage: '单位:毫秒',
bottomHelpMessage: 'bing默认超时时间bing太慢了有的时候。',
component: 'InputNumber',
componentProps: {
min: 0,
},
},
{
field: 'chromeTimeoutMS',
label: '浏览器超时时间',
@ -143,6 +139,12 @@ export function supportGuoba() {
bottomHelpMessage: '模型名称如无特殊需求保持默认即可会使用chatgpt-api库提供的当前可用的最适合的默认值。保底可用的是 text-davinci-003。当发现新的可用的chatGPT模型会更新这里的值。',
component: 'Input',
},
{
field: 'thinkingTips',
label: '思考提示',
bottomHelpMessage: '是否开启AI正在思考中的提示信息。',
component: 'Switch',
},
{
label: '以下为API2方式的配置',
component: 'Divider',
@ -175,6 +177,22 @@ export function supportGuoba() {
bottomHelpMessage: 'apiBaseUrl地址',
component: 'Input',
},
{
label: '以下为API/API2方式公用的配置',
component: 'Divider',
},
{
field: 'promptPrefixOverride',
label: 'AI风格',
bottomHelpMessage: '你可以在这里写入你希望AI回答的风格比如希望优先回答中文回答长一点等。',
component: 'Input',
},
{
field: 'assistantLabel',
label: 'AI名字',
bottomHelpMessage: 'AI认为的自己的名字当你问他你是谁是他会回答这里的名字。',
component: 'Input',
},
{
label: '以下为浏览器方式的配置',
component: 'Divider',