changed the structure of the imports

pull/77/head
Maria-Aidarus 2023-11-29 12:22:24 +03:00
rodzic 5478b7709f
commit 801cabdce9
1 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -3,13 +3,14 @@
const { Configuration, OpenAIApi } = require('openai'); const { Configuration, OpenAIApi } = require('openai');
// const fetch = require('node-fetch'); // const fetch = require('node-fetch');
let fetch; // let fetch;
async function loadFetch() { // async function loadFetch() {
if (!fetch) { // if (!fetch) {
fetch = (await import('node-fetch')).default; // fetch = (await import('node-fetch')).default;
} // }
} // }
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
// Function to fetch content from URL using a web scraping service // Function to fetch content from URL using a web scraping service
async function fetchContentFromURL(url) { async function fetchContentFromURL(url) {