更改必应和chatgpt的图片模式web模板,临时处理切换模式后会话失效问题 (#163)

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

* 开启stream增加稳定性

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

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

* Update chat.js

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

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

---------

Co-authored-by: ikechan8370 <geyinchibuaa@gmail.com>
This commit is contained in:
HalcyonAlcedo 2023-02-17 19:55:23 +08:00 committed by GitHub
parent 37f75a64fa
commit 4d53f378f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
183 changed files with 6684 additions and 113 deletions

View file

@ -0,0 +1,114 @@
<!doctype html>
<html class="no-js" lang="zxx">
<head>
<!--========= Required meta tags =========-->
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!--====== CSS Here ======-->
<link rel="stylesheet" href="{{pluResPath}}content/Bing/static/css/bootstrap.min.css">
<link rel="stylesheet" href="{{pluResPath}}content/Bing/static/css/font-awesome.min.css">
<link rel="stylesheet" href="{{pluResPath}}content/Bing/static/css/hljs.css">
<link rel="stylesheet" href="{{pluResPath}}content/Bing/static/css/style.css">
</head>
<body>
<header class="site-header">
<div class="container">
<div class="row">
<div class="col-lg-3 col-4 my-auto">
<a href="index.html" class="site-logo">
<img src="{{pluResPath}}content/Bing/static/picture/bing.png" alt="LOGO">
</a>
</div>
</div>
</div>
</header>
<section class="about-area pt-232">
<div class="container">
<div class="row justify-content-end">
<div class="col-xl-5 col-lg-5 text-right">
<div class="section-heading">
<h2>New Bing</h2>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="hero-content">
<h4>{{senderName}}</h4>
</div>
<div class="about-content">
<h2>{{@ prompt}}</h2>
<span class="height-50"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="hero-content">
<h4>必应</h4>
</div>
<div class="about-content">
<p class="markdown">{{@ content}}</p>
<span class="height-50"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-xl-12">
<div class="hero-content">
<h4>引用</h4>
</div>
<div class="about-content">
{{each quote item}}
<p class="markdown">{{item}}</p>
{{/each}}
<span class="height-50"></span>
</div>
</div>
</div>
</div>
</section>
<!-- footer start -->
<footer class="site-footer mt-175">
<div class="container">
<div class="row">
<div class="col-md-12 my-auto text-right">
<div class="copyright-text">
<p>Response to {{senderName}} Created By Yunzai-Bot and ChatGPT-Plugin</a></p>
</div>
</div>
</div>
</div>
</footer>
<!-- footer end -->
<!--========= JS Here =========-->
<script src="{{pluResPath}}content/Bing/static/js/jquery-2.2.4.min.js"></script>
<script src="{{pluResPath}}content/Bing/static/js/highlight.min.js"></script>
<script src="{{pluResPath}}content/Bing/static/js/marked.min.js"></script>
<script src="{{pluResPath}}content/Bing/static/js/main.js"></script>
<script>
marked.setOptions({
renderer: new marked.Renderer(),
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false,
highlight: function (code,lang) {
return hljs.highlightAuto(code,[lang]).value;
}
});
let text = marked.parse($(".markdown").text());
$(".markdown").html(text);
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,9 @@
/*!
Theme: Default
Description: Original highlight.js style
Author: (c) Ivan Sagalaev <maniac@softwaremaniacs.org>
Maintainer: @highlightjs/core-team
Website: https://highlightjs.org/
License: see project LICENSE
Touched: 2021
*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#f3f3f3;color:#444}.hljs-comment{color:#697070}.hljs-punctuation,.hljs-tag{color:#444a}.hljs-tag .hljs-attr,.hljs-tag .hljs-name{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#ab5656}.hljs-literal{color:#695}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,12 @@
(function ($) {
'use strict';
/*------------- preloader js --------------*/
function loader() {
$(window).on('load', function () {
});
}
loader();
})(jQuery);

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB