Merge branch 'main' into main

pull/50/head
Travis Fischer 2022-12-08 03:34:19 -06:00 zatwierdzone przez GitHub
commit 13c857dc9d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "chatgpt",
"version": "2.0.3",
"version": "2.0.5",
"description": "Node.js client for the unofficial ChatGPT API.",
"author": "Travis Fischer <travis@transitivebullsh.it>",
"repository": "transitive-bullshit/chatgpt-api",

Wyświetl plik

@ -97,6 +97,8 @@ const response = await api.sendMessage('this is a timeout test', {
})
```
You can stream responses using the `onProgress` or `onConversationResponse` callbacks. See the [docs](./docs/classes/ChatGPTAPI.md) for more details.
<details>
<summary>Usage in CommonJS (Dynamic import)</summary>
@ -180,10 +182,12 @@ All of these awesome projects are built using the `chatgpt` package. 🤯
- [Discord Bot #2](https://github.com/Nageld/ChatGPT-Bot)
- [WeChat Bot #1](https://github.com/AutumnWhj/ChatGPT-wechat-bot)
- [WeChat Bot #2](https://github.com/fuergaosi233/wechat-chatgpt)
- [QQ Bot (plugin for Yunzai-bot)](https://github.com/ikechan8370/chatgpt-plugin)
- [Lovelines.xyz](https://lovelines.xyz)
- [EXM smart contracts](https://github.com/decentldotland/molecule)
- [Flutter ChatGPT API](https://github.com/coskuncay/flutter_chatgpt_api)
- [Carik Bot](https://github.com/luridarmawan/Carik)
- [Github Action for reviewing PRs](https://github.com/kxxt/chatgpt-action/)
If you create a cool integration, feel free to open a PR and add it to the list.

Wyświetl plik

@ -142,7 +142,7 @@ export class ChatGPTAPI {
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'user-agent': this._userAgent
'User-Agent': this._userAgent
},
body: JSON.stringify(body),
signal: abortSignal,

Wyświetl plik

@ -16,6 +16,12 @@ const fetch =
_undici = await import('undici')
}
if (typeof _undici?.fetch !== 'function') {
throw new Error(
'Invalid undici installation; please make sure undici is installed correctly in your node_modules. Note that this package requires Node.js >= 16.8'
)
}
return _undici.fetch(...args)
}