kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
Merge branch 'main' into main
commit
b62f3794c9
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "chatgpt",
|
"name": "chatgpt",
|
||||||
"version": "2.0.3",
|
"version": "2.0.5",
|
||||||
"description": "Node.js client for the unofficial ChatGPT API.",
|
"description": "Node.js client for the unofficial ChatGPT API.",
|
||||||
"author": "Travis Fischer <travis@transitivebullsh.it>",
|
"author": "Travis Fischer <travis@transitivebullsh.it>",
|
||||||
"repository": "transitive-bullshit/chatgpt-api",
|
"repository": "transitive-bullshit/chatgpt-api",
|
||||||
|
|
|
@ -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>
|
<details>
|
||||||
<summary>Usage in CommonJS (Dynamic import)</summary>
|
<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)
|
- [Discord Bot #2](https://github.com/Nageld/ChatGPT-Bot)
|
||||||
- [WeChat Bot #1](https://github.com/AutumnWhj/ChatGPT-wechat-bot)
|
- [WeChat Bot #1](https://github.com/AutumnWhj/ChatGPT-wechat-bot)
|
||||||
- [WeChat Bot #2](https://github.com/fuergaosi233/wechat-chatgpt)
|
- [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)
|
- [Lovelines.xyz](https://lovelines.xyz)
|
||||||
- [EXM smart contracts](https://github.com/decentldotland/molecule)
|
- [EXM smart contracts](https://github.com/decentldotland/molecule)
|
||||||
- [Flutter ChatGPT API](https://github.com/coskuncay/flutter_chatgpt_api)
|
- [Flutter ChatGPT API](https://github.com/coskuncay/flutter_chatgpt_api)
|
||||||
- [Carik Bot](https://github.com/luridarmawan/Carik)
|
- [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.
|
If you create a cool integration, feel free to open a PR and add it to the list.
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ export class ChatGPTAPI {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer ${accessToken}`,
|
Authorization: `Bearer ${accessToken}`,
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'user-agent': this._userAgent
|
'User-Agent': this._userAgent
|
||||||
},
|
},
|
||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
signal: abortSignal,
|
signal: abortSignal,
|
||||||
|
|
|
@ -16,6 +16,12 @@ const fetch =
|
||||||
_undici = await import('undici')
|
_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)
|
return _undici.fetch(...args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue