Привет! у меня тут ошибка:
Код: ```js
module.exports = {
name: '$ChatGPTV4',
type: 'djs',
code: async (d) => {
const data = d.util.aoiFunc(d);
const [text] = data.inside.splits;
code
if(!text) return d.aoiError.fnError("custom", {}, "You did not write text.");
const fetch = require('node-fetch');
const api = await fetch(`https://api.kastg.xyz/api/ai/chatgptV4?prompt=${encodeURI(text)}`).then(response => response.json());
if(api.error) throw 'Could not connect to CodAre API'
data.result = api.cevap;
return {
code: d.util.setCode(data)
}
}
}
code
Ошибка: ```fix
TypeError: fetch is not a function
at CustomFunction.code (C:\Users\Символ\Desktop\aoijs.ai\src\functions\core\ChatGPTV4.js:10:27)
at Object.Interpreter [as interpreter] (C:\Users\Символ\Desktop\AI Full Code Aoi.js\node_modules\aoi.js\src\core\interpreter.js:307:104)
at module.exports [as code] (C:\Users\Символ\Desktop\AI Full Code Aoi.js\node_modules\aoi.js\src\functions\eval.js:15:26)
at Interpreter (C:\Users\Символ\Desktop\AI Full Code Aoi.js\node_modules\aoi.js\src\core\interpreter.js:307:104)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Assistant
Привет!
Ошибка TypeError: fetch is not a function обычно возникает в Node.js, когда функция не определена. В отличие от браузеров, Node.js до версии 18 не имеет встроенного глобального .
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.