mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
fix: respect user round count in deep research (#2896)
The STOP_PROMPT did not include the target round count, so the LLM could decide to stop after 2-3 rounds even when the user requested 8. Additionally, min_rounds was capped at 3 regardless of max_rounds. - Add max_rounds to STOP_PROMPT so the LLM knows the target - Change min_rounds from min(3, max_rounds) to max(2, max_rounds - 2) Fixes #2863 Co-authored-by: michaelxer <michaelxer@users.noreply.github.com>
This commit is contained in:
@@ -107,7 +107,7 @@ You are deciding whether a research report is comprehensive enough.
|
|||||||
**Current report:**
|
**Current report:**
|
||||||
{report}
|
{report}
|
||||||
|
|
||||||
**Rounds completed:** {round_num}
|
**Rounds completed:** {round_num} of {max_rounds}
|
||||||
|
|
||||||
Based on the report so far, do we have enough information to answer the question \
|
Based on the report so far, do we have enough information to answer the question \
|
||||||
comprehensively? Consider:
|
comprehensively? Consider:
|
||||||
@@ -115,6 +115,9 @@ comprehensively? Consider:
|
|||||||
- Are there obvious gaps or unanswered sub-questions?
|
- Are there obvious gaps or unanswered sub-questions?
|
||||||
- Is the evidence sufficient and from multiple sources?
|
- Is the evidence sufficient and from multiple sources?
|
||||||
|
|
||||||
|
If rounds completed is well below the target, prefer continuing unless the \
|
||||||
|
report is already exhaustive.
|
||||||
|
|
||||||
Reply with ONLY "YES" or "NO" followed by a brief one-sentence reason.
|
Reply with ONLY "YES" or "NO" followed by a brief one-sentence reason.
|
||||||
Example: "YES — The report covers all major aspects with evidence from multiple sources."
|
Example: "YES — The report covers all major aspects with evidence from multiple sources."
|
||||||
Example: "NO — We still lack information about the economic impact."
|
Example: "NO — We still lack information about the economic impact."
|
||||||
@@ -698,6 +701,7 @@ class DeepResearcher:
|
|||||||
question=question,
|
question=question,
|
||||||
report=report,
|
report=report,
|
||||||
round_num=round_num,
|
round_num=round_num,
|
||||||
|
max_rounds=self.max_rounds,
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -777,7 +777,7 @@ class ResearchHandler:
|
|||||||
llm_model=llm_model,
|
llm_model=llm_model,
|
||||||
llm_headers=llm_headers,
|
llm_headers=llm_headers,
|
||||||
max_rounds=max_rounds,
|
max_rounds=max_rounds,
|
||||||
min_rounds=min(3, max_rounds),
|
min_rounds=max(2, max_rounds - 2),
|
||||||
max_time=max_time,
|
max_time=max_time,
|
||||||
max_report_tokens=_max_report_tokens,
|
max_report_tokens=_max_report_tokens,
|
||||||
extraction_timeout=_extraction_timeout,
|
extraction_timeout=_extraction_timeout,
|
||||||
|
|||||||
Reference in New Issue
Block a user