{"id":70,"date":"2023-12-16T19:33:49","date_gmt":"2023-12-16T11:33:49","guid":{"rendered":"http:\/\/danranrie.cn\/?page_id=70"},"modified":"2023-12-17T00:18:12","modified_gmt":"2023-12-16T16:18:12","slug":"chatgpt-3-5","status":"publish","type":"page","link":"http:\/\/danranrie.cn\/index.php\/chatgpt-3-5\/","title":{"rendered":"ChatGPT 3.5"},"content":{"rendered":"<p><!DOCTYPE html><br \/>\n<html lang=\"zh-cmn-Hans\" xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><br \/>\n<head><br \/>\n    <meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\"><br \/>\n    <meta http-equiv=\"Content-Language\" content=\"zh-cn\"><br \/>\n    <meta name=\"apple-mobile-web-app-capable\" content=\"no\" \/><br \/>\n    <meta name=\"apple-touch-fullscreen\" content=\"yes\" \/><br \/>\n    <meta name=\"format-detection\" content=\"telephone=no,email=no\" \/><br \/>\n    <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"white\"><br \/>\n    <title>ChatGPT 3.5<\/title><br \/>\n    <meta name=\"generator\" content=\"EverEdit\" \/><br \/>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <link rel=\"stylesheet\" href=\"https:\/\/www.layuicdn.com\/layui\/css\/layui.css\">\n    <link rel=\"stylesheet\" href=\"http:\/\/mjync.cn\/css\/st.css?v=1.1\">\n<style>\n    .formm-control {\n        margin: 0 auto;\n        position: relative;\n        top: -1px; \n        resize: none; \n        height: 220px; \n        background-color: white; \n        display: block; \n        width: 93%; \n        padding: .375rem .75rem; \n        font-size: 0.7rem; \n        line-height: 2; \n        color: #495057; \n        background-clip: padding-box; \n        border: 1px solid #ced4da; \n        border-radius: .25rem;\n        transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; \/* \u8fb9\u6846\u989c\u8272\u548c\u9634\u5f71\u53d8\u5316\u65f6\u4f7f\u7528\u8fc7\u6e21\u6548\u679c\uff0c\u8fc7\u6e21\u65f6\u95f4\u4e3a0.15\u79d2 *\/\n        overflow-y: auto; \n        white-space: pre-wrap; \n    }\n<\/style>\n<style>\n    .layui-input {\n    font-size: 0.8rem; \n}\n        .layui-textarea {\n            height: 400px;\n            margin: 0 auto;\n            background-color: white;\n        }\n    <\/style>\n<style>\n    body {\n        background-color: #fff; \/* \u8bbe\u7f6e\u4e3a\u767d\u8272 *\/\n    }\n<\/style>\n<link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/prism\/1.25.0\/themes\/prism.min.css\">\n<\/head><br \/>\n<br \/>\n<body class=\"layui-container layui-form\">     <\/p>\n<div class=\"layui-row\">\n<div class=\"layui-col-sm1 jsxs-title\" style=\"font-size: smaller;\"> <\/div>\n<div class=\"layui-col-sm4\">\n<fieldset class=\"layui-elem-field jsxs-title\">\n<legend style=\"font-size: large;\">ChatGPT 3.5<\/legend>\n<div class=\"layui-field-box\" style=\"font-size: smaller;\">\n                    <i class=\"layui-icon\">&#xe60c;<\/i> \u76ee\u524d\u4ec5\u5f00\u653e\u4e86Gpt3.5\u7684\u5168\u7cfb\u5217\u6a21\u578b<\/br><\/br><br \/>\n                    <i class=\"layui-icon\">&#xe645;<\/i> \u8f93\u51fa\u5185\u5bb9\u8f83\u591a\u65f6\u52a0\u8f7d\u4f1a\u6162\u4e00\u70b9 \u8010\u5fc3\u7b49\u5f85<\/br><\/br><br \/>\n                    <i class=\"layui-icon\">&#xe60b;<\/i> \u5efa\u8bae\u4f7f\u7528\u81ea\u5df1\u7684\u5bc6\u94a5\u6bd4\u8f83\u7a33\u5b9a\u4e00\u4e9b<\/br><\/br><br \/>\n                    <i class=\"layui-icon\">&#xe60c;<\/i> \uff01\uff01\uff01\u5b58\u5728\u95ee\u9898\uff0c\u6682\u4e0d\u53ef\u7528\uff01\uff01\uff01\n                <\/div>\n<\/fieldset><\/div>\n<\/p><\/div>\n<p><\/body>\n    <\/div>\n<p>    <!-- \u5185\u5bb9\u90e8\u5206 --><\/p>\n<table class=\"layui-table layui-form\" lay-even=\"\" lay-skin=\"nob\">\n<tbody>\n<tr>\n<td width=\"75%\">\n                    <select id=\"apiSelect\" class=\"layui-select layui-input\" style=\"width: 200px; overflow: auto;\" size=\"5\"><option value=\"gpt-3.5-turbo\">ChatGpt-3.5-turbo<\/option><option value=\"gpt-3.5-turbo-0301\">ChatGpt-3.5-turbo-0301<\/option><option value=\"gpt-3.5-turbo-16k\">ChatGpt-3.5-turbo-16k<\/option><option value=\"gpt-3.5-turbo-16k-0613\">ChatGpt-3.5-turbo-16k-0613<\/option><\/select><br \/>\n                    <br \/>\n                    <input id=\"chatInput\" type=\"text\" required=\"\" lay-verify=\"required\" placeholder=\"\u8bf7\u8f93\u5165\u5185\u5bb9\" autocomplete=\"off\" class=\"layui-input\" data-cip-id=\"url\"><br \/>\n                    <input id=\"keyInput\" type=\"text\" required=\"\" lay-verify=\"required\" placeholder=\"\u8bf7\u8f93\u5165Openai\u5bc6\u94a5\" autocomplete=\"off\" class=\"layui-input\" data-cip-id=\"url\" style=\"display: block;\"><br \/>\n                    <select id=\"keyModeSelect\" class=\"layui-select layui-input\" style=\"width: 200px;\" onchange=\"toggleKeyInput(this)\"><option value=\"custom\">\u5bc6\u94a5\u6a21\u5f0f<\/option><option value=\"default\">\u5b98\u65b9\u6a21\u5f0f<\/option><\/select>\n                <\/td>\n<td width=\"20%\">\n                    <button type=\"submit\" class=\"layui-btn layui-btn\" id=\"sendButton\">\u53d1\u9001<\/button>\n                <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div id=\"replyContainer\" class=\"formm-control layui-textarea\" placeholder=\"\" onclick=\"copyToClipboard()\"><\/div>\n<p>\n    <!-- \u7701\u7565\u5176\u4ed6\u5185\u5bb9 --><\/p>\n<p>    <script src=\"https:\/\/cdn.bootcss.com\/jquery\/2.2.4\/jquery.min.js\"><\/script><br \/>\n    <script src=\"https:\/\/www.layuicdn.com\/layui\/layui.js\"><\/script><br \/>\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/prism\/1.25.0\/prism.min.js\"><\/script><br \/>\n    <script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/prism\/1.25.0\/components\/prism-javascript.min.js\"><\/script><br \/>\n    <script>\n        layui.use(['element', 'layer'], function(){\n            var element = layui.element;\n            var layer = layui.layer;\n            element.on('nav(demo)', function(elem){\n                layer.msg(elem.text());\n            });\n        });<\/p>\n<p>        const chatInput = document.getElementById('chatInput');\n        const keyInput = document.getElementById('keyInput');\n        const replyContainer = document.getElementById('replyContainer');\n        let reply = '';\n        let index = 0;<\/p>\n<p>        document.getElementById('sendButton').addEventListener('click', sendRequest);\n        function sendRequest() {\n            const apiSelect = document.getElementById('apiSelect');\n            const selectedApi = apiSelect.value;\n            const chat = encodeURIComponent(document.getElementById('chatInput').value);\n            const keyModeSelect = document.getElementById('keyModeSelect');\n            const apiKey = keyModeSelect.value === 'default' ? '' : document.getElementById('keyInput').value;<\/p>\n<p>            if (chat.trim() === '') {\n                layui.layer.msg('\u60a8\u8fd8\u672a\u8f93\u5165\u54e6');\n                return;\n            }<\/p>\n<p>            if (selectedApi === '') {\n                layui.layer.msg('\u672a\u9009\u62e9\u6a21\u578b');\n                return;\n            }<\/p>\n<p>            if (keyModeSelect.value === 'custom' && apiKey.trim() === '') {\n                layui.layer.msg('\u8bf7\u8f93\u5165Openai\u5bc6\u94a5');\n                return;\n            }<\/p>\n<p>            const loadingMsg = layui.layer.msg('SouTherChat\u52a0\u8f7d\u4e2d. . . . . ', {\n                icon: 16,\n                shade: 0.3,\n                time: false\n            });<\/p>\n<p>            document.getElementById('sendButton').disabled = true;<\/p>\n<p>            const apiUrl = keyModeSelect.value === 'default' ? 'http:\/\/mjync.cn\/api\/chatgpt\/chat.php?chat=' + chat + '&model=' + selectedApi : 'http:\/\/mjync.cn\/api\/chatgpt\/keychat.php?chat=' + chat + '&model=' + selectedApi + '&key=' + apiKey;<\/p>\n<p>            fetch(apiUrl)\n                .then(response => response.json())\n                .then(result => {\n                    reply = result.reply;\n                    index = 0;\n                    layui.layer.close(loadingMsg);\n                    showReply();\n                    document.getElementById('sendButton').disabled = false;\n                })\n                .catch(error => {\n                    console.error(error);\n                    layui.layer.close(loadingMsg);\n                    document.getElementById('sendButton').disabled = false;\n                });<\/p>\n<p>            document.getElementById('chatInput').value = '';\n        }<\/p>\n<p>        function showReply() {\n    if (reply.trim() !== '') {\n        replyContainer.innerText = reply;\n    }\n}<\/p>\n<p>    <\/script><br \/>\n    <script>\n        window.addEventListener('beforeunload', function() {\n            const apiKey = keyInput.value;\n            localStorage.setItem('apiKey', apiKey);\n        });<\/p>\n<p>        window.addEventListener('load', function() {\n            const savedApiKey = localStorage.getItem('apiKey');\n            if (savedApiKey) {\n                keyInput.value = savedApiKey;\n            }\n        });\n    <\/script><br \/>\n    <script>\n        function copyToClipboard() {\n            if (reply.trim() === '') {\n                layui.layer.msg('\u65e0\u53ef\u590d\u5236\u5185\u5bb9');\n                return;\n            }\n            const range = document.createRange();\n            range.selectNode(replyContainer);\n            window.getSelection().removeAllRanges();\n            window.getSelection().addRange(range);\n            document.execCommand('copy');\n            window.getSelection().removeAllRanges();\n            layui.layer.msg('\u5df2\u590d\u5236\u5230\u526a\u8d34\u677f');\n        }\n    <\/script><br \/>\n<\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ChatGPT 3.5 ChatGPT 3.5 &#xe60c; \u76ee\u524d\u4ec5\u5f00\u653e\u4e86Gpt3.5\u7684\u5168\u7cfb\u5217\u6a21\u578b &#x [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"class_list":["post-70","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/danranrie.cn\/index.php\/wp-json\/wp\/v2\/pages\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/danranrie.cn\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/danranrie.cn\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/danranrie.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/danranrie.cn\/index.php\/wp-json\/wp\/v2\/comments?post=70"}],"version-history":[{"count":0,"href":"http:\/\/danranrie.cn\/index.php\/wp-json\/wp\/v2\/pages\/70\/revisions"}],"wp:attachment":[{"href":"http:\/\/danranrie.cn\/index.php\/wp-json\/wp\/v2\/media?parent=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}