import{ci as v,bv as g,l as p,az as o,V as r,b2 as e,a3 as a,cj as m,ck as y,a2 as b,cl as x,Y as c,X as Q,aF as w,cm as k,cn as _,bH as q,y as B,F as V,J as T,bQ as F,bK as I,bp as A,bq as C,bM as E,bR as G}from"./index.69621fe4.js";import{Q as H}from"./QFooter.369e2a28.js";const u=v.create();u.defaults.headers.common.Authorization="Bearer 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";u.defaults.baseURL="https://api.openai.com";const K={class:"q-pa-md"},L={style:{width:"100%"}},U={__name:"chatGpt",setup(M){const{agente:h}=g(),s=p(""),n=p([]);async function i(){n.value.push({name:"Eu",send:!0,text:s.value});try{const l=await u.post("/v1/completions",{model:"text-davinci-003",prompt:s.value,temperature:.9,max_tokens:2048,top_p:1,frequency_penalty:0,presence_penalty:.6,stop:[" Human:"," AI:"]});s.value="",n.value.push({name:"ChatGPT",send:!1,text:l.data.choices[0].text})}catch(l){console.log("Erro: ",l)}}return(l,d)=>(o(),r(G,{view:"hHr LpR lFr",container:""},{default:e(()=>[a(x,{class:"page_cabecalho shadow-1"},{default:e(()=>[a(m,null,{default:e(()=>[a(y,null,{default:e(()=>[b(" Vamos bater um papo com o chatGPT? ")]),_:1})]),_:1})]),_:1}),a(F,null,{default:e(()=>[c("div",K,[c("div",L,[(o(!0),Q(T,null,w(n.value,(t,f)=>(o(),r(k,{"text-html":"",key:f,name:t.name,sent:t.send,"text-color":"white","bg-color":"primary"},{avatar:e(()=>[t.send?(o(),r(_,{key:0,class:"q-mr-sm"},{default:e(()=>[a(q,{src:B(h).imageProfile},null,8,["src"])]),_:1})):(o(),r(_,{key:1,color:"primary","text-color":"white",class:"q-mr-sm",icon:"mdi-robot"}))]),default:e(()=>[c("div",null,V(t.text),1)]),_:2},1032,["name","sent"]))),128))])])]),_:1}),a(H,{class:"chat_digitar q-pa-sm"},{default:e(()=>[a(m,{dense:""},{default:e(()=>[a(I,{onKeyup:A(C(i,["stop","exact"]),["enter"]),autogrow:"",modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=t=>s.value=t),borderless:"",dense:"",rows:3,"input-style":"max-height: 6em",class:"col-grow q-mr-sm chat_input q-pl-md q-pr-md",placeholder:"Digite aqui..."},null,8,["onKeyup","modelValue"]),a(E,{onClick:i,round:"",flat:"",icon:"send"})]),_:1})]),_:1})]),_:1}))}};export{U as default};
