Comments (6)
After some tests, it seems when I have too many requests, it will also exit without any prompt -- though the error will be visible if I try ChatGPT's web interface. It'll state: "Too many requests in 1 hour. Try again later." It would be nice to have these error messages also returned to the user as exception, for example.
from chatgpt-api.
Can you provide a code snippet of how you are invoking api.sendMessage
? And also include the output stdout
and stderr
?
if you make multiple queries consecutively, after about several queries, calling api.sendMessage() would exit without the program any error output at the console.
There really shouldn't be any way for this library to exit the process. The only real result I can potentially see is that an Error
is thrown and you're not handling it, and for some reason the process' stderr isn't displaying that error / stack trace to you. Really depends on your environment, though.
NOTE: I strongly recommend against having multiple api.sendMessage
calls running concurrently. While it may be possible and work for a bit, this will severely degrade the robustness of your program since the current unofficial API isn't really meant to be used this way. I recommend adding a reasonable delay in between sendMessage
calls to mitigate rate limits.
Here are a few of the special responses I'm looking for from chatgpt: https://github.com/transitive-bullshit/chatgpt-twitter-bot/blob/main/src/respond-to-new-mentions.ts#L258-L269
from chatgpt-api.
Thanks for looking at the problem. The code is very straightforward, there is no concurrent execution, however after some time it will just stop with nothing to report
for (var uid of uids) {
prompt = 'Generate a summary of the the article\n\n' + text
response = await api.sendMessage(prompt) //, {conversationId: uid})
console.log(new Date().toLocaleTimeString() + ' uid ' + result.uid)
}
output
$ node test.js
...
11:58:09 PM uid 151
11:58:49 PM uid 152
$
with no error message nothing, and I have many more items in array uids
. I can however resume from uid 153 after an hour. So i believe it's chatgpt-api's problem. It doesn't recognize the error and quietly exit.
from chatgpt-api.
@dany-nonstop is your code open source? It's likely that at some point, a message fails to send and throws an error.
I recommend adding a delay in-between sendMessage
requests to avoid running into 503/429 errors. Example: https://github.com/transitive-bullshit/chatgpt-twitter-bot/blob/main/src/respond-to-new-mentions.ts#L157-L158
from chatgpt-api.
@dany-nonstop let me know if there's anything else I can to to try and help. Otherwise, I'm closing this as it doesn't seem to be affecting other people.
Thanks
from chatgpt-api.
Thank you @transitive-bullshit it's still there, the smallest I can repeat is this, if it helps you debug. I'm already adding 60s between calls. It just stays there.
async function extract() {
for (var row of content) {
prompt = 'summarize this paragraph \n\n' + row
response = await api.sendMessage(prompt)
}
}
from chatgpt-api.
Related Issues (20)
- has no exported member 'ChatGPTUnofficialProxyAPI'
- Model GPT-4 does not exist or you do not have access to it HOT 5
- Add plugins, images, code interpretation etc.. feacture for UnofficialProxy
- CJS Incompatibity Error HOT 1
- Streaming a response from onProgress return duplicates
- ChatGPT error 500: {"detail":"Hmm...something seems to have gone wrong."} HOT 3
- ChatGPT 4 vision - send image? HOT 4
- Upload image HOT 1
- Custom messageId saved into parentMessageId HOT 2
- Instead of sending a new Message, appended to last message. HOT 1
- Error: It is recommended to upgrade to the latest PandoraNext: https://github.com/pandora-next/deploy HOT 7
- After call AbortController. abort(), it did not stop immediately and only returned after timeout HOT 1
- ChatGPTUnofficialProxyAPI Not Working HOT 6
- support pip
- It is not work when use gpt-4 model!ha ha HOT 3
- any plan to support GPT-V?
- assistant
- Bug HOT 2
- [ChatGPTUnofficialProxyAPI] ChatGPT Web has switched from SSE to WebSockets.
- problem when execute `npx tsx demos/demo.ts`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-api.