Spaces:
Runtime error
Runtime error
Update custom.py
Browse files11 unmodified lines121314151516171889 unmodified lines10810911011111111211311412 unmodified lines12712812913013113213313413513013113213313413513613713713813914033 unmodified lines17417517617717817918018118218318418518618718818919019119217819311 unmodified lines"""# 内容背景user_background_color = ''gpt_background_color = 'rgba(225, 231, 235, 0.5)'gpt_background_color = 'rgba(225, 230, 235, 0.5)'# 模型初始设置model = "gpt-3.5-turbo"initial_content_history = [{"role": 'system',89 unmodified lines textinput.focus(); } else { tabs[0].click(); const waitMs = 1; const waitMs = 10; function waitForFocus() { if (window.parent.document.activeElement === textinput) {12 unmodified lines event.preventDefault(); } }); textinput.addEventListener('focusin', function(event) { event.stopPropagation(); textarea.style.borderColor = 'rgb(255,196,35)'; }); textinput.addEventListener('focusout', function(event) { event.stopPropagation(); textinput.addEventListener('focusin', function (event) { event.stopPropagation(); textarea.style.borderColor = 'rgb(255,75,75)'; }); textinput.addEventListener('focusout', function (event) { event.stopPropagation(); textarea.style.borderColor = 'white'; }); }); // Ctrl + Enter快捷方式 window.parent.document.addEventListener("keydown", event => {33 unmodified lines waitForLayout(); }); }); // 设置 Tab 键 textinput.addEventListener('keydown', function (event) { if (event.keyCode === 9) { // 阻止默认行为 event.preventDefault(); // 获取当前光标位置 const start = this.selectionStart; const end = this.selectionEnd; // 在光标位置插入制表符 this.value = this.value.substring(0, start) + '\t' + this.value.substring(end); // 将光标移动到插入的制表符之后 this.selectionStart = this.selectionEnd = start + 1; } });</script>""""""custom.py+25-10