Giter Club home page Giter Club logo

Comments (11)

cshadd avatar cshadd commented on July 29, 2024 2

Yeah queueing will probably have it take a long time depending on how many users are using it. This is just an alternative solution instead of having to create multiple instances of the client for each request.

The problem with making multiple instances of puppeteer is that each one opens a chromium instance and depending on how you are hosting this it might not be feasible, so there are trade-offs for each solution.

Trying to look into it and see if I can find the solution. I really think they should just remove the Cloudflare blocking.

from node_characterai.

realcoloride avatar realcoloride commented on July 29, 2024

Hello!

Could you specify more details about what happened? Code, error path, etc...

from node_characterai.

Mariotim3 avatar Mariotim3 commented on July 29, 2024

I believe it's due to attempting to send multiple messages while one is already being generated. I have resolved the issue by waiting until one is completed before sending the next one. Will let you know if I find more issues. Thanks for making this

from node_characterai.

Mariotim3 avatar Mariotim3 commented on July 29, 2024

I decided to use multiple instances of the node_characterai and run them separately. So that if the bot is already generating a message for one response it can use the other instances to generate one for another. (It seems to have worked and now has the ability to generate multiple responses at the same time.)

I have only had the issue once since then, and i'm still trying to find more info about it.

The issue also seems to occur under the chat.js file, on line 65.

if (request.status() === 200) { TypeError: Cannot read properties of undefined (reading 'status')

from node_characterai.

realcoloride avatar realcoloride commented on July 29, 2024

If request is undefined it means something went wrong with the puppeteer evaluation, as it returns an object and the status is a procedurally generated function when /streaming/ is called.

from node_characterai.

cshadd avatar cshadd commented on July 29, 2024

I can confirm the same thing happening on my end. I have not tried the similar fix of multiple instances of node_characterai.

I can confirm this happens if multiple fetches are happening at the same time.

One other solution is probably to queue each process and wait for each to finish.

edit: Now that I think about it, it might also affect other functions such as fetching and searching characters.

from node_characterai.

Mariotim3 avatar Mariotim3 commented on July 29, 2024

I did try queueing each one and waiting for it to finish and it did work. Although if I had multiple users conversing with it at the same time the chat would end up getting really far behind (because it takes anywhere from around 4 - 10 seconds to generate a response) and was not able to respond to new ones quick enough.

from node_characterai.

cshadd avatar cshadd commented on July 29, 2024

One other solution I can think of at this moment is to try multiple puppeteer instances per request call without having to force the develop to make a new client. This still will make a chromium instance and multiple puppeteer instances for all the requests but this is probably better for the end developer.

from node_characterai.

creepycats avatar creepycats commented on July 29, 2024

node_characterai I believe has the same issue that I had before with multiple messages sending.

I don't know exactly how requester.js works just yet, but just a suggestion for coloride.

Add some sort of "request_id" header to requests. I use this to make sure whatever I request is what I intercept.

This basically fixes issues with Eval-Fetching and makes sure we only listen to requests we want.

image
image
image

Of course, I don't know what might break with this change. Could be set up like this for a very specific reason. This would just let you use one singular type of requesting that should hopefully fix whatever issue this is.

from node_characterai.

realcoloride avatar realcoloride commented on July 29, 2024

Hello!
Is that about multi managing the requests?

from node_characterai.

Parking-Master avatar Parking-Master commented on July 29, 2024

You can close this issue now. It was definitely related to a caching problem and has been resolved now as of v1.0.8.

from node_characterai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.