feat: add enable_web_search config to disable web search (#681) (#760)

* feat: add enable_web_search config to disable web search (#681)

* fix: skip enforce_researcher_search validation when web search is disabled

- Return json.dumps([]) instead of empty string for consistency in background_investigation_node

- Add enable_web_search check to skip validation warning when user intentionally disabled web search

- Add warning log when researcher has no tools available

- Update tests to include new enable_web_search parameter

* fix: address Copilot review feedback

- Coordinate enforce_web_search with enable_web_search in validate_and_fix_plan

- Fix misleading comment in background_investigation_node

* docs: add warning about local RAG setup when disabling web search

* docs: add web search toggle section to configuration guide
This commit is contained in:
Jiahe Wu
2025-12-15 19:17:24 +08:00
committed by GitHub
parent c686ab7016
commit 93d81d450d
7 changed files with 89 additions and 7 deletions

View File

@@ -132,6 +132,7 @@ async def chat_stream(request: ChatRequest):
request.interrupt_feedback,
request.mcp_settings if mcp_enabled else {},
request.enable_background_investigation,
request.enable_web_search,
request.report_style,
request.enable_deep_thinking,
request.enable_clarification,
@@ -517,6 +518,7 @@ async def _astream_workflow_generator(
interrupt_feedback: str,
mcp_settings: dict,
enable_background_investigation: bool,
enable_web_search: bool,
report_style: ReportStyle,
enable_deep_thinking: bool,
enable_clarification: bool,
@@ -594,6 +596,7 @@ async def _astream_workflow_generator(
"max_step_num": max_step_num,
"max_search_results": max_search_results,
"mcp_settings": mcp_settings,
"enable_web_search": enable_web_search,
"report_style": report_style.value,
"enable_deep_thinking": enable_deep_thinking,
"interrupt_before_tools": interrupt_before_tools,

View File

@@ -62,6 +62,9 @@ class ChatRequest(BaseModel):
enable_background_investigation: Optional[bool] = Field(
True, description="Whether to get background investigation before plan"
)
enable_web_search: Optional[bool] = Field(
True, description="Whether to enable web search, set to False to use only local RAG"
)
report_style: Optional[ReportStyle] = Field(
ReportStyle.ACADEMIC, description="The style of the report"
)