Comments (1)
🤖
Hey @andrea-garritano! Great to see you back here. Hope you're doing well.
Thank you for reporting this issue. Based on the information you've provided, it seems like the problem might be related to the asynchronous nature of the handleFeedBrain
function, which is responsible for uploading files and crawling URLs. This function is called within the createBrain
function, but it's invoked with the void
keyword, which means that the createBrain
function doesn't wait for handleFeedBrain
to finish before it continues executing.
Here's the relevant code:
if (brain_type === "doc") {
void handleFeedBrain(createdBrainId);
}
If handleFeedBrain
encounters an error or takes longer than expected, the rest of the createBrain
function might execute before the brain is fully created, leading to the page refresh and failure to create a new Brain entity.
A potential solution could be to await the handleFeedBrain
function:
if (brain_type === "doc") {
await handleFeedBrain(createdBrainId);
}
This will ensure that the createBrain
function waits for handleFeedBrain
to finish before it continues, which might resolve the issue. However, please note that this is just a hypothesis based on the provided code and might not be the actual cause of the problem.
You can find the relevant code in the useBrainCreationApi.ts file.
As for the handleFeedBrain
function, it's an asynchronous function that takes an object with brainId
and chatId
as parameters. The function is responsible for handling the feeding of knowledge to the brain. It creates an array of promises (uploadPromises
) by mapping over the files
array and calling the uploadFileHandler
function for each file, passing the file, brainId
, and chatId
as arguments. It also creates another array of promises (crawlPromises
) by mapping over the urls
array and calling the crawlWebsiteHandler
function for each URL, passing the URL, brainId
, and chatId
as arguments. It then waits for all the promises in the uploadPromises
array, crawlPromises
array, and the updateOnboardingA
function to resolve using Promise.all
.
You can find the relevant code in the useFeedBrainHandler.ts file.
I hope this helps! If you have any further questions or need more clarification, please don't hesitate to ask.
-Dosu
Sources
- frontend/lib/components/AddBrainModal/components/AddBrainSteps/components/BrainKnowledgeStep/hooks/useBrainCreationApi.ts
- frontend/app/brains-management/[brainId]/components/BrainManagementTabs/components/KnowledgeOrSecretsTab/components/AddKnowledge/hooks/useFeedBrainHandler.ts
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from quivr.
Related Issues (20)
- [Feature]: Sort your documentation out. Wasted a huge amount of time - theres 2 issues open for rendering front end & Supabase address
- [Bug]: error Couldn't find package "chalk@^2.4.2" HOT 2
- [Bug]: Wrong json serialization for ollama requests
- [Feature]: Serve Multiple Users At the Same time using API
- [Bug]: Following the steps to install and cannot login HOT 5
- Potential security vulnerability HOT 1
- [Feature]: Use Google Gemini Pro API
- [Feature]: Increase the ability of changing the OpenAI API Base Url. HOT 2
- [Bug]: Brain Temp and Token Params don't look like they are being picked up HOT 3
- [Bug]: Can't invite a new user HOT 1
- [Bug]: Local Development Instructions dont work HOT 1
- [Bug]: => ERROR [frontend builder 4/4] RUN yarn build HOT 2
- [Bug]: Unable to login with provided password in getting started section HOT 4
- [Bug]: Different vector dimensions HOT 6
- [Bug]: Unable to chat and create brain HOT 1
- [Bug]: Unable to chat with newly created brain HOT 4
- spaces removed whilst typing a question[Bug]: HOT 2
- [Bug]: Unable to perform a search with ollama/mistral HOT 1
- [Bug]: I got error on CMD Windows after docker compose up HOT 2
- [Feature]: Ethics & Transparency HOT 1
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 quivr.