mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix: refine subproblem handling and aggregation logic in agent
This commit is contained in:
parent
e8b99a5889
commit
a664e4d851
@ -796,6 +796,8 @@ But then you realized you have asked them before. You decided to to think out of
|
||||
|
||||
if (teamSize > 1) {
|
||||
const subproblems = await researchPlan(question, teamSize, soundBites, context, SchemaGen);
|
||||
if (subproblems.length > 1) {
|
||||
|
||||
// parallel call getResponse for each subproblem with exact same parameters from the current step, but their teamSize is 1
|
||||
const subproblemResponses = await Promise.all(subproblems.map(subproblem => getResponse(subproblem,
|
||||
tokenBudget,
|
||||
@ -829,6 +831,10 @@ But then you realized you have asked them before. You decided to to think out of
|
||||
|
||||
// break the loop, jump directly final boxing
|
||||
break;
|
||||
} else {
|
||||
// if there is only one subproblem, then we skip the recurrsion
|
||||
gaps.push(subproblems[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// rewrite queries with initial soundbites
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user