mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
Allow longer deep research extraction timeouts (#651)
Co-authored-by: NovaUnboundAi <NovaUnboundAi@users.noreply.github.com>
This commit is contained in:
@@ -315,7 +315,7 @@ def setup_research_routes(research_handler, session_manager=None) -> APIRouter:
|
|||||||
endpoint_id: Optional[str] = None
|
endpoint_id: Optional[str] = None
|
||||||
model: Optional[str] = None
|
model: Optional[str] = None
|
||||||
max_time: int = Field(default=300, ge=60, le=1800)
|
max_time: int = Field(default=300, ge=60, le=1800)
|
||||||
extraction_timeout: Optional[int] = Field(default=None, ge=15, le=600)
|
extraction_timeout: Optional[int] = Field(default=None, ge=15, le=3600)
|
||||||
extraction_concurrency: Optional[int] = Field(default=None, ge=1, le=12)
|
extraction_concurrency: Optional[int] = Field(default=None, ge=1, le=12)
|
||||||
category: Optional[str] = None
|
category: Optional[str] = None
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ class DeepResearcher:
|
|||||||
self.max_urls_per_round = max_urls_per_round
|
self.max_urls_per_round = max_urls_per_round
|
||||||
self.max_content_chars = max_content_chars
|
self.max_content_chars = max_content_chars
|
||||||
self.max_report_tokens = max_report_tokens
|
self.max_report_tokens = max_report_tokens
|
||||||
self.extraction_timeout = min(600, max(15, int(extraction_timeout or 90)))
|
self.extraction_timeout = min(3600, max(15, int(extraction_timeout or 90)))
|
||||||
self.extraction_concurrency = min(12, max(1, int(extraction_concurrency or 3)))
|
self.extraction_concurrency = min(12, max(1, int(extraction_concurrency or 3)))
|
||||||
self.min_rounds = min_rounds
|
self.min_rounds = min_rounds
|
||||||
self.max_empty_rounds = max_empty_rounds
|
self.max_empty_rounds = max_empty_rounds
|
||||||
|
|||||||
@@ -689,7 +689,7 @@ class ResearchHandler:
|
|||||||
extraction_timeout if extraction_timeout is not None else get_setting("research_extraction_timeout_seconds", 90),
|
extraction_timeout if extraction_timeout is not None else get_setting("research_extraction_timeout_seconds", 90),
|
||||||
default=90,
|
default=90,
|
||||||
minimum=15,
|
minimum=15,
|
||||||
maximum=600,
|
maximum=3600,
|
||||||
)
|
)
|
||||||
_extraction_concurrency = _bounded_int(
|
_extraction_concurrency = _bounded_int(
|
||||||
extraction_concurrency if extraction_concurrency is not None else get_setting("research_extraction_concurrency", 3),
|
extraction_concurrency if extraction_concurrency is not None else get_setting("research_extraction_concurrency", 3),
|
||||||
|
|||||||
@@ -1426,7 +1426,7 @@ async function initResearchSettings() {
|
|||||||
var tv = parseInt(tokensInput.value, 10);
|
var tv = parseInt(tokensInput.value, 10);
|
||||||
if (tv && tv >= 1024) payload.research_max_tokens = tv;
|
if (tv && tv >= 1024) payload.research_max_tokens = tv;
|
||||||
var et = parseInt(extractTimeoutInput.value, 10);
|
var et = parseInt(extractTimeoutInput.value, 10);
|
||||||
if (et && et >= 15 && et <= 600) payload.research_extraction_timeout_seconds = et;
|
if (et && et >= 15 && et <= 3600) payload.research_extraction_timeout_seconds = et;
|
||||||
var ec = parseInt(extractConcurrencyInput.value, 10);
|
var ec = parseInt(extractConcurrencyInput.value, 10);
|
||||||
if (ec && ec >= 1 && ec <= 12) payload.research_extraction_concurrency = ec;
|
if (ec && ec >= 1 && ec <= 12) payload.research_extraction_concurrency = ec;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -86,3 +86,13 @@ async def test_fetch_and_extract_uses_configured_timeout(monkeypatch):
|
|||||||
|
|
||||||
assert result["summary"] == "useful page content"
|
assert result["summary"] == "useful page content"
|
||||||
assert captured["timeout"] == 123
|
assert captured["timeout"] == 123
|
||||||
|
|
||||||
|
|
||||||
|
def test_extraction_timeout_allows_long_local_model_runs():
|
||||||
|
researcher = DeepResearcher(
|
||||||
|
llm_endpoint="http://local.test/v1/chat/completions",
|
||||||
|
llm_model="local-model",
|
||||||
|
extraction_timeout=1800,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert researcher.extraction_timeout == 1800
|
||||||
|
|||||||
Reference in New Issue
Block a user