From 209156ee82068414536a2420ee350937b6bba7da Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Tue, 30 Jan 2024 01:10:06 +0100 Subject: [PATCH] upgraded ui --- lollms_core | 2 +- web/dist/assets/{index-65298ea8.js => index-607a729a.js} | 2 +- web/dist/index.html | 2 +- web/src/views/PlayGroundView.vue | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename web/dist/assets/{index-65298ea8.js => index-607a729a.js} (99%) diff --git a/lollms_core b/lollms_core index 8deca009..ea313c78 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit 8deca0097213ac6a7727584188d6f3d8cea4ca21 +Subproject commit ea313c783c3c5727ee29f5bbc3beaa02549e3798 diff --git a/web/dist/assets/index-65298ea8.js b/web/dist/assets/index-607a729a.js similarity index 99% rename from web/dist/assets/index-65298ea8.js rename to web/dist/assets/index-607a729a.js index 49dc1ca4..9b575691 100644 --- a/web/dist/assets/index-65298ea8.js +++ b/web/dist/assets/index-607a729a.js @@ -81,7 +81,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),le=k,W=$),K===void 0&& `?(this.message.content=this.message.content.slice(0,e)+"```"+n+` `+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),e=e+4+n.length):(this.message.content=this.message.content.slice(0,e)+"\n```"+n+` `+this.message.content.slice(e,t)+"\n```\n"+this.message.content.slice(t),p=p+3+n.length),this.$refs.mdTextarea.focus(),this.$refs.mdTextarea.selectionStart=this.$refs.mdTextarea.selectionEnd=p},insertTab(n){const e=n.target,t=e.selectionStart,i=e.selectionEnd,s=e.value.substring(0,t),r=e.value.substring(i),o=s+" "+r;this.text=o,this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+4}),n.preventDefault()},mdTextarea_changed(){console.log("mdTextarea_changed"),this.cursorPosition=this.$refs.mdTextarea.selectionStart},mdTextarea_clicked(){console.log(`mdTextarea_clicked: ${this.$refs.mdTextarea.selectionStart}`),this.cursorPosition=this.$refs.mdTextarea.selectionStart},setModel(){this.selecting_model=!0,ke.post("/update_setting",{setting_name:"model_name",setting_value:this.selectedModel}).then(n=>{console.log(n),n.status&&this.$refs.toast.showToast(`Model changed to ${this.selectedModel}`,4,!0),this.selecting_model=!1}).catch(n=>{this.$refs.toast.showToast(`Error ${n}`,4,!0),this.selecting_model=!1})},onVoicesChanged(){this.voices=this.speechSynthesis.getVoices()},read(){this.isSynthesizingVoice=!0;let n=this.$refs.mdTextarea.selectionStart,e=this.$refs.mdTextarea.selectionEnd,t=this.text;n!=e&&(t=t.slice(n,e)),ke.post("./text2Audio",{text:t}).then(i=>{console.log(i.data.url);let s=i.data.url;this.audio_url=dXe+s,this.isSynthesizingVoice=!1,Fe(()=>{Be.replace()})}).catch(i=>{this.$refs.toast.showToast(`Error: ${i}`,4,!1),this.isSynthesizingVoice=!1,Fe(()=>{Be.replace()})})},speak(){if(this.msg){this.speechSynthesis.cancel(),this.msg=null,this.isSpeaking=!1;return}let n=0;console.log("voice on"),this.isSpeaking=!0;const e=200;this.msg=new SpeechSynthesisUtterance,this.msg.pitch=this.$store.state.config.audio_pitch,this.voices.length>0&&(this.msg.voice=this.voices.filter(s=>s.name===this.$store.state.config.audio_out_voice)[0]);const t=s=>{let r=this.text.substring(s,s+e);const o=[".","!","?",` -`];let a=-1;return o.forEach(l=>{const c=r.lastIndexOf(l);c>a&&(a=c)}),a==-1&&(a=r.length),console.log(a),a+s+1},i=()=>{const s=t(n),r=this.text.substring(n,s);this.msg.text=r,n=s+1,this.msg.onend=o=>{n{i()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",s))},this.speechSynthesis.speak(this.msg)};i()},getCursorPosition(){return this.$refs.mdTextarea.selectionStart},appendToOutput(n){this.pre_text+=n,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let n=this.text.indexOf("@@");if(n<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,n)+this.text.substring(n+26,this.text.length),this.pre_text=this.text.substring(0,n),this.post_text=this.text.substring(n,this.text.length);var e=this.text.substring(0,n);console.log(e),Ye.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var n=this.text.substring(0,this.getCursorPosition());console.log(this.text),console.log(`cursor position :${this.getCursorPosition()}`),console.log(`pretext:${this.pre_text}`),console.log(`post_text:${this.post_text}`),console.log(`prompt:${n}`),Ye.emit("generate_text",{prompt:n,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){Ye.emit("cancel_text_generation",{})},exportText(){const n=this.text,e=document.createElement("a"),t=new Blob([n],{type:"text/plain"});e.href=URL.createObjectURL(t),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const n=document.getElementById("import-input");n&&(n.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const t=new FileReader;t.onload=()=>{this.text=t.result},t.readAsText(e.target.files[0])}else alert("Please select a file.")}),n.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=uXe(this.selectedPreset.content,n=>{console.log("Done"),console.log(n),this.text=n})},addPreset(){let n=prompt("Enter the title of the preset:");this.presets[n]={name:n,content:this.text},ke.post("./add_preset",this.presets[n]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){ke.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecording(){ke.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=n=>{this.generated="";for(let e=n.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,this.pre_text=this.pre_text+this.generated,this.cursorPosition=this.pre_text.length,clearTimeout(this.silenceTimer)},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")}}},_Xe={class:"container bg-bg-light dark:bg-bg-dark shadow-lg overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},hXe={class:"container flex flex-row m-2"},fXe={class:"flex-grow m-2"},mXe={class:"flex gap-3 flex-1 items-center flex-grow flex-row m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},gXe=_("i",{"data-feather":"pen-tool"},null,-1),EXe=[gXe],bXe=_("i",{"data-feather":"archive"},null,-1),SXe=[bXe],vXe=_("span",{class:"w-80"},null,-1),yXe=_("i",{"data-feather":"x"},null,-1),TXe=[yXe],xXe=_("i",{"data-feather":"mic"},null,-1),CXe=[xXe],RXe=_("i",{"data-feather":"mic"},null,-1),AXe=[RXe],wXe=_("i",{"data-feather":"volume-2"},null,-1),NXe=[wXe],OXe=_("i",{"data-feather":"voicemail"},null,-1),IXe=[OXe],MXe={key:1,"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DXe=_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),LXe=_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),kXe=[DXe,LXe],PXe=_("i",{"data-feather":"upload"},null,-1),UXe=[PXe],FXe=_("i",{"data-feather":"download"},null,-1),BXe=[FXe],GXe={class:"flex gap-3 flex-1 items-center flex-grow justify-end"},VXe=_("input",{type:"file",id:"import-input",class:"hidden"},null,-1),HXe={key:0},zXe={class:"flex flex-row justify-end mx-2"},qXe=["src"],YXe=["src"],$Xe=["src"],WXe=["src"],KXe=["src"],jXe=["src"],QXe=["src"],XXe=_("i",{"data-feather":"copy"},null,-1),ZXe=[XXe],JXe=["src"],eZe={key:2},tZe=["value"],nZe={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},iZe=_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Selecting model...")],-1),sZe=[iZe],rZe=["value"],oZe=_("br",null,null,-1),aZe=_("i",{"data-feather":"check"},null,-1),lZe=[aZe],cZe=_("i",{"data-feather":"plus"},null,-1),dZe=[cZe],uZe=_("i",{"data-feather":"x"},null,-1),pZe=[uZe],_Ze=_("i",{"data-feather":"refresh-ccw"},null,-1),hZe=[_Ze],fZe={class:"slider-container ml-2 mr-2"},mZe=_("h3",{class:"text-gray-600"},"Temperature",-1),gZe={class:"slider-value text-gray-500"},EZe={class:"slider-container ml-2 mr-2"},bZe=_("h3",{class:"text-gray-600"},"Top K",-1),SZe={class:"slider-value text-gray-500"},vZe={class:"slider-container ml-2 mr-2"},yZe=_("h3",{class:"text-gray-600"},"Top P",-1),TZe={class:"slider-value text-gray-500"},xZe={class:"slider-container ml-2 mr-2"},CZe=_("h3",{class:"text-gray-600"},"Repeat Penalty",-1),RZe={class:"slider-value text-gray-500"},AZe={class:"slider-container ml-2 mr-2"},wZe=_("h3",{class:"text-gray-600"},"Repeat Last N",-1),NZe={class:"slider-value text-gray-500"},OZe={class:"slider-container ml-2 mr-2"},IZe=_("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1),MZe={class:"slider-value text-gray-500"},DZe={class:"slider-container ml-2 mr-2"},LZe=_("h3",{class:"text-gray-600"},"Number of tokens to generate",-1),kZe={class:"slider-value text-gray-500"},PZe={class:"slider-container ml-2 mr-2"},UZe=_("h3",{class:"text-gray-600"},"Seed",-1),FZe={class:"slider-value text-gray-500"};function BZe(n,e,t,i,s,r){const o=ut("MarkdownRenderer"),a=ut("Card"),l=ut("Toast");return O(),D($e,null,[_("div",_Xe,[_("div",hXe,[_("div",fXe,[_("div",mXe,[Se(_("button",{id:"generate-button",onClick:e[0]||(e[0]=(...c)=>r.generate&&r.generate(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},EXe,512),[[Mt,!s.generating]]),Se(_("button",{id:"generate-next-button",onClick:e[1]||(e[1]=(...c)=>r.generate_in_placeholder&&r.generate_in_placeholder(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},SXe,512),[[Mt,!s.generating]]),vXe,Se(_("button",{id:"stop-button",onClick:e[2]||(e[2]=(...c)=>r.stopGeneration&&r.stopGeneration(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},TXe,512),[[Mt,s.generating]]),_("button",{type:"button",onClick:e[3]||(e[3]=(...c)=>r.startSpeechRecognition&&r.startSpeechRecognition(...c)),class:ze([{"text-red-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},CXe,2),_("button",{type:"button",onClick:e[4]||(e[4]=(...c)=>r.startRecording&&r.startRecording(...c)),class:ze([{"text-green-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer text-red-500"])},AXe,2),_("button",{title:"speak",onClick:e[5]||(e[5]=xe(c=>r.speak(),["stop"])),class:ze([{"text-red-500":r.isTalking},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},NXe,2),s.isSynthesizingVoice?(O(),D("svg",MXe,kXe)):(O(),D("button",{key:0,title:"read",onClick:e[6]||(e[6]=xe(c=>r.read(),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},IXe)),Se(_("button",{id:"export-button",onClick:e[7]||(e[7]=(...c)=>r.exportText&&r.exportText(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},UXe,512),[[Mt,!s.generating]]),Se(_("button",{id:"import-button",onClick:e[8]||(e[8]=(...c)=>r.importText&&r.importText(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},BXe,512),[[Mt,!s.generating]]),_("div",GXe,[_("button",{class:ze(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":s.tab_id=="source"}]),onClick:e[9]||(e[9]=c=>s.tab_id="source")}," Source ",2),_("button",{class:ze(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":s.tab_id=="render"}]),onClick:e[10]||(e[10]=c=>s.tab_id="render")}," Render ",2)]),VXe]),_("div",{class:ze(["flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4",{"border-red-500":s.generating}])},[s.tab_id==="source"?(O(),D("div",HXe,[_("div",zXe,[_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add python block",onClick:e[11]||(e[11]=xe(c=>r.addBlock("python"),["stop"]))},[_("img",{src:s.python_block,width:"25",height:"25"},null,8,qXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[12]||(e[12]=xe(c=>r.addBlock("javascript"),["stop"]))},[_("img",{src:s.javascript_block,width:"25",height:"25"},null,8,YXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[13]||(e[13]=xe(c=>r.addBlock("json"),["stop"]))},[_("img",{src:s.json_block,width:"25",height:"25"},null,8,$Xe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[14]||(e[14]=xe(c=>r.addBlock("c++"),["stop"]))},[_("img",{src:s.cpp_block,width:"25",height:"25"},null,8,WXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[15]||(e[15]=xe(c=>r.addBlock("html"),["stop"]))},[_("img",{src:s.html5_block,width:"25",height:"25"},null,8,KXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[16]||(e[16]=xe(c=>r.addBlock("latex"),["stop"]))},[_("img",{src:s.LaTeX_block,width:"25",height:"25"},null,8,jXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[17]||(e[17]=xe(c=>r.addBlock("bash"),["stop"]))},[_("img",{src:s.bash_block,width:"25",height:"25"},null,8,QXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Copy message to clipboard",onClick:e[18]||(e[18]=xe(c=>n.copyContentToClipboard(),["stop"]))},ZXe)]),Se(_("textarea",{ref:"mdTextarea",onKeydown:e[19]||(e[19]=fr(xe((...c)=>r.insertTab&&r.insertTab(...c),["prevent"]),["tab"])),class:"block min-h-500 p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,style:Zt({minHeight:s.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[20]||(e[20]=c=>s.text=c),onClick:e[21]||(e[21]=xe((...c)=>r.mdTextarea_clicked&&r.mdTextarea_clicked(...c),["prevent"])),onChange:e[22]||(e[22]=xe((...c)=>r.mdTextarea_changed&&r.mdTextarea_changed(...c),["prevent"]))},`\r +`];let a=-1;return o.forEach(l=>{const c=r.lastIndexOf(l);c>a&&(a=c)}),a==-1&&(a=r.length),console.log(a),a+s+1},i=()=>{const s=t(n),r=this.text.substring(n,s);this.msg.text=r,n=s+1,this.msg.onend=o=>{n{i()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",s))},this.speechSynthesis.speak(this.msg)};i()},getCursorPosition(){return this.$refs.mdTextarea.selectionStart},appendToOutput(n){this.pre_text+=n,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let n=this.text.indexOf("@@");if(n<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,n)+this.text.substring(n+26,this.text.length),this.pre_text=this.text.substring(0,n),this.post_text=this.text.substring(n,this.text.length);var e=this.text.substring(0,n);console.log(e),Ye.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var n=this.text.substring(0,this.getCursorPosition());console.log(this.text),console.log(`cursor position :${this.getCursorPosition()}`),console.log(`pretext:${this.pre_text}`),console.log(`post_text:${this.post_text}`),console.log(`prompt:${n}`),Ye.emit("generate_text",{prompt:n,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){Ye.emit("cancel_text_generation",{})},exportText(){const n=this.text,e=document.createElement("a"),t=new Blob([n],{type:"text/plain"});e.href=URL.createObjectURL(t),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const n=document.getElementById("import-input");n&&(n.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const t=new FileReader;t.onload=()=>{this.text=t.result},t.readAsText(e.target.files[0])}else alert("Please select a file.")}),n.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=uXe(this.selectedPreset.content,n=>{console.log("Done"),console.log(n),this.text=n})},addPreset(){let n=prompt("Enter the title of the preset:");this.presets[n]={name:n,content:this.text},ke.post("./add_preset",this.presets[n]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){ke.get("./get_presets").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startRecording(){ke.get("./start_audio_stream").then(n=>{console.log(n.data),this.presets=n.data,this.selectedPreset=this.presets[0]}).catch(n=>{this.$refs.toast.showToast(`Error: ${n}`,4,!1)})},startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=n=>{this.generated="";for(let e=n.resultIndex;e{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=n=>{console.error("Speech recognition error:",n.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,this.pre_text=this.pre_text+this.generated,this.cursorPosition=this.pre_text.length,clearTimeout(this.silenceTimer)},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")}}},_Xe={class:"container bg-bg-light dark:bg-bg-dark shadow-lg overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},hXe={class:"container flex flex-row m-2"},fXe={class:"flex-grow m-2"},mXe={class:"flex gap-3 flex-1 items-center flex-grow flex-row m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4"},gXe=_("i",{"data-feather":"pen-tool"},null,-1),EXe=[gXe],bXe=_("i",{"data-feather":"archive"},null,-1),SXe=[bXe],vXe=_("span",{class:"w-80"},null,-1),yXe=_("i",{"data-feather":"x"},null,-1),TXe=[yXe],xXe=_("i",{"data-feather":"mic"},null,-1),CXe=[xXe],RXe=_("i",{"data-feather":"mic"},null,-1),AXe=[RXe],wXe=_("i",{"data-feather":"volume-2"},null,-1),NXe=[wXe],OXe=_("i",{"data-feather":"voicemail"},null,-1),IXe=[OXe],MXe={key:1,"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DXe=_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"},null,-1),LXe=_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"},null,-1),kXe=[DXe,LXe],PXe=_("i",{"data-feather":"upload"},null,-1),UXe=[PXe],FXe=_("i",{"data-feather":"download"},null,-1),BXe=[FXe],GXe={class:"flex gap-3 flex-1 items-center flex-grow justify-end"},VXe=_("input",{type:"file",id:"import-input",class:"hidden"},null,-1),HXe={key:0},zXe={class:"flex flex-row justify-end mx-2"},qXe=["src"],YXe=["src"],$Xe=["src"],WXe=["src"],KXe=["src"],jXe=["src"],QXe=["src"],XXe=_("i",{"data-feather":"copy"},null,-1),ZXe=[XXe],JXe=["src"],eZe={key:2},tZe=["value"],nZe={key:0,title:"Selecting model",class:"flex flex-row flex-grow justify-end"},iZe=_("div",{role:"status"},[_("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[_("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),_("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),_("span",{class:"sr-only"},"Selecting model...")],-1),sZe=[iZe],rZe=["value"],oZe=_("br",null,null,-1),aZe=_("i",{"data-feather":"check"},null,-1),lZe=[aZe],cZe=_("i",{"data-feather":"plus"},null,-1),dZe=[cZe],uZe=_("i",{"data-feather":"x"},null,-1),pZe=[uZe],_Ze=_("i",{"data-feather":"refresh-ccw"},null,-1),hZe=[_Ze],fZe={class:"slider-container ml-2 mr-2"},mZe=_("h3",{class:"text-gray-600"},"Temperature",-1),gZe={class:"slider-value text-gray-500"},EZe={class:"slider-container ml-2 mr-2"},bZe=_("h3",{class:"text-gray-600"},"Top K",-1),SZe={class:"slider-value text-gray-500"},vZe={class:"slider-container ml-2 mr-2"},yZe=_("h3",{class:"text-gray-600"},"Top P",-1),TZe={class:"slider-value text-gray-500"},xZe={class:"slider-container ml-2 mr-2"},CZe=_("h3",{class:"text-gray-600"},"Repeat Penalty",-1),RZe={class:"slider-value text-gray-500"},AZe={class:"slider-container ml-2 mr-2"},wZe=_("h3",{class:"text-gray-600"},"Repeat Last N",-1),NZe={class:"slider-value text-gray-500"},OZe={class:"slider-container ml-2 mr-2"},IZe=_("h3",{class:"text-gray-600"},"Number of tokens to crop the text to",-1),MZe={class:"slider-value text-gray-500"},DZe={class:"slider-container ml-2 mr-2"},LZe=_("h3",{class:"text-gray-600"},"Number of tokens to generate",-1),kZe={class:"slider-value text-gray-500"},PZe={class:"slider-container ml-2 mr-2"},UZe=_("h3",{class:"text-gray-600"},"Seed",-1),FZe={class:"slider-value text-gray-500"};function BZe(n,e,t,i,s,r){const o=ut("MarkdownRenderer"),a=ut("Card"),l=ut("Toast");return O(),D($e,null,[_("div",_Xe,[_("div",hXe,[_("div",fXe,[_("div",mXe,[Se(_("button",{id:"generate-button",onClick:e[0]||(e[0]=(...c)=>r.generate&&r.generate(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},EXe,512),[[Mt,!s.generating]]),Se(_("button",{id:"generate-next-button",onClick:e[1]||(e[1]=(...c)=>r.generate_in_placeholder&&r.generate_in_placeholder(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},SXe,512),[[Mt,!s.generating]]),vXe,Se(_("button",{id:"stop-button",onClick:e[2]||(e[2]=(...c)=>r.stopGeneration&&r.stopGeneration(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},TXe,512),[[Mt,s.generating]]),_("button",{type:"button",onClick:e[3]||(e[3]=(...c)=>r.startSpeechRecognition&&r.startSpeechRecognition(...c)),class:ze([{"text-red-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},CXe,2),_("button",{type:"button",onClick:e[4]||(e[4]=(...c)=>r.startRecording&&r.startRecording(...c)),class:ze([{"text-green-500":s.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer text-red-500"])},AXe,2),_("button",{title:"speak",onClick:e[5]||(e[5]=xe(c=>r.speak(),["stop"])),class:ze([{"text-red-500":r.isTalking},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},NXe,2),s.isSynthesizingVoice?(O(),D("svg",MXe,kXe)):(O(),D("button",{key:0,title:"read",onClick:e[6]||(e[6]=xe(c=>r.read(),["stop"])),class:"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},IXe)),Se(_("button",{id:"export-button",onClick:e[7]||(e[7]=(...c)=>r.exportText&&r.exportText(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},UXe,512),[[Mt,!s.generating]]),Se(_("button",{id:"import-button",onClick:e[8]||(e[8]=(...c)=>r.importText&&r.importText(...c)),class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer"},BXe,512),[[Mt,!s.generating]]),_("div",GXe,[_("button",{class:ze(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":s.tab_id=="source"}]),onClick:e[9]||(e[9]=c=>s.tab_id="source")}," Source ",2),_("button",{class:ze(["border-2 text-blue-600 dark:text-white border-blue-300 p-2 rounded shadow-lg hover:border-gray-600 dark:link-item-dark cursor-pointer",{"bg-blue-200 dark:bg-blue-500":s.tab_id=="render"}]),onClick:e[10]||(e[10]=c=>s.tab_id="render")}," Render ",2)]),VXe]),_("div",{class:ze(["flex-grow m-2 p-2 border border-blue-300 rounded-md border-2 border-blue-300 m-2 p-4",{"border-red-500":s.generating}])},[s.tab_id==="source"?(O(),D("div",HXe,[_("div",zXe,[_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add python block",onClick:e[11]||(e[11]=xe(c=>r.addBlock("python"),["stop"]))},[_("img",{src:s.python_block,width:"25",height:"25"},null,8,qXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add javascript block",onClick:e[12]||(e[12]=xe(c=>r.addBlock("javascript"),["stop"]))},[_("img",{src:s.javascript_block,width:"25",height:"25"},null,8,YXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add json block",onClick:e[13]||(e[13]=xe(c=>r.addBlock("json"),["stop"]))},[_("img",{src:s.json_block,width:"25",height:"25"},null,8,$Xe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add c++ block",onClick:e[14]||(e[14]=xe(c=>r.addBlock("c++"),["stop"]))},[_("img",{src:s.cpp_block,width:"25",height:"25"},null,8,WXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add html block",onClick:e[15]||(e[15]=xe(c=>r.addBlock("html"),["stop"]))},[_("img",{src:s.html5_block,width:"25",height:"25"},null,8,KXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add LaTex block",onClick:e[16]||(e[16]=xe(c=>r.addBlock("latex"),["stop"]))},[_("img",{src:s.LaTeX_block,width:"25",height:"25"},null,8,jXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Add bash block",onClick:e[17]||(e[17]=xe(c=>r.addBlock("bash"),["stop"]))},[_("img",{src:s.bash_block,width:"25",height:"25"},null,8,QXe)]),_("div",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2 cursor-pointer",title:"Copy message to clipboard",onClick:e[18]||(e[18]=xe(c=>n.copyContentToClipboard(),["stop"]))},ZXe)]),Se(_("textarea",{ref:"mdTextarea",onKeydown:e[19]||(e[19]=fr(xe((...c)=>r.insertTab&&r.insertTab(...c),["prevent"]),["tab"])),class:"block min-h-500 p-2.5 w-full text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",rows:4,style:Zt({minHeight:s.mdRenderHeight+"px"}),placeholder:"Enter message here...","onUpdate:modelValue":e[20]||(e[20]=c=>s.text=c),onClick:e[21]||(e[21]=xe((...c)=>r.mdTextarea_clicked&&r.mdTextarea_clicked(...c),["prevent"])),onChange:e[22]||(e[22]=xe((...c)=>r.mdTextarea_changed&&r.mdTextarea_changed(...c),["prevent"]))},`\r `,36),[[Qe,s.text]]),_("span",null,"Cursor position "+me(s.cursorPosition),1)])):j("",!0),s.audio_url!=null?(O(),D("audio",{controls:"",autoplay:"",key:s.audio_url},[_("source",{src:s.audio_url,type:"audio/wav",ref:"audio_player"},null,8,JXe),je(" Your browser does not support the audio element. ")])):j("",!0),s.tab_id==="render"?(O(),D("div",eZe,[Ie(o,{ref:"mdRender","markdown-text":s.text,class:"mt-4 p-2 rounded shadow-lg dark:bg-bg-dark"},null,8,["markdown-text"])])):j("",!0)],2)]),Ie(a,{title:"settings",class:"slider-container ml-0 mr-0 max-width",isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[Ie(a,{title:"Model",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[Se(_("select",{"onUpdate:modelValue":e[23]||(e[23]=c=>r.selectedModel=c),onChange:e[24]||(e[24]=(...c)=>r.setModel&&r.setModel(...c)),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},[(O(!0),D($e,null,lt(r.models,c=>(O(),D("option",{key:c,value:c},me(c),9,tZe))),128))],544),[[ei,r.selectedModel]]),s.selecting_model?(O(),D("div",nZe,sZe)):j("",!0)]),_:1}),Ie(a,{title:"Presets",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[Se(_("select",{"onUpdate:modelValue":e[25]||(e[25]=c=>s.selectedPreset=c),class:"bg-white dark:bg-black mb-2 border-2 rounded-md shadow-sm w-full"},[(O(!0),D($e,null,lt(s.presets,c=>(O(),D("option",{key:c,value:c},me(c.name),9,rZe))),128))],512),[[ei,s.selectedPreset]]),oZe,_("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[26]||(e[26]=(...c)=>r.setPreset&&r.setPreset(...c)),title:"Use preset"},lZe),_("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[27]||(e[27]=(...c)=>r.addPreset&&r.addPreset(...c)),title:"Add this text as a preset"},dZe),_("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[28]||(e[28]=(...c)=>r.removePreset&&r.removePreset(...c)),title:"Remove preset"},pZe),_("button",{class:"w-6 ml-2 hover:text-secondary duration-75 active:scale-90 cursor-pointer",onClick:e[29]||(e[29]=(...c)=>r.reloadPresets&&r.reloadPresets(...c)),title:"Reload presets list"},hZe)]),_:1}),Ie(a,{title:"Generation params",class:"slider-container ml-0 mr-0",is_subcard:!0,isHorizontal:!1,disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[_("div",fZe,[mZe,Se(_("input",{type:"range","onUpdate:modelValue":e[30]||(e[30]=c=>s.temperature=c),min:"0",max:"5",step:"0.1",class:"w-full"},null,512),[[Qe,s.temperature]]),_("span",gZe,"Current value: "+me(s.temperature),1)]),_("div",EZe,[bZe,Se(_("input",{type:"range","onUpdate:modelValue":e[31]||(e[31]=c=>s.top_k=c),min:"1",max:"100",step:"1",class:"w-full"},null,512),[[Qe,s.top_k]]),_("span",SZe,"Current value: "+me(s.top_k),1)]),_("div",vZe,[yZe,Se(_("input",{type:"range","onUpdate:modelValue":e[32]||(e[32]=c=>s.top_p=c),min:"0",max:"1",step:"0.1",class:"w-full"},null,512),[[Qe,s.top_p]]),_("span",TZe,"Current value: "+me(s.top_p),1)]),_("div",xZe,[CZe,Se(_("input",{type:"range","onUpdate:modelValue":e[33]||(e[33]=c=>s.repeat_penalty=c),min:"0",max:"5",step:"0.1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Qe,s.repeat_penalty]]),_("span",RZe,"Current value: "+me(s.repeat_penalty),1)]),_("div",AZe,[wZe,Se(_("input",{type:"range","onUpdate:modelValue":e[34]||(e[34]=c=>s.repeat_last_n=c),min:"0",max:"100",step:"1",class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Qe,s.repeat_last_n]]),_("span",NZe,"Current value: "+me(s.repeat_last_n),1)]),_("div",OZe,[IZe,Se(_("input",{type:"number","onUpdate:modelValue":e[35]||(e[35]=c=>s.n_crop=c),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Qe,s.n_crop]]),_("span",MZe,"Current value: "+me(s.n_crop),1)]),_("div",DZe,[LZe,Se(_("input",{type:"number","onUpdate:modelValue":e[36]||(e[36]=c=>s.n_predicts=c),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Qe,s.n_predicts]]),_("span",kZe,"Current value: "+me(s.n_predicts),1)]),_("div",PZe,[UZe,Se(_("input",{type:"number","onUpdate:modelValue":e[37]||(e[37]=c=>s.seed=c),class:"bg-white dark:bg-black m-0 border-2 rounded-md shadow-sm w-full"},null,512),[[Qe,s.seed]]),_("span",FZe,"Current value: "+me(s.seed),1)])]),_:1})]),_:1})])]),Ie(l,{ref:"toast"},null,512)],64)}const GZe=gt(pXe,[["render",BZe]]);const VZe={data(){return{activeExtension:null}},computed:{activeExtensions(){return console.log(this.$store.state.extensionsZoo),console.log(EI(this.$store.state.extensionsZoo)),this.$store.state.extensionsZoo}},methods:{showExtensionPage(n){this.activeExtension=n}}},HZe={class:"container overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll w-full dark:bg-bg-dark scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},zZe={key:0},qZe=["onClick"],YZe={key:0},$Ze=["src"],WZe={key:1},KZe=_("p",null,"No extension is active. Please install and activate an extension.",-1),jZe=[KZe];function QZe(n,e,t,i,s,r){return O(),D("div",HZe,[r.activeExtensions.length>0?(O(),D("div",zZe,[(O(!0),D($e,null,lt(r.activeExtensions,o=>(O(),D("div",{key:o.name,onClick:a=>r.showExtensionPage(o)},[_("div",{class:ze({"active-tab":o===s.activeExtension})},me(o.name),3)],8,qZe))),128)),s.activeExtension?(O(),D("div",YZe,[_("iframe",{src:s.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,$Ze)])):j("",!0)])):(O(),D("div",WZe,jZe))])}const XZe=gt(VZe,[["render",QZe]]);var IN={exports:{}};/* @license Papa Parse v5.4.1 diff --git a/web/dist/index.html b/web/dist/index.html index a2589e1c..d1320cdf 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ LoLLMS WebUI - Welcome - + diff --git a/web/src/views/PlayGroundView.vue b/web/src/views/PlayGroundView.vue index 3967eee0..b0a6ac55 100644 --- a/web/src/views/PlayGroundView.vue +++ b/web/src/views/PlayGroundView.vue @@ -818,7 +818,7 @@ export default { }); }, startRecording(){ - axios.get('./get_presets').then(response => { + axios.get('./start_audio_stream').then(response => { console.log(response.data) this.presets=response.data this.selectedPreset = this.presets[0]