integration chatgpt with wix [closed]

Product:
Wix Editor

What are you trying to achieve:
[i want to use chatgpt 4 with my site so i send a question and recive a answear]

What have you already tried:
i tried to excute the code in backend and also it is didn’t work

Additional information:
but i have a problem which appear as following
Cannot find module ‘fs’ in ‘gpt-3-encoder’

`
import { ChatGPTAPI } from ‘chatgpt’;
export async function sendMessageGpt() {
const api = new ChatGPTAPI({
apiKey:apiKey
});
const res = await api.sendMessage(“hello i am here how can you help me”).then(result => {
console.log(result);
}).catch(error => {
console.error(error);
});
console.log(res);
}
$w.onReady(async function () {
let res = await sendMessageGpt();
console.log(res);
});`

if anyone try chatgpt with another library please share it with me
thank you all

i want to ingrate the chatgpt with my website so i will send the question and will recive the answear

  • await and then() together, are you expecting to get response in both res AND result?

    – 




  • also, function sendMessageGpt() doesn’t return anything

    – 




Leave a Comment