File manager - Edit - /home/autoph/public_html/projects/ahg-hr/assets/faq.91b22a11.js
Back
import{_ as r,b as i,d as n,t as c,o as p}from"./index.836ff972.js";const l={data(){return{apiKey:"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",responseMessage:""}},methods:{async fetchHaiku(){const o="https://api.openai.com/v1/chat/completions",e={"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},a={model:"gpt-3.5-turbo",messages:[{role:"user",content:"write a haiku about ai"}]};try{const s=await(await fetch(o,{method:"POST",headers:e,body:JSON.stringify(a)})).json();this.responseMessage=s.choices[0].message.content}catch(t){console.error("Error fetching data:",t)}}},mounted(){this.fetchHaiku()}};function d(o,e,a,t,s,h){return p(),i("div",null,[e[0]||(e[0]=n("h1",null,"AI Generated Haiku",-1)),n("p",null,c(s.responseMessage),1)])}const f=r(l,[["render",d]]);export{f as default};
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings