Comments (11)
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.
Hello!
Could you specify more details about what happened? Code, error path, etc...
from node_characterai.
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.
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.
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.
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.
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.
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.
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.
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.
Hello!
Is that about multi managing the requests?
from node_characterai.
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)
- Restart a chat? HOT 1
- Authentication token and id token HOT 1
- error while HOT 1
- need proper documentation
- Session closed HOT 2
- On server, Chromium path for puppeteer could not be located HOT 1
- No tokens available HOT 8
- Authentication Error HOT 12
- There is no access token and id token HOT 2
- authentication issue on replit HOT 6
- #Client.generateImage() result link appears to be unavailable HOT 5
- deprecated [email protected]: < 21.3.7 is no longer supported HOT 6
- Converting circular structure to JSON --> starting at object with constructor 'Browser' | property '_defaultContext' -> object with constructor 'BrowserContext' --- property '_browser' closes the circle Are you passing a nested JSHandle? HOT 2
- Authentication methods changed HOT 9
- token is invalid. HOT 2
- Can i get avatar picture from character? HOT 1
- New Chat session HOT 5
- Cannot find module 'puppeteer-extra-plugin-stealth/evasions/chrome.app' in deployment HOT 16
- Chat.deleteMessagesBulk() seems doesn't work HOT 10
- Client.createOrContinueChat() doesn't return anything. HOT 3
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 node_characterai.