mirror of
https://gitee.com/mafgwo/stackedit
synced 2024-11-16 11:42:23 +08:00
chatgpt优化
This commit is contained in:
parent
9cd27e274e
commit
e04fd5a911
|
@ -8,7 +8,7 @@
|
|||
<form-entry label="生成内容要求详细描述" error="content">
|
||||
<textarea slot="field" class="text-input" type="text" placeholder="输入内容(支持换行)" v-model.trim="content" :disabled="generating"></textarea>
|
||||
<div class="form-entry__info">
|
||||
使用 <a href="https://chat1.52ai.pw/" target="_blank">chat1.52ai.pw</a> 的免费接口生成内容,AI模型是:GPT-3.5 Turbo。
|
||||
使用 <a href="https://api35.pxj123.cn/" target="_blank">api35.pxj123.cn</a> 的免费接口生成内容,AI模型是:GPT-3.5 Turbo。
|
||||
</div>
|
||||
</form-entry>
|
||||
<div class="modal__result">
|
||||
|
@ -80,10 +80,14 @@ export default modalTemplate({
|
|||
callback(null);
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
// store chatgpt配置
|
||||
const config = localStorage.getItem('chatgpt/config');
|
||||
store.dispatch('chatgpt/setCurrConfig', JSON.parse(config || '{}'));
|
||||
mounted() {
|
||||
const script = document.createElement('script');
|
||||
script.src = `https://api35.pxj123.cn/js/chat.js?t=${new Date().getTime()}`;
|
||||
script.onload = () => {
|
||||
/* eslint-disable */
|
||||
console.log('加载外部chatgpt的js成功!');
|
||||
};
|
||||
this.$el.appendChild(script);
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -6,7 +6,7 @@ export default {
|
|||
const url = 'https://fd.52ai.pw/v1/chat/completions';
|
||||
xhr.open('POST', url);
|
||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||
xhr.setRequestHeader('Authorization', 'Bearer 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');
|
||||
xhr.setRequestHeader('Authorization', `Bearer ${window.my_api_key}`);
|
||||
xhr.send(JSON.stringify({
|
||||
model: 'gpt-3.5-turbo',
|
||||
max_tokens: 3000,
|
||||
|
|
Loading…
Reference in New Issue
Block a user