Merge pull request #506 from T-Damer/patch-1

pull/509/head
Travis Fischer 2023-03-29 14:49:42 -05:00 zatwierdzone przez GitHub
commit 0984504154
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -280,8 +280,11 @@ Note that we automatically handle appending the previous messages to the prompt
```js
async function example() {
// To use ESM in CommonJS, you can use a dynamic import
// To use ESM in CommonJS, you can use a dynamic import like this:
const { ChatGPTAPI } = await import('chatgpt')
// You can also try dynamic importing like this:
// const importDynamic = new Function('modulePath', 'return import(modulePath)')
// const { ChatGPTAPI } = await importDynamic('chatgpt')
const api = new ChatGPTAPI({ apiKey: process.env.OPENAI_API_KEY })