Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Connecting To Remote Server #26

Open
proximasix opened this issue Oct 3, 2023 · 8 comments
Open

Error Connecting To Remote Server #26

proximasix opened this issue Oct 3, 2023 · 8 comments

Comments

@proximasix
Copy link

Both bots produce this error quite often. Sometimes there are other errors described in this section, but this particular error is the most common. Unfortunately, I was never able to identify the pattern of its appearance. I assume that the problem may be that sometimes the bot formulates a message that is too long, and while it is being cut off, the bot timeout passes, which is why it throws an error. Perhaps you have some progress in learning and fixing this issue?

@takimate
Copy link

takimate commented Oct 4, 2023

I write this in my file context: "Important you can only respond with 380 or less characters!". I rarely get this error after I added this.

@Meredith2k5
Copy link

Similar issue, the errors less prominent if you include the above character limit but if you ask the chatbot to write a poem, song, story etc it hits the character limit almost every time. If you include 'less than 380 characters' in the Twitch chat prompt it will work however. Anyone figured a way around this?

@pedrojlazevedo
Copy link
Owner

I'm currently working on a solution.

Can be more complex, but I'm creating a specific twitch bot to actually reply instead of nightbot.

Twitch has the answer limit on 399 characters.
Nightbot has a timeout of 10sec. Sometimes OpenAI endpoint takes longer to answer.

I will let you know as soon as I push the changes to main :)

@proximasix
Copy link
Author

I'm currently working on a solution.

Can be more complex, but I'm creating a specific twitch bot to actually reply instead of nightbot.

Twitch has the answer limit on 399 characters. Nightbot has a timeout of 10sec. Sometimes OpenAI endpoint takes longer to answer.

I will let you know as soon as I push the changes to main :)

In case this information is useful: if you change GPT_MODE to PROMPT, then this error does not appear and the bot gives quick answers to EVERY request. However, the bot itself, due to a different model (davinci), seems less “smart”, responds rather primitively and does not take on the “character” from file_context.txt so well. With all this, it becomes significantly more expensive, so this is a rather dubious compromise.

@yaorenmao
Copy link

yaorenmao commented Oct 28, 2023

That's how i solved it:
`
let mao_res = "wait ~25sec > !gptr"
//save response:
mao_res = sliced_agent_response
res.send(sliced_agent_response)

//repeat response:
app.all('/repeat/', (req, res) => {
res.send(mao_res)
})
`

have to type !gptr if error connecting to server

@takimate
Copy link

That's how i solved it: ` let mao_res = "wait ~25sec > !gptr" //save response: mao_res = sliced_agent_response res.send(sliced_agent_response)

//repeat response: app.all('/repeat/', (req, res) => { res.send(mao_res) }) `

have to type !gptr if error connecting to server

Where do you put this?

@yaorenmao
Copy link

Where do you put this?
in index.js
and you need to fetch it in your bot like continue command(nightbot example):
!gptcontinue
$(urlfetch https://your-url.cyclic.cloud/repeat)

@Meredith2k5
Copy link

Where do you put this?
in index.js
and you need to fetch it in your bot like continue command(nightbot example):
!gptcontinue
$(urlfetch https://your-url.cyclic.cloud/repeat)

Hmm I had no luck with this, I did take a look at your .index.js but couldn't figure it out. Im still learning to code so I may have put it in the wrong location however.

Ive noticed that !continue works even if the bot times out, would it be possible to save the first message as a variable, then recall that variable in the $(urlfetch https://your-url.cyclic.app/variable)? That way it functions as normal but if you do get this error you can simply !recall or whatever you name the command in streamelements/nightbot.

Maybe thats what yaorenmao intended, im not sure how it works so only throwing ideas out there. Ive seen another implementation of Chat GPT on twitch that seems to do this though.

Also is there a way to get this to work with streamerbot? Ill probably do some digging at some point in how to implement apis and url answers in streamerbot at some point, most of the documentation are for the older version though unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants