From 2a43409f8c673288f29fa7306b57d8f4879b0591 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Thu, 8 Dec 2022 11:02:16 +0800 Subject: [PATCH 1/8] add: qq bot plugin for Yunzai --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 5cfd56d2..1455c016 100644 --- a/readme.md +++ b/readme.md @@ -180,6 +180,7 @@ 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) From 1ce23da8ec7c8219e5e141e55609744fa1a34f25 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Thu, 8 Dec 2022 11:03:30 +0800 Subject: [PATCH 2/8] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 1455c016..709e566f 100644 --- a/readme.md +++ b/readme.md @@ -180,7 +180,7 @@ 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) +- [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) From 624823e6db2e8cf1224c15f0f261c0bdde528157 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Wed, 7 Dec 2022 21:28:26 -0600 Subject: [PATCH 3/8] fix: add error message on node.js if undici isn't supported --- src/fetch.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fetch.ts b/src/fetch.ts index f3ea9616..cb637869 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -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) } From 2c67ef162eaba2b93fff166dbf2db2e667a684c5 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Wed, 7 Dec 2022 21:28:44 -0600 Subject: [PATCH 4/8] 2.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c776a3bb..90ff0ad7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chatgpt", - "version": "2.0.3", + "version": "2.0.4", "description": "Node.js client for the unofficial ChatGPT API.", "author": "Travis Fischer ", "repository": "transitive-bullshit/chatgpt-api", From 30d4e28e1317d2f96a1c203eb15c420b354d9d1c Mon Sep 17 00:00:00 2001 From: Levi Zim Date: Thu, 8 Dec 2022 13:10:48 +0800 Subject: [PATCH 5/8] docs: add chatgpt-action --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 5cfd56d2..09f57602 100644 --- a/readme.md +++ b/readme.md @@ -183,6 +183,7 @@ All of these awesome projects are built using the `chatgpt` package. 🤯 - [Lovelines.xyz](https://lovelines.xyz) - [EXM smart contracts](https://github.com/decentldotland/molecule) - [Flutter ChatGPT API](https://github.com/coskuncay/flutter_chatgpt_api) +- [ChatGPT Code Review Github Action](https://github.com/kxxt/chatgpt-action/) If you create a cool integration, feel free to open a PR and add it to the list. From 25510460fcfb7a4b7e453d29bbd9fca6dcfd6346 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Wed, 7 Dec 2022 23:34:36 -0600 Subject: [PATCH 6/8] docs: tweak readme --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 4345698c..6829c23f 100644 --- a/readme.md +++ b/readme.md @@ -184,7 +184,7 @@ All of these awesome projects are built using the `chatgpt` package. 🤯 - [Lovelines.xyz](https://lovelines.xyz) - [EXM smart contracts](https://github.com/decentldotland/molecule) - [Flutter ChatGPT API](https://github.com/coskuncay/flutter_chatgpt_api) -- [ChatGPT Code Review Github Action](https://github.com/kxxt/chatgpt-action/) +- [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. From 0f995702fba239e56b557f60cdf2299c5eb062e3 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Thu, 8 Dec 2022 03:08:16 -0600 Subject: [PATCH 7/8] docs: add a note in the readme about onProgress and onConversationResponse --- readme.md | 2 ++ src/chatgpt-api.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 6829c23f..728d0e23 100644 --- a/readme.md +++ b/readme.md @@ -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. +
Usage in CommonJS (Dynamic import) diff --git a/src/chatgpt-api.ts b/src/chatgpt-api.ts index e02c811f..39d59f29 100644 --- a/src/chatgpt-api.ts +++ b/src/chatgpt-api.ts @@ -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, From 700d13bf192e074893593faa6597c28061ba5e12 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Thu, 8 Dec 2022 03:08:41 -0600 Subject: [PATCH 8/8] 2.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 90ff0ad7..36fe72bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chatgpt", - "version": "2.0.4", + "version": "2.0.5", "description": "Node.js client for the unofficial ChatGPT API.", "author": "Travis Fischer ", "repository": "transitive-bullshit/chatgpt-api",