I'm updating some Vue 3 components to use the new Composition API.
The code needs to be able to run inside the new .
I'm still learning, and I couldn't find an example of how to do it on the internet.
Thanks in advance!
export default {
data() {
return {
productName: '',
productFeatures: '',
temperature: 0.1,
generatedText: '',
loading: false,
aviso: false
}
},
methods: {
generateText() {
this.loading = true;
let prompt = `This is a test ${this.productName}.`;
axios.post('https://example.com', {
model: "XXXXXX",
logprobs: 1,
max_tokens: 500,
prompt: prompt,
temperature: 0.3
// temperature: 0.7,
}, {
headers: {
'Authorization': 'Bearer XXXXXXXXXXXXX'
}
}).then(response => {
this.generatedText = response.data.choices[0].text;
this.loading = false;
this.aviso = true;
});
}
}
}