PageSourceSearch

https://ai.neurospace.pro/_nuxt/assistants.f0b8d1a6.js

js neurospace.pro collected 2026-10-06 00:22:17 UTC 50,169 bytes, 1 lines download raw bytes

1import{_ as Y}from"./nuxt-link.391cd522.js";import{_ as G,u as W,r as f,o as d,c as u,a as e,f as o,t as s,g as q,h as R,p as Z,e as J,i as ee,G as j,j as X,k as te,m as $,s as K,F as D,y as F,q as S,b as E,w as V,d as g,n as N,v as P,I as oe,A as ae,z as re,H as ie}from"./entry.128c00c2.js";import{u as H}from"./useApiFetch.fb005c54.js";import{u as Q}from"./fetch.c7e48f66.js";import{i as de,a as le,b as ce}from"./index.b49717c2.js";import{u as ue}from"./vue.f36acd1f.8e9fbb2c.js";const se=p=>(Z("data-v-e2bd0fef"),p=p(),J(),p),_e=["id"],pe={class:"relative p-4 w-full max-w-md max-h-full"},ge={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},me=["data-modal-hide"],he=se(()=>e("svg",{class:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14"},[e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})],-1)),ve=se(()=>e("span",{class:"sr-only"},"Закрыть",-1)),be=[he,ve],fe={class:"p-4 md:p-5 text-center"},ye=se(()=>e("svg",{class:"mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20"},[e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})],-1)),xe={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400"},ke={class:"flex items-center justify-center"},we={key:0,class:"loader text-center"},$e={key:1},Ae=["data-modal-hide"],Ce={__name:"DeleteAssistantModal",props:["item"],emits:["deleteAssistant"],setup(p,{emit:L}){const{$toast:k}=ee(),{t:O}=W(),h=q().public.BACKEND_HOST,m=f(p.item),r=f(null),v=f(!1),y=L,_=async n=>{v.value=!0;try{const{error:b,data:t}=await H(h+"/api/assistant/"+n,{headers:{"X-XSRF-TOKEN":R("XSRF-TOKEN")},credentials:"include",method:"DELETE",watch:!1,body:{}});t.value.status===!0&&(y("deleteAssistant",m),k.success(t.value.message,{position:"top"})),t.value!=null&&t.value.status===!1&&k.error(t.value.message,{position:"top"}),b.value&&k.error(b.value.data.message,{position:"top"}),v.value=!1,r.value.click()}catch{v.value=!1,k.error(O("api.error"),{position:"top"})}};return(n,b)=>(d(),u("div",{ref_key:"modal",ref:r,id:"delete-assistant-modal-"+o(m).id,tabindex:"-1",class:"hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full"},[e("div",pe,[e("div",ge,[e("button",{type:"button",class:"absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white","data-modal-hide":"delete-assistant-modal-"+o(m).id},be,8,me),e("div",fe,[ye,e("h3",xe,s(n.$t("assistant.delete_modal.text")),1),e("div",ke,[e("button",{style:{"min-width":"100px","min-height":"42px"},onClick:b[0]||(b[0]=t=>_(o(m).id)),type:"button",class:"justify-center text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center me-2"},[o(v)?(d(),u("span",we)):(d(),u("span",$e,s(n.$t("acc_deletion_requests.execute_modal.buttons.yes")),1))]),e("button",{"data-modal-hide":"delete-assistant-modal-"+o(m).id,type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},s(n.$t("acc_deletion_requests.execute_modal.buttons.no")),9,Ae)])])])])],8,_e))}},Ee=G(Ce,[["__scopeId","data-v-e2bd0fef"]]);const z=p=>(Z("data-v-6670f49b"),p=p(),J(),p),Se=["id"],Oe={class:"relative p-4 w-full max-w-2xl h-full md:h-auto"},Te={class:"relative p-4 bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5"},Me={class:"flex justify-between items-center pb-4 mb-4 rounded-t border-b sm:mb-5 dark:border-gray-600"},Ne={class:"text-lg font-semibold text-gray-900 dark:text-white"},ze=["data-modal-toggle"],Le=z(()=>e("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),Ie=z(()=>e("span",{class:"sr-only"},"Close modal",-1)),je=[Le,Ie],De={class:"mb-4"},Ue=["for"],Ve={key:0},Fe=["id"],Be=["value"],Ke={class:"error"},Re={key:0,class:"text-sm text-red-600"},Xe={key:1},Pe=["placeholder"],qe={class:"error w-full flex justify-end"},He={class:"text-right text-sm text-red-600 mt-1"},Ge={class:"mb-4"},We=["for"],Ze=z(()=>
1e("button",{"data-popover-target":"popover-model_gpt_id","data-popover-placement":"bottom-end",type:"button"},[e("svg",{class:"w-4 h-4 text-gray-400 hover:text-gray-500","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"})]),e("span",{class:"sr-only"},"Show information")],-1)),Je={"data-popover":"",id:"popover-model_gpt_id",role:"tooltip",class:"absolute z-10 invisible inline-block text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-sm opacity-0 w-72 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400"},Qe={class:"p-3 space-y-2"},Ye=z(()=>e("div",{"data-popper-arrow":""},null,-1)),et=["id"],tt=["value"],st={class:"error"},ot={key:0,class:"text-sm text-red-600"},at={class:"mb-4"},nt=["for"],rt=["name","id"],it={class:"error"},dt={key:0,class:"text-sm text-red-600"},lt={class:"mb-4"},ct=["for"],ut=z(()=>e("button",{"data-popover-target":"popover-instructions","data-popover-placement":"bottom-end",type:"button"},[e("svg",{class:"w-4 h-4 text-gray-400 hover:text-gray-500","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"})]),e("span",{class:"sr-only"},"Show information")],-1)),_t={"data-popover":"",id:"popover-description",role:"tooltip",class:"absolute z-10 invisible inline-block text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-sm opacity-0 w-72 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400"},pt={class:"p-3 space-y-2"},gt=z(()=>e("div",{"data-popper-arrow":""},null,-1)),mt=["name","id"],ht={class:"error"},vt={key:0,class:"text-sm text-red-600"},bt={class:"mb-4"},ft=["for"],yt=z(()=>e("button",{"data-popover-target":"popover-instructions","data-popover-placement":"bottom-end",type:"button"},[e("svg",{class:"w-4 h-4 text-gray-400 hover:text-gray-500","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"})]),e("span",{class:"sr-only"},"Show information")],-1)),xt={"data-popover":"",id:"popover-instructions",role:"tooltip",class:"absolute z-10 invisible inline-block text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-sm opacity-0 w-72 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400"},kt={class:"p-3 space-y-2"},wt=z(()=>e("div",{"data-popper-arrow":""},null,-1)),$t=["name","id"],At={class:"error"},Ct={key:0,class:"text-sm text-red-600"},Et={class:"mb-4"},St={class:"relative inline-flex items-center cursor-pointer"},Ot=["disabled","checked"],Tt=z(()=>e("div",{class:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-orange-300 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-600"},null,-1)),Mt={class:"ms-3 text-sm font-medium text-gray-900 dark:text-gray-300"},Nt={class:"mb-4"},zt=z(()=>e("label",{class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},"Vector Store",-1)),Lt=["id"],It=["value","selected"],jt={class:"error"},Dt={key:0,class:"text-sm text-red-600"},Ut={class:"flex items-center space-x-4"},Vt={key:0,class:"loader"},Ft={key:1},Bt=z(()=>e("div",{class:"flex items-center space-x-4"},null,-1)),Kt={__name:"UpdateAssistantModal",props:["item","gpt_models","open_ai_tokens"],emits:["updateAssistant"],setup(p,{emit:L}){const{$toast:k}=ee(),{locale:O,t:A}=W(),h=q(),w=h.public.BACKEND_HOST,m=f(null),r=f({}),v=f(!1);f(!1);const y=p,_=f(y.item),n=f(y.gpt_models.filter(a=>a.id!=15&&a.id!=16)),b=j({items:y.open_ai_tokens}),t=j({items:[]});j({items:[{id:0}]}),X(()=>y.gpt_models,()=>{n.value=y.gpt_models.filter(a=>a.id!=15&&a.id!=16)}),X(()=>y.open_ai_tokens,()=>{b.items=y.open_ai_tokens}),te(async()=>{await M()});const l=f({id:_.value.id,open_ai_token_id:_.value.open_ai_token_id,model_gpt_id:_.value.model_gpt_id,name:_.value.name,description:_.value.description,instructions:_.value.instructions,file_search:_.value.file_search,open_ai_file_id:_.value.open_ai_file_id,vector_store_id:_.value.vector_store_id}),C=L,x=async()=>{v.value=!0,r.value={};const a=new FormData;l.value.open_ai_token_id&&a.append("open_ai_token_id",l.value.open_ai_token_id),l.value.model_gpt_id&&a.append("model_gpt_id",l.value.model_gpt_id),l.value.name&&a.append("name",l.value.name),l.value.description&&a.append("description",l.value.description),l.value.file_search&&a.append("file_search",l.value.file_search?1:""),l.value.instructions&&a.append("instructions",l.value.instructions),_.value.vector_store_id&&a.append("vector_store_id",_.value.vector_store_id);const{data:i,error:I}=await Q(w+"/api/update_assistant/"+l.value.id,{credentials:"include",method:"POST",watch:!1,headers:{"X-XSRF-TOKEN":R("XSRF-TOKEN"),"Accept-Language":O.value},body:a},"$mS3MePmTM7");if(i.value!=null&&i.value.status===!1&&k.error(i.value.message,{position:"top"}),i.value!=null&&i.value.status===!0){const c={id:i.value.id,name:l.value.name,description:l.value.description};C("updateAssistant",c),m.value.click(),k.success(i.value.message,{position:"top"})}
1else I.value!=null&&(r.value=I.value.data.errors);v.value=!1},T=()=>{l.value.file_search=!l.value.file_search},M=async()=>{l.value.open_ai_token_id==h.public.NEUROSPACE_DEFAULT_OPEN_AI_TOKEN_ID&&(l.value.file_search=!1,l.value.vector_store_id=null),l.value.vector_store_id=null;const{data:a,error:i}=await Q(w+"/api/vector_store/list",{credentials:"include",method:"GET",watch:!1,headers:{"X-XSRF-TOKEN":R("XSRF-TOKEN"),"Accept-Language":O.value},query:{open_ai_token_id:l.value.open_ai_token_id,type_id:1}},"$exIVIgVFRW");a.value.status===!0&&(t.items=a.value.data)};return(a,i)=>{const I=Y;return d(),u("div",null,[e("div",{id:"update-assistant-modal-"+_.value.id,ref_key:"modal",ref:m,tabindex:"-1","aria-hidden":"true",class:"hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-modal md:h-full"},[e("div",Oe,[e("div",Te,[e("div",Me,[e("h3",Ne,s(a.$t("assistant.update_modal.head")),1),e("button",{type:"button",class:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600","data-modal-toggle":"update-assistant-modal-"+_.value.id},je,8,ze)]),e("div",null,[e("div",De,[e("label",{for:"open_ai_token_id="+_.value.id,class:"block mb-2 text-sm font-medium text-gray-900"},s(a.$t("assistant.create_modal.key")),9,Ue),o(b).items.length>0?(d(),u("div",Ve,[$(e("select",{onChange:M,"onUpdate:modelValue":i[0]||(i[0]=c=>l.value.open_ai_token_id=c),id:"open_ai_token_id="+_.value.id,class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-orange-500 focus:border-orange-500 block w-full p-2.5"},[(d(!0),u(D,null,F(o(b).items,c=>(d(),u("option",{value:c.id},s(c.description),9,Be))),256))],40,Fe),[[K,l.value.open_ai_token_id]]),e("div",Ke,[r.value.open_ai_token_id&&r.value.open_ai_token_id.length>0?(d(),u("span",Re,s(r.value.open_ai_token_id[0]),1)):S("",!0)])])):(d(),u("div",Xe,[e("input",{class:"bg-gray-50 border border-red-600 text-gray-900 text-sm rounded-lg block w-full p-2.5 placeholder-red-600",placeholder:a.$t("chatbot.create_modal.prompts.model_empty_error"),disabled:""},null,8,Pe),e("div",qe,[e("span",He,[E(I,{to:"/account/open_ai_settings"},{default:V(()=>[g("+ "+s(a.$t("chatbot.create_modal.buttons.add_key")),1)]),_:1})])])]))]),e("div",Ge,[e("label",{for:"model_gpt_id-"+_.value.id,class:"block mb-2 text-sm font-medium text-gray-900"},[g(s(a.$t("chatbot.create_modal.inputs.model"))+" ",1),Ze,e("div",Je,[e("div",Qe,[e("p",null,s(a.$t("chatbot.create_modal.prompts.model")),1)]),Ye])],8,We),$(e("select",{"onUpdate:modelValue":i[1]||(i[1]=c=>l.value.model_gpt_id=c),id:"model_gpt_id-"+_.value.id,class:N(["bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-orange-500 focus:border-orange-500 block w-full p-2.5",r.value.model_gpt_id&&r.value.model_gpt_id.length>0?"border-red-600":""])},[(d(!0),u(D,null,F(n.value,c=>(d(),u("option",{value:c.id},s(c.name),9,tt))),256))],10,et),[[K,l.value.model_gpt_id]]),e("div",st,[r.value.model_gpt_id&&r.value.model_gpt_id.length>0?(d(),u("span",ot,s(r.value.model_gpt_id[0]),1)):S("",!0)])]),e("div",at,[e("label",{for:"name-"+_.value.id,class:"block mb-2 text-sm font-medium text-gray-900"},s(a.$t("assistant.create_modal.inputs.name")),9,nt),$(e("input",{type:"text","onUpdate:modelValue":i[2]||(i[2]=c=>l.value.name=c),name:"name-"+_.value.id,id:"name-"+_.value.id,class:N(["bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-orange-600 focus:border-orange-600 block w-full p-2.5",r.value.name&&r.value.name.length>0?"border-red-600":""])},null,10,rt),[[P,l.value.name]]),e("div",it,[r.value.name&&r.value.name.length>0?(d(),u("span",dt,s(r.value.name[0]),1)):S("",!0)])]),e("div",lt,[e("label",{for:"description-"+_.value.id,class:"block mb-2 text-sm font-medium text-gray-900"},[g(s(a.$t("assistant.create_modal.inputs.description"))+" ",1),ut,e("div",_t,[e("div",pt,[e("p",null,s(a.$t("assistant.create_modal.inputs.description")),1)]),gt])],8,ct),$(e("textarea",{name:"description-"+_.value.id,id:"description-"+_.value.id,"onUpdate:modelValue":i[3]||(i[3]=c=>l.value.description=c),rows:"2",class:N(["block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-orange-500 focus:border-orange-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-orange-500 dark:focus:border-orange-500",r.value.description&&r.value.description.length>0?"border-red-600":""])},null,10,mt),[[P,l.value.description]]),e("div",ht,[r.value.description&&r.value.description.length>0?(d(),u("span",vt,s(r.value.description[0]),1)):S("",!0)])]),e("div",bt,[e("label",{for:"instructions-"+_.value.id,class:"block mb-2 text-sm font-medium text-gray-900"}
1,[g(s(a.$t("assistant.create_modal.inputs.instructions"))+" ",1),yt,e("div",xt,[e("div",kt,[e("p",null,s(a.$t("assistant.create_modal.inputs.instructions")),1)]),wt])],8,ft),$(e("textarea",{name:"instructions-"+_.value.id,id:"instructions-"+_.value.id,"onUpdate:modelValue":i[4]||(i[4]=c=>l.value.instructions=c),rows:"2",class:N(["block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-orange-500 focus:border-orange-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-orange-500 dark:focus:border-orange-500",r.value.instructions&&r.value.instructions.length>0?"border-red-600":""])},null,10,$t),[[P,l.value.instructions]]),e("div",At,[r.value.instructions&&r.value.instructions.length>0?(d(),u("span",Ct,s(r.value.instructions[0]),1)):S("",!0)])]),e("div",Et,[e("label",St,[e("input",{disabled:l.value.open_ai_token_id==o(h).public.NEUROSPACE_DEFAULT_OPEN_AI_TOKEN_ID,type:"checkbox",class:"sr-only peer",checked:l.value.file_search==1,onChange:T},null,40,Ot),Tt,e("span",Mt,s(a.$t("assistant.update_modal.inputs.checkbox")),1)])]),$(e("div",Nt,[zt,$(e("select",{"onUpdate:modelValue":i[5]||(i[5]=c=>_.value.vector_store_id=c),id:"vector_store_id-"+_.value.id,class:N(["bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-orange-500 focus:border-orange-500 block w-full p-2.5",r.value.vector_store_id&&r.value.vector_store_id.length>0?"border-red-600":""])},[(d(!0),u(D,null,F(o(t).items,c=>(d(),u("option",{value:c.id,selected:c.id==l.value.vector_store_id},s(c.name),9,It))),256))],10,Lt),[[K,_.value.vector_store_id]]),e("div",jt,[r.value.vector_store_id&&r.value.vector_store_id.length>0?(d(),u("span",Dt,s(r.value.vector_store_id[0]),1)):S("",!0)])],512),[[oe,l.value.file_search]]),e("div",Ut,[e("button",{onClick:i[6]||(i[6]=c=>x()),type:"button",style:{"min-width":"100px","min-height":"44px"},class:"text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"},[v.value?(d(),u("span",Vt)):(d(),u("span",Ft,s(a.$t("assistant.update_modal.buttons.save")),1))])])]),Bt])])],8,Se)])}}},Rt=G(Kt,[["__scopeId","data-v-6670f49b"]]),Xt={class:"border-b"},Pt={scope:"row",class:"px-4 py-3 font-medium text-gray-900 whitespace-nowrap"},qt={scope:"row",class:"px-4 py-3 font-medium text-gray-900 whitespace-nowrap"},Ht={scope:"row",class:"px-4 py-3 font-medium text-gray-900"},Gt={class:"px-4 py-3 flex items-center justify-end"},Wt=["data-dropdown-toggle"],Zt=e("svg",{class:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewbox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M6 10a2 2 0 11-4 0 2 2 0 014 0zM12 10a2 2 0 11-4 0 2 2 0 014 0zM16 12a2 2 0 100-4 2 2 0 000 4z"})],-1),Jt=[Zt],Qt=["id"],Yt=["data-modal-toggle","data-modal-target"],es=["data-modal-toggle","data-modal-target"],ts={__name:"ItemAssistant",props:["item","gpt_models","open_ai_tokens"],emits:["deleteAssistant","updateAssistant"],setup(p,{emit:L}){const k=L;te(async()=>{await ae(),de(),le()}),q().public.BACKEND_HOST;const A=p,h=f(A.item),w=f(A.gpt_models),m=j({items:A.open_ai_tokens});X(()=>A.gpt_models,()=>{w.value=A.gpt_models}),X(()=>A.open_ai_tokens,()=>{m.items=A.open_ai_tokens});const r=y=>{k("deleteAssistant")},v=y=>{k("updateAssistant")};return(y,_)=>{const n=Ee,b=Rt;return d(),u("tr",Xt,[e("td",Pt,s(h.value.id),1),e("td",qt,s(h.value.name),1),e("td",Ht,s(h.value.description),1),e("td",Gt,[e("button",{"data-dropdown-toggle":"table-assistant-dropdown-"+h.value.id,class:"inline-flex items-center p-0.5 text-sm font-medium text-center text-gray-500 hover:text-gray-800 rounded-lg focus:outline-none",type:"button"},Jt,8,Wt),e("div",{id:"table-assistant-dropdown-"+h.value.id,class:"hidden z-10 w-44 bg-white rounded divide-y divide-gray-100 shadow"},[e("ul",null,[e("li",null,[e("a",{href:"#","data-modal-toggle":"delete-assistant-modal-"+h.value.id,"data-modal-target":"delete-assistant-modal-"+h.value.id,class:"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600"},s(y.$t("assistant.actions.delete")),9,Yt)]),e("li",null,[e("a",{href:"#","data-modal-toggle":"update-assistant-modal-"+h.value.id,"data-modal-target":"update-assistant-modal-"+h.value.id,class:"block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600"}
1,s(y.$t("assistant.actions.update")),9,es)])])],8,Qt)]),E(n,{item:h.value,onDeleteAssistant:r},null,8,["item"]),E(b,{item:h.value,gpt_models:w.value,open_ai_tokens:o(m).items,onUpdateAssistant:v},null,8,["item","gpt_models","open_ai_tokens"])])}}};const U=p=>(Z("data-v-0cc88139"),p=p(),J(),p),ss={class:"relative p-4 w-full max-w-2xl h-full md:h-auto"},os={class:"relative p-4 bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5"},as={class:"flex justify-between items-center pb-4 mb-4 rounded-t border-b sm:mb-5 dark:border-gray-600"},ns={class:"text-lg font-semibold text-gray-900 dark:text-white"},rs=U(()=>e("button",{type:"button",class:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600","data-modal-toggle":"create-assistant-modal"},[e("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})]),e("span",{class:"sr-only"},"Close modal")],-1)),is={class:"mb-4"},ds={for:"open_ai_token_id",class:"block mb-2 text-sm font-medium text-gray-900"},ls={key:0},cs=["value"],us={class:"error"},_s={key:0,class:"text-sm text-red-600"},ps={key:1},gs=["placeholder"],ms={class:"error w-full flex justify-end"},hs={class:"text-right text-sm text-red-600 mt-1"},vs={class:"mb-4"},bs={for:"model_gpt_id",class:"block mb-2 text-sm font-medium text-gray-900"},fs=U(()=>e("button",{"data-popover-target":"popover-model_gpt_id","data-popover-placement":"bottom-end",type:"button"},[e("svg",{class:"w-4 h-4 text-gray-400 hover:text-gray-500","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"})]),e("span",{class:"sr-only"},"Show information")],-1)),ys={"data-popover":"",id:"popover-model_gpt_id",role:"tooltip",class:"absolute z-10 invisible inline-block text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-sm opacity-0 w-72 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400"},xs={class:"p-3 space-y-2"},ks=U(()=>e("div",{"data-popper-arrow":""},null,-1)),ws=["value"],$s={class:"error"},As={key:0,class:"text-sm text-red-600"},Cs={class:"mb-4"},Es={for:"name",class:"block mb-2 text-sm font-medium text-gray-900"},Ss={class:"error"},Os={key:0,class:"text-sm text-red-600"},Ts={class:"mb-4"},Ms={for:"description",class:"block mb-2 text-sm font-medium text-gray-900"},Ns=U(()=>e("button",{"data-popover-target":"popover-instructions","data-popover-placement":"bottom-end",type:"button"},[e("svg",{class:"w-4 h-4 text-gray-400 hover:text-gray-500","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"})]),e("span",{class:"sr-only"},"Show information")],-1)),zs={"data-popover":"",id:"popover-description",role:"tooltip",class:"absolute z-10 invisible inline-block text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-sm opacity-0 w-72 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400"},Ls={class:"p-3 space-y-2"},Is=U(()=>e("div",{"data-popper-arrow":""},null,-1)),js={class:"error"},Ds={key:0,class:"text-sm text-red-600"},Us={class:"mb-4"},Vs={for:"instructions",class:"block mb-2 text-sm font-medium text-gray-900"},Fs=U(()=>e("button",{"data-popover-target":"popover-instructions","data-popover-placement":"bottom-end",type:"button"},[e("svg",{class:"w-4 h-4 text-gray-400 hover:text-gray-500","aria-hidden":"true",fill:"
1currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-3a1 1 0 00-.867.5 1 1 0 11-1.731-1A3 3 0 0113 8a3.001 3.001 0 01-2 2.83V11a1 1 0 11-2 0v-1a1 1 0 011-1 1 1 0 100-2zm0 8a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"})]),e("span",{class:"sr-only"},"Show information")],-1)),Bs={"data-popover":"",id:"popover-instructions",role:"tooltip",class:"absolute z-10 invisible inline-block text-sm text-gray-500 transition-opacity duration-300 bg-white border border-gray-200 rounded-lg shadow-sm opacity-0 w-72 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400"},Ks={class:"p-3 space-y-2"},Rs=U(()=>e("div",{"data-popper-arrow":""},null,-1)),Xs={class:"error"},Ps={key:0,class:"text-sm text-red-600"},qs={class:"mb-4"},Hs={class:"relative inline-flex items-center cursor-pointer"},Gs=["disabled"],Ws=U(()=>e("div",{class:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-orange-300 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-600"},null,-1)),Zs={class:"ms-3 text-sm font-medium text-gray-900 dark:text-gray-300"},Js={class:"mb-4"},Qs={class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white"},Ys=["value"],eo={class:"error"},to={key:0,class:"text-sm text-red-600"},so={class:"flex items-center space-x-4"},oo={key:0,class:"loader"},ao={key:1},no=U(()=>e("div",{class:"flex items-center space-x-4"},null,-1)),ro={__name:"CreateAssistantModal",props:["gpt_models","open_ai_tokens"],emits:["createAssistant"],setup(p,{emit:L}){const{$toast:k}=ee(),{locale:O,t:A}=W(),h=q(),w=h.public.BACKEND_HOST,m=p,r=f(m.gpt_models.filter(a=>a.id!=15&&a.id!=16)),v=j({items:m.open_ai_tokens}),y=j({});X(()=>m.gpt_models,()=>{r.value=m.gpt_models.filter(a=>a.id!=15&&a.id!=16)}),X(()=>m.open_ai_tokens,()=>{v.items=m.open_ai_tokens,t.value.open_ai_token_id=v.items.length>0?v.items[0].id:null}),te(async()=>{await M()});const _=f(null),n=f({}),b=f(!1),t=f({open_ai_token_id:null,model_gpt_id:1,name:null,description:null,instructions:null,file_search:0,vector_store_id:null}),l=L,C=async()=>{b.value=!0,n.value={};const a=new FormData;t.value.open_ai_token_id&&a.append("open_ai_token_id",t.value.open_ai_token_id),t.value.model_gpt_id&&a.append("model_gpt_id",t.value.model_gpt_id),t.value.name&&a.append("name",t.value.name),t.value.description&&a.append("description",t.value.description),t.value.file_search&&a.append("file_search",t.value.file_search?1:""),t.value.instructions&&a.append("instructions",t.value.instructions),t.value.vector_store_id&&a.append("vector_store_id",t.value.vector_store_id);const{data:i,error:I}=await Q(w+"/api/assistant",{credentials:"include",method:"POST",watch:!1,headers:{"X-XSRF-TOKEN":R("XSRF-TOKEN"),"Accept-Language":O.value},body:a},"$iAhRLsv5w7");if(i.value!=null&&i.value.status===!1&&k.error(i.value.message,{position:"top"}),i.value!=null&&i.value.status===!0){const c={id:i.value.id,name:t.value.name,description:t.value.description};l("createAssistant",c),x(),k.success(i.value.message,{position:"top"})}else I.value!=null&&(n.value=I.value.data.errors);b.value=!1},x=()=>{_.value.click(),T()},T=()=>{t.value={open_ai_token_id:t.value.open_ai_token_id=v.items.length>0?v.items[0].id:null,model_gpt_id:1,name:null,description:null,instructions:null,file_search:!1,vector_store_id:null}},M=async()=>{t.value.open_ai_token_id==h.public.NEUROSPACE_DEFAULT_OPEN_AI_TOKEN_ID&&(t.value.file_search=!1,t.value.vector_store_id=null),t.value.vector_store_id=null;const{data:a,error:i}=await Q(w+"/api/vector_store/list",{credentials:"include",method:"GET",watch:!1,headers:{"X-XSRF-TOKEN":R("XSRF-TOKEN"),"Accept-Language":O.value},query:{open_ai_token_id:t.value.open_ai_token_id,type_id:1}},"$s0Az0PB6ht");a.value.status===!0&&(y.value=a.value.data)};return(a,i)=>{const I=Y;return d(),u("div",null,[e("div",{id:"create-assistant-modal",ref_key:"modal",ref:_,tabindex:"-1","aria-hidden":"true",class:"hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-modal md:h-full"},[e("div",ss,[e("div",os,[e("div",as,[e("h3",ns,s(a.$t("assistant.create_modal.head")),1),rs]),e("div",null,[e("div",is,[e("label",ds,s(a.$t("assistant.create_modal.key")),1),o(v).items.length>0?(d(),u("div",ls,[$(e("select",{onChange:M,"onUpdate:modelValue":i[0]||(i[0]=c=>o(t).open_ai_token_id=c),id:"open_ai_token_id",class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-orange-500 focus:border-orange-500 block w-full p-2.5"},[(d(!0),u(D,null,F(o(v).items,c=>(d(),u("option",{value:c.id},s(c.description),9,cs))),256))],544),[[K,o(t).open_ai_token_id]]),e("div",us,[o(n).open_ai_token_id&&o(n).open_ai_token_id.length>0?(d(),u("span",_s,s(o(n).open_ai_token_id[0]),1)):S("",!0)])])):(d(),u("div",ps,[e("input",{class:"bg-gray-50 border border-red-600 text-gray-900 text-sm rounded-lg block w-full p-2.5 placeholder-red-600",placeholder:a.$t("chatbot.create_modal.prompts.model_empty_error"),disabled:""},null,8,gs),e("div",ms,[e("span",hs,[E(I,{to:"/account/open_ai_settings"},{default:V(()=>[g("+ "+s(a.$t("chatbot.create_modal.buttons.add_key")),1)]),_:1})])])]))]),e("div",vs,[e("label",bs,[g(s(a.$t("chatbot.create_modal.input
1s.model"))+" ",1),fs,e("div",ys,[e("div",xs,[e("p",null,s(a.$t("chatbot.create_modal.prompts.model")),1)]),ks])]),$(e("select",{"onUpdate:modelValue":i[1]||(i[1]=c=>o(t).model_gpt_id=c),id:"model_gpt_id",class:N(["bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-orange-500 focus:border-orange-500 block w-full p-2.5",o(n).model_gpt_id&&o(n).model_gpt_id.length>0?"border-red-600":""])},[(d(!0),u(D,null,F(o(r),c=>(d(),u("option",{value:c.id},s(c.name),9,ws))),256))],2),[[K,o(t).model_gpt_id]]),e("div",$s,[o(n).model_gpt_id&&o(n).model_gpt_id.length>0?(d(),u("span",As,s(o(n).model_gpt_id[0]),1)):S("",!0)])]),e("div",Cs,[e("label",Es,s(a.$t("assistant.create_modal.inputs.name")),1),$(e("input",{type:"text","onUpdate:modelValue":i[2]||(i[2]=c=>o(t).name=c),name:"name",id:"name",class:N(["bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-orange-600 focus:border-orange-600 block w-full p-2.5",o(n).name&&o(n).name.length>0?"border-red-600":""])},null,2),[[P,o(t).name]]),e("div",Ss,[o(n).name&&o(n).name.length>0?(d(),u("span",Os,s(o(n).name[0]),1)):S("",!0)])]),e("div",Ts,[e("label",Ms,[g(s(a.$t("assistant.create_modal.inputs.description"))+" ",1),Ns,e("div",zs,[e("div",Ls,[e("p",null,s(a.$t("assistant.create_modal.inputs.description")),1)]),Is])]),$(e("textarea",{name:"description",id:"description","onUpdate:modelValue":i[3]||(i[3]=c=>o(t).description=c),rows:"2",class:N(["block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-orange-500 focus:border-orange-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-orange-500 dark:focus:border-orange-500",o(n).description&&o(n).description.length>0?"border-red-600":""])},null,2),[[P,o(t).description]]),e("div",js,[o(n).description&&o(n).description.length>0?(d(),u("span",Ds,s(o(n).description[0]),1)):S("",!0)])]),e("div",Us,[e("label",Vs,[g(s(a.$t("assistant.create_modal.inputs.instructions"))+" ",1),Fs,e("div",Bs,[e("div",Ks,[e("p",null,s(a.$t("assistant.create_modal.inputs.instructions")),1)]),Rs])]),$(e("textarea",{name:"instructions",id:"instructions","onUpdate:modelValue":i[4]||(i[4]=c=>o(t).instructions=c),rows:"2",class:N(["block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-orange-500 focus:border-orange-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-orange-500 dark:focus:border-orange-500",o(n).instructions&&o(n).instructions.length>0?"border-red-600":""])},null,2),[[P,o(t).instructions]]),e("div",Xs,[o(n).instructions&&o(n).instructions.length>0?(d(),u("span",Ps,s(o(n).instructions[0]),1)):S("",!0)])]),e("div",qs,[e("label",Hs,[$(e("input",{disabled:o(t).open_ai_token_id==o(h).public.NEUROSPACE_DEFAULT_OPEN_AI_TOKEN_ID,type:"checkbox",class:"sr-only peer","onUpdate:modelValue":i[5]||(i[5]=c=>o(t).file_search=c)},null,8,Gs),[[re,o(t).file_search]]),Ws,e("span",Zs,s(a.$t("assistant.create_modal.inputs.checkbox")),1)])]),$(e("div",Js,[e("label",Qs,s(a.$t("vector_stores")),1),$(e("select",{"onUpdate:modelValue":i[6]||(i[6]=c=>o(t).vector_store_id=c),id:"vector_store_id",class:N(["bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-orange-500 focus:border-orange-500 block w-full p-2.5",o(n).vector_store_id&&o(n).vector_store_id.length>0?"border-red-600":""])},[(d(!0),u(D,null,F(o(y).value,c=>(d(),u("option",{value:c.id},s(c.name),9,Ys))),256))],2),[[K,o(t).vector_store_id]]),e("div",eo,[o(n).vector_store_id&&o(n).vector_store_id.length>0?(d(),u("span",to,s(o(n).vector_store_id[0]),1)):S("",!0)])],512),[[oe,o(t).file_search]]),e("div",so,[e("button",{onClick:i[7]||(i[7]=c=>C()),type:"button",style:{"min-width":"100px","min-height":"44px"},class:"text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"},[o(b)?(d(),u("span",oo)):(d(),u("span",ao,s(a.$t("assistant.create_modal.buttons.create")),1))])])]),no])])],512)])}}},io=G(ro,[["__scopeId","data-v-0cc88139"]]);const ne=p=>(Z("data-v-93b28e0c"),p=p(),J(),p),lo={class:"relative p-4 w-full max-w-2xl h-full md:h-auto"},co={class:"relative p-4 bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5"},uo={class:"flex justify-between items-center pb-4 mb-4 rounded-t border-b sm:mb-5 dark:border-gray-600"},_o={class:"text-lg font-semibold text-gray-900 dark:text-white"},po=ne(()=>e("button",{type:"button",class:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600","data-modal-toggle":"import-assistant-modal"},[e("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})]),e("span",{class:"sr-only"},"Close modal")],-1)),go={class:"mb-4"},mo={for:"open_ai_token_id",class:"block mb-2 text-sm font-medium text-gray-900"},ho={key:0},vo=["value"],bo={key:1},fo=["placeholder"],yo={class:"error w-full flex justify-end"},xo={class:"text-right text-sm text-red-600 mt-1"},ko={class:"flex items-center space-x-4"},wo={key:0,class:"loader"},$o={key:1},Ao=ne(()=>e("div",{class:"flex items-center space-x-4"},null,-1)),Co={__name:"ImportAssistantModal",props:["gpt_models","open_ai_tokens"],emits:["importAssistant"],setup(p,{emit:L}){const{$toast:k}=ee(),{locale:O,t:A}=W(),w=q().public.BACKEND_HOST,m=p,r=j({items:m.open_ai_tokens});X(()=>m.open_ai_tokens,()=>{r.items=m.open_ai_tokens,n.value.open_ai_token_id=r.items.length>0?r.items[0].id:null});const v=f(null),y=f({}),_=f(!1),n=f({open_ai_token_id:null}),b=L,t=async()=>{_.value=!0,y.value={};const{data:x,error:T}=await H(w+"/api/assistant/import",{credentials:"include",method:"POST",watch:!1,headers:{"X-XSRF-TOKEN":R("XSRF-TOKEN"),"Accept-Language":O.value},body:{open_ai_token_id:n.value.open_ai_token_id}});if(x.value!=null&&x.value.status===!1&&k.error(x.value.message,{position:"top"}),x.value!=null&&x.value.status===!0){const M={id:x.value.id,name:n.value.name,description:n.value.description};b("importAssistant",M),l(),k.success(x.value.message,{position:"top"})}else T.value!=null&&(y.value=T.value.data.errors);_.value=!1},l=()=>{v.value.click(),C()},C=()=>{n.value={open_ai_token_id:n.value.open_ai_token_id=r.items.length>0?r.items[0].id:null}};return(x,T)=>{const M=Y;return d(),u("div",null,[e("div",{id:"import-assistant-modal",ref_key:"modal",ref:v,tabindex:"-1","aria-hidden":"true",class:"hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-modal md:h-full"},[e("div",lo,[e("div",co,[e("div",uo,[e("h3",_o,s(x.$t("assistant.import_modal.head")),1),po]),e("div",null,[e("div",go,[e("label",mo,s(x.$t("assistant.import_modal.key")),1),o(r).items.length>0?(d(),u("div",ho,[$(e("select",{"onUpdate:modelValue":T[0]||(T[0]=a=>o(n).open_ai_token_id=a),id:"open_ai_token_id",class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-orange-500 focus:border-orange-500 block w-full p-2.5"},[(d(!0),u(D,null,F(o(r).items,a=>(d(),u("option",{value:a.id},s(a.description),9,vo))),256))],512),[[K,o(n).open_ai_token_id]])])):(d(),u("div",bo,[e("input",{class:"bg-gray-50 border border-red-600 text-gray-900 text-sm rounded-lg block w-full p-2.5 placeholder-red-600",placeholder:x.$t("chatbot.create_modal.prompts.model_empty_error"),disabled:""},null,8,fo),e("div",yo,[e("span",xo,[E(M,{to:"/account/open_ai_settings"},{default:V(()=>[g("+ "+s(x.$t("chatbot.create_modal.buttons.add_key")),1)]),_:1})])])]))]),e("div",ko,[e("button",{onClick:t,type:"button",style:{"min-width":"100px","min-height":"44px"},class:"text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:outline-none focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center"},[o(_)?(d(),u("span",wo)):(d(),u("span",$o,s(x.$t("assistant.import_modal.buttons.import")),1))])])]),Ao])])],512)])}}},Eo=G(Co,[["__scopeId","data-v-93b28e0c"]]);const B=p=>(Z("data-v-3fca4099"),p=p(),J(),p),So={class:"bg-white"},Oo={class:"mx-auto max-w-7xl px-4 pt-6 sm:px-6 lg:px-8 pb-7"},To={class:"text-3xl font-semibold tracking-tight text-gray-900"},Mo={class:"font-normal text-gray-500 pt-2"},No={class:"bg-gray-50"},zo={class:"mx-auto max-w-7xl py-6 sm:px-6 lg:px-8"},Lo={class:"relative overflow-hidden bg-white shadow-md md:rounded-lg"},Io={class:"flex flex-col items-center justify-between p-4 space-y-3 md:flex-row md:space-y-0 md:space-x-4"},jo={id:"create-assistant-button","data-modal-target":"create-assistant-modal","data-modal-toggle":"create-assistant-modal",type:"button",class:"flex items-center justify-center w-full px-4 py-2 text-sm font-medium text-white rounded-lg md:w-auto bg-tempoOrange-500 hover:bg-orange-800 focus:ring-4 focus:ring-orange-300"},Do=B(()=>e("svg",{class:"mr-1.5",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",fill:"#fff",x:"0px",y:"0px",width:"10px",height:"10px",viewBox:"0 0 122.875 122.648","enable-background":"new 0 0 122.875 122.648","xml:space":"preserve"},[e("g",null,[e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M108.993,47.079c7.683-0.059,13.898,6.12,13.882,13.805 c-0.018,7.683-6.26,13.959-13.942,14.019L75.24,75.138l-0.235,33.73c-0.063,7.619-6.338,13.789-14.014,13.78 c-7.678-0.01-13.848-6.
1197-13.785-13.818l0.233-33.497l-33.558,0.235C6.2,75.628-0.016,69.448,0,61.764 c0.018-7.683,6.261-13.959,13.943-14.018l33.692-0.236l0.236-33.73C47.935,6.161,54.209-0.009,61.885,0 c7.678,0.009,13.848,6.197,13.784,13.818l-0.233,33.497L108.993,47.079L108.993,47.079z"})])],-1)),Uo={class:"overflow-x-auto min-h-[300px]"},Vo={key:0,class:"flex items-center justify-center min-h-[300px]"},Fo=B(()=>e("div",{class:"loader"},null,-1)),Bo=[Fo],Ko={key:1,class:"overflow-x-auto min-h-[300px] flex justify-center items-center"},Ro={key:2,class:"w-full text-sm text-left text-gray-500 dark:text-gray-400"},Xo={class:"text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"},Po={scope:"col",class:"px-4 py-3"},qo={scope:"col",class:"px-4 py-3"},Ho={scope:"col",class:"px-4 py-3 w-1/3"},Go=B(()=>e("th",{scope:"col",class:"px-4 py-3"},null,-1)),Wo={class:"flex flex-col md:flex-row justify-between items-start md:items-center space-y-3 md:space-y-0 p-4","aria-label":"Table navigation"},Zo={class:"text-sm font-normal text-gray-500 dark:text-gray-400"},Jo={class:"font-semibold text-gray-900 dark:text-white"},Qo={class:"font-semibold text-gray-900 dark:text-white"},Yo=B(()=>e("ul",{class:"inline-flex items-stretch -space-x-px"},[e("li",null,[e("a",{href:"#",class:"flex items-center justify-center h-full py-1.5 px-3 ml-0 text-gray-500 bg-white rounded-l-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700"},[e("span",{class:"sr-only"},"Previous"),e("svg",{class:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewbox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})])])]),e("li",null,[e("a",{href:"#","aria-current":"page",class:"flex items-center justify-center text-sm z-10 py-2 px-3 leading-tight text-orange-600 bg-orange-50 border border-orange-300 hover:bg-orange-100 hover:text-orange-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white"},"1")]),e("li",null,[e("a",{href:"#",class:"flex items-center justify-center h-full py-1.5 px-3 leading-tight text-gray-500 bg-white rounded-r-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"},[e("span",{class:"sr-only"},"Next"),e("svg",{class:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewbox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[e("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})])])])],-1)),ea={class:"mt-5"},ta={id:"accordion-flush","data-accordion":"collapse","data-active-classes":"dark:bg-gray-900 text-gray-900 dark:text-white","data-inactive-classes":"text-black dark:text-gray-400"},sa={id:"accordion-flush-heading-1"},oa={type:"button",class:"flex items-center justify-between w-full py-5 font-medium rtl:text-right text-black border-b border-gray-200 dark:border-gray-700 dark:text-gray-400 gap-3","data-accordion-target":"#accordion-flush-body-1","aria-expanded":"false","aria-controls":"accordion-flush-body-1"},aa=B(()=>e("svg",{"data-accordion-icon":"",class:"w-3 h-3 rotate-180 shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6"},[e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5 5 1 1 5"})],-1)),na={id:"accordion-flush-body-1",class:"hidden","aria-labelledby":"accordion-flush-heading-1"},ra={class:"py-5 border-b border-gray-200 dark:border-gray-700"},ia={class:"mb-2 text-gray-500 dark:text-gray-400"},da={class:"text-gray-500 dark:text-gray-400"},la={class:"text-gray-500 dark:text-gray-400"},ca={class:"text-gray-500 dark:text-gray-400"},ua={class:"text-gray-500 dark:text-gray-400"},_a={class:"text-gray-500 dark:text-gray-400"},pa={class:"text-gray-500 dark:text-gray-400"},ga=B(()=>e("a",{class:"text-tempoOrange-500 underline",href:"mailto:[email protected]",target:"_blank"},"[email protected]",-1)),ma={class:"text-tempoOrange-500 underline",href:"https://t.me/neurospace_support",target:"_blank"},ha={class:"text-gray-500 dark:text-gray-400"},va={class:"mt-2 text-gray-500 dark:text-gray-400"},ba={id:"accordion-flush-heading-2"},fa={type:"button",class:"flex items-center justify-between w-full py-5 font-medium rtl:text-right text-black border-b border-gray-200 dark:border-gray-700 dark:text-gray-400 gap-3","data-accordion-target":"#accordion-flush-body-2","aria-expanded":"false","aria-controls":"accordion-flush-body-2"},ya=B(()=>e("svg",{"data-accordion-icon":"",class:"w-3 h-3 rotate-180 shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6"},[e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5 5 1 1 5"})],-1)),xa={id:"accordion-flush-body-2",class:"hidden","aria-labelledby":"accordion-flush-heading-2"},ka={class:"py-5 border-b border-gray-200 dark:border-gray-700"},wa={class:"mb-2 text-gray-500 dark:text-gray-400"},$a={id:"accordion-flush-heading-3"},Aa={type:"button",class:"flex items-center justify-between w-full py-5 font-medium rtl:text-right text-black border-b border-gray-200 dark:border-gray-700 dark:text-gray-400 gap-3","data-accordion-target":"#accordion-flush-body-3","aria-expanded":"false","aria-controls":"accordion-flush-body-3"},Ca=B(()=>e("svg",{"data-accordion-icon":"",class:"w-3 h-3 rotate-180 shrink-0","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 10 6"},[e("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5 5 1 1 5"})],-1)),Ea={id:"accordion-flush-body-3",class:"hidden","aria-labelledby":"accordion-flush-heading-3"},Sa={class:"py-5 border-b border-gray-200 dark:border-gray-700"},Oa={class:"mb-2 text-gray-500 dark:text-gray-400"},Ta={class:"mb-2 text-gray-500 dark:text-gray-400"},Ma={__name:"assistants",emits:["deleteAssistant","updateAssistant"],setup(p,{emit:L}){const{t:k,locale:O}=W();ue({title:k("assistants")+" | NeuroSpace"}),te(async()=>{await ae(),ce(),await n(),await y(),await _()});const A=q(),h=A.public.BACKEND_HOST,w=j({items:[]}),m=f(!1),r=f([]),v=j({items:[]}),y=async()=>{try{const{error:t,data:l}=await H(h+"/api/user/open_ai_tokens/all",{credentials:"include",method:"GET"});l.value.status===!0&&(v.items=l.value.data.filter(C=>C.id!=A.public.NEUROSPACE_DEFAULT_OPEN_AI_TOKEN_ID))}catch(t){console.log(t)}},_=async()=>{try{const{error:t,data:l}=await H(h+"/api/gpt_models",{credentials:"include",method:"POST",headers:{"X-XSRF-TOKEN":R("XSRF-TOKEN")},body:{for_assistant:!0}});l.value.status===!0&&(r.value=l.value.data)}catch(t){console.log(t)}},n=async()=>{w.items=[],m.value=!0;try{const{error:t,data:l}=await H(h+"/api/assistant?version=2",{credentials:"include",method:"GET"});l.value.status===!0&&(w.items=l.value.data),m.value=!1}catch(t){console.log(t),m.value=!1}},b=async()=>{await n()};return(t,l)=>{const C=Y,x=ts,T=io,M=Eo;return d(),u(D,null,[e("div",null,[e("header",So,[e("div",Oo,[e("h1",To,s(t.$t("assistants")),1),e("p",Mo,[g(s(t.$t("assistant.instructions.head")),1),E(C,{class:"text-tempoOrange-500",to:"/account/open_ai_settings"},{default:V(()=>[g(s(t.$t("chatbot.settings_link")),1)]),_:1}
1)])])]),e("main",No,[e("div",zo,[e("div",Lo,[e("div",Io,[e("button",jo,[Do,g(" "+s(t.$t("assistant.buttons.new")),1)])]),e("div",Uo,[o(m)?(d(),u("div",Vo,Bo)):o(w).items.length==0?(d(),u("div",Ko,s(t.$t("table.no_data")),1)):(d(),u("table",Ro,[e("thead",Xo,[e("tr",null,[e("th",Po,s(t.$t("assistant.columns.id")),1),e("th",qo,s(t.$t("assistant.columns.name")),1),e("th",Ho,s(t.$t("assistant.columns.description")),1),Go])]),e("tbody",null,[(d(!0),u(D,null,F(o(w).items,(a,i)=>(d(),ie(x,{class:N(i%2>0?"bg-gray-50":"bg-white"),item:a,key:a.id,gpt_models:o(r),open_ai_tokens:o(v).items,onDeleteAssistant:b,onUpdateAssistant:b},null,8,["class","item","gpt_models","open_ai_tokens"]))),128))])]))]),e("nav",Wo,[e("span",Zo,[g(s(t.$t("table.showing"))+" ",1),e("span",Jo,s(o(w).items.length),1),g(" "+s(t.$t("table.of"))+" ",1),e("span",Qo,s(o(w).items.length),1)]),Yo])]),e("div",ea,[e("div",ta,[e("h2",sa,[e("button",oa,[e("span",null,s(t.$t("assistant.instructions.1.question")),1),aa])]),e("div",na,[e("div",ra,[e("p",ia,[g(s(t.$t("assistant.instructions.1.1.1"))+" ",1),E(C,{class:"text-tempoOrange-500",to:"/account/open_ai_settings"},{default:V(()=>[g(s(t.$t("chatbot.settings_link")),1)]),_:1}),g(". "+s(t.$t("assistant.instructions.1.1.2"))+" ",1),E(C,{class:"text-tempoOrange-500",to:"/account/vector_stores"},{default:V(()=>[g(s(t.$t("chatbot.instructions.1.2.4.2")),1)]),_:1}),g(". ")]),e("p",da,s(t.$t("assistant.instructions.1.1.3")),1),e("p",la,s(t.$t("assistant.instructions.1.2")),1),e("p",ca,s(t.$t("assistant.instructions.1.3")),1),e("p",ua,s(t.$t("assistant.instructions.1.4")),1),e("p",_a,s(t.$t("assistant.instructions.1.5")),1),e("p",pa,[g(s(t.$t("assistant.instructions.1.6"))+" ",1),ga,g(" "+s(t.$t("chatbot.instructions.1.1.14.5"))+" ",1),e("a",ma,s(t.$t("chatbot.instructions.1.1.14.6")),1),g(" "+s(t.$t("chatbot.instructions.1.1.14.3")),1)]),e("p",ha,[g(s(t.$t("assistant.instructions.1.7.1"))+" ",1),E(C,{class:"text-tempoOrange-500",to:"/account/vector_stores"},{default:V(()=>[g(s(t.$t("chatbot.instructions.1.2.4.2")),1)]),_:1}),g(" "+s(t.$t("assistant.instructions.1.7.2")),1)]),e("p",va,[g(s(t.$t("assistant.instructions.1.end.1"))+" ",1),E(C,{class:"text-tempoOrange-500",to:"/account/chatbot"},{default:V(()=>[g(s(t.$t("assistant.instructions.1.end.2")),1)]),_:1}),g(". ")])])]),e("h2",ba,[e("button",fa,[e("span",null,s(t.$t("assistant.instructions.2.question")),1),ya])]),e("div",xa,[e("div",ka,[e("p",wa,s(t.$t("assistant.instructions.2.1")),1)])]),e("h2",$a,[e("button",Aa,[e("span",null,s(t.$t("assistant.instructions.3.question")),1),Ca])]),e("div",Ea,[e("div",Sa,[e("p",Oa,s(t.$t("assistant.instructions.3.1")),1),e("p",Ta,s(t.$t("assistant.instructions.3.2")),1)])])])])])])]),E(T,{onCreateAssistant:b,gpt_models:o(r),open_ai_tokens:o(v).items},null,8,["gpt_models","open_ai_tokens"]),E(M,{onImportAssistant:b,gpt_models:o(r),open_ai_tokens:o(v).items},null,8,["gpt_models","open_ai_tokens"])],64)}}},Ua=G(Ma,[["__scopeId","data-v-3fca4099"]]);export{Ua as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.