Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

feat: add Wikinews search engine support and update related documentation

tommasoDR5a3aa1bd3d05
diff --git a/README.md b/README.md
index 684c348657..ad1df7ab0b 100644
--- a/README.md
+++ b/README.md
@@ -109,7 +109,7 @@ It aims to help researchers, students, and professionals find accurate informati
- **General**: Wikipedia, SearXNG
- **Technical**: GitHub, Elasticsearch
- **Historical**: Wayback Machine
-- **News**: The Guardian
+- **News**: The Guardian, Wikinews
#### Premium Search Engines
- **Tavily** - AI-powered search
diff --git a/docs/search-engines.md b/docs/search-engines.md
index 3f7939160e..4c8ec9a5b9 100644
--- a/docs/search-engines.md
+++ b/docs/search-engines.md
@@ -100,6 +100,11 @@ result = quick_summary(
- **Results**: Recent news articles
- **Note**: Requires API key (free tier available at https://open-platform.theguardian.com/)
+#### Wikinews
+- **Specialization**: Open and collaboratively-written news articles on a wide range of topics
+- **Best for**: Historical and recent news, general news coverage, quick overviews
+- **Results**: News articles written by volunteers with verified sources
+
## Premium Search Engines
### Tavily
diff --git a/src/local_deep_research/defaults/default_settings.json b/src/local_deep_research/defaults/default_settings.json
index 5ef3b2732a..a1bf4d5e89 100644
--- a/src/local_deep_research/defaults/default_settings.json
+++ b/src/local_deep_research/defaults/default_settings.json
@@ -1006,6 +1006,10 @@
"label": "Wikipedia",
"value": "wikipedia"
},
+ {
+ "label": "Wikinews",
+ "value": "wikinews"
+ },
{
"label": "Pubmed",
"value": "pubmed"
@@ -4194,6 +4198,143 @@
],
"visible": true
},
+ "search.engine.web.wikinews.display_name": {
+ "category": "wikinews",
+ "description": "Display name to use in the U.I. for this search engine.",
+ "editable": false,
+ "max_value": null,
+ "min_value": null,
+ "name": "Display Name",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "text",
+ "value": "Wikinews",
+ "visible": false
+ },
+ "search.engine.web.wikinews.description": {
+ "category": "wikinews",
+ "description": "Human-readable description of the search engine.",
+ "editable": false,
+ "max_value": null,
+ "min_value": null,
+ "name": "Description",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "text",
+ "value": "Search news articles written by volunteers with verified sources",
+ "visible": false
+ },
+ "search.engine.web.wikinews.class_name": {
+ "category": "wikinews",
+ "description": "Setting for wikinews.class_name",
+ "editable": false,
+ "max_value": null,
+ "min_value": null,
+ "name": "Class Name",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "text",
+ "value": "WikinewsSearchEngine",
+ "visible": false
+ },
+ "search.engine.web.wikinews.adaptive_search": {
+ "category": "wikinews",
+ "description": "Enable adaptive search to automatically adjust parameters based on query",
+ "editable": true,
+ "max_value": null,
+ "min_value": null,
+ "name": "Adaptive Search",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "checkbox",
+ "value": true,
+ "visible": true
+ },
+ "search.engine.web.wikinews.module_path": {
+ "category": "wikinews",
+ "description": "Setting for wikinews.module_path",
+ "editable": false,
+ "max_value": null,
+ "min_value": null,
+ "name": "Module Path",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "text",
+ "value": ".engines.search_engine_wikinews",
+ "visible": false
+ },
+ "search.engine.web.wikinews.reliability": {
+ "category": "wikinews",
+ "description": "Setting for wikinews.reliability",
+ "editable": false,
+ "max_value": 1.0,
+ "min_value": 0.0,
+ "name": "Reliability",
+ "options": null,
+ "step": 0.05,
+ "type": "SEARCH",
+ "ui_element": "range",
+ "value": 0.85,
+ "visible": false
+ },
+ "search.engine.web.wikinews.requires_api_key": {
+ "category": "wikinews",
+ "description": "Setting for wikinews.requires_api_key",
+ "editable": false,
+ "max_value": null,
+ "min_value": null,
+ "name": "Requires Api Key",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "checkbox",
+ "value": false,
+ "visible": false
+ },
+ "search.engine.web.wikinews.strengths": {
+ "category": "wikinews",
+ "description": "Setting for wikinews.strengths",
+ "editable": false,
+ "max_value": null,
+ "min_value": null,
+ "name": "Strengths",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "json",
+ "value": [
+ "recent and historical news",
+ "articles written by volunteers",
+ "verified sources",
+ "general coverage",
+ "quick overviews"
+ ],
+ "visible": true
+ },
+ "search.engine.web.wikinews.weaknesses": {
+ "category": "wikinews",
+ "description": "Setting for wikinews.weaknesses",
+ "editable": false,
+ "max_value": null,
+ "min_value": null,
+ "name": "Weaknesses",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "json",
+ "value": [
+ "less coverage of specialized topics",
+ "limited editorial oversight",
+ "variable article quality",
+ "not ideal for breaking news"
+ ],
+ "visible": true
+ },
"search.cross_engine_max_results": {
"category": "search_parameters",
"description": "Maximum number of search results to keep after cross-engine filtering. When results from multiple search engines are combined, this limits how many total results are displayed. Higher values show more comprehensive results.",
@@ -4278,6 +4419,20 @@
"value": true,
"visible": true
},
+ "search.engine.web.wikinews.use_in_auto_search": {
+ "category": "wikinews",
+ "description": "Include Wikinews in auto search mode",
+ "editable": true,
+ "max_value": null,
+ "min_value": null,
+ "name": "Include in Auto Search",
+ "options": null,
+ "step": null,
+ "type": "SEARCH",
+ "ui_element": "checkbox",
+ "value": true,
+ "visible": true
+ },
"search.engine.web.brave.use_in_auto_search": {
"category": "brave",
"description": "Include Brave search in auto search mode",
diff --git a/src/local_deep_research/utilities/search_utilities.py b/src/local_deep_research/utilities/search_utilities.py
index 914ff8cb08..4a0ee3b742 100644
--- a/src/local_deep_research/utilities/search_utilities.py
+++ b/src/local_deep_research/utilities/search_utilities.py
@@ -1,4 +1,7 @@
import re
+import html
+import requests
+import locale
from typing import Dict, List
from loguru import logger
@@ -257,3 +260,108 @@ def print_search_results(search_results):
if links:
formatted_text = format_links_to_markdown(links=links)
logger.info(formatted_text)
+
+
+def extract_clean_query(llm_output: str) -> str:
+ """Extract a clean search query from LLM output by removing empty lines, <think> tags,
+ trailing/leading quotes and whitespace.
+
+ Args:
+ llm_output (str): The raw output from the LLM.
+
+ Returns:
+ The cleaned search query string.
+ """
+ output_text = (
+ getattr(llm_output, "content", None)
+ or getattr(llm_output, "text", None)
+ or str(llm_output)
+ )
+ query = remove_think_tags(output_text)
+ lines = query.split("\n")
+
+ for line in lines:
+ if re.search(
+ r"\w", line
+ ): # Include at least one alphanumeric character
+ cleaned_line = (
+ line.strip().strip('"').strip("'")
+ ) # Remove any leading/trailing quotes and whitespace
+ return cleaned_line
+ return ""
+
+
+def language_name_to_iso(name: str) -> str:
+ """Convert full language names into short ISO codes.
+
+ Args:
+ name (str): Full language name (e.g., "English", "French")
+
+ Returns:
+ Corresponding ISO code (e.g., "en", "fr")
+ """
+ # Normalize input string
+ name = name.lower().strip()
+
+ # Lookup in 'locale' aliases
+ for alias, loc in locale.locale_alias.items():
+ if alias.startswith(name): # Some aliases have suffixes
+ return loc.split("_")[0]
+
+ # Default fallback
+ return "en"
+
+
+def clean_wikinews_snippet(snippet: str) -> str:
+ """
+ Clean a Wikinews search snippet.
+
+ Args:
+ snippet (str): Raw snippet from Wikinews API
+
+ Returns:
+ Clean human-readable text
+ """
+ if not snippet:
+ return ""
+
+ # Decode unicode escapes (\u003C -> <)
+ decoded = snippet.encode("utf-8").decode("unicode_escape")
+ # Unescape HTML entities (&amp; -> &)
+ unescaped = html.unescape(decoded)
+ # Remove all HTML tags
+ clean_text = re.sub(r"<.*?>", "", unescaped)
+ # Collapse multiple spaces/newlines
+ clean_text = re.sub(r"\s+", " ", clean_text).strip()
+
+ return clean_text
+
+
+def resolve_wikinews_language(language: str, headers: Dict) -> str:
+ """Return a valid Wikinews ISO code from a full language name.
+ If Wikinews does not exist for the requested language, fall back to English.
+
+ Args:
+ language (str): Full language name (e.g., "English", "French")
+ headers (Dict): Headers to use for HTTP requests.
+
+ Returns:
+ Valid Wikinews ISO code (e.g., "en", "fr")
+ """
+ iso = language_name_to_iso(language)
+ url = f"https://{iso}.wikinews.org/"
+
+ try:
+ # Check if the Wikinews site for this ISO code exists by making a HEAD request
+ resp = requests.head(
+ url, allow_redirects=True, headers=headers, timeout=5
+ )
+ if resp.status_code == 200 and f"{iso}.wikinews.org" in resp.url:
+ return iso
+ except:
+ pass
+
+ logger.warning(
+ f"Wikinews does not exist for '{language}' ({iso}). Falling back to English."
+ )
+ return "en"
diff --git a/src/local_deep_research/web_search_engines/engines/search_engine_wikinews.py b/src/local_deep_research/web_search_engines/engines/search_engine_wikinews.py
new file mode 100644
index 0000000000..ae91185ee8
--- /dev/null
+++ b/src/local_deep_research/web_search_engines/engines/search_engine_wikinews.py
@@ -0,0 +1,450 @@
+from datetime import datetime, timedelta, UTC
+from typing import Any, Dict, List, Optional, Tuple
+
+import requests
+import json
+from langchain_core.language_models import BaseLLM
+from loguru import logger
+
+from ...utilities.search_utilities import remove_think_tags, extract_clean_query
+from ..search_engine_base import BaseSearchEngine
+from ...utilities.search_utilities import (
+ clean_wikinews_snippet,
+ resolve_wikinews_language,
+)
+
+HEADERS = {
+ "User-Agent": "local-deep-research-wikinews-search-engine (github.com/LearningCircuit/local-deep-research)"
+}
+TIMEOUT = 5 # Seconds
+TIME_PERIOD_DELTAS = {
+ "all": None, # No time filter
+ "y": timedelta(days=365), # 1 year
+ "m": timedelta(days=30), # 1 month
+ "w": timedelta(days=7), # 1 week
+ "d": timedelta(days=1), # 24 hours
+}
+DEFAULT_RECENT_BACKWARD_DAYS = 60
+MAX_RETRIES = 3
+
+
+class WikinewsSearchEngine(BaseSearchEngine):
+ """Wikinews search engine implementation with LLM query optimization"""
+
+ # Mark as public and news search engine
+ is_public = True
+ is_news = True
+
+ def __init__(
+ self,
+ search_language: str = "english",
+ adaptive_search: bool = False,
+ time_period: str = "y",
+ llm: Optional[BaseLLM] = None,
+ max_filtered_results: Optional[int] = None,
+ max_results: int = 10,
+ search_snippets_only: bool = True,
+ **kwargs,
+ ):
+ """
+ Initialize the Wikinews search engine.
+
+ Args:
+ search_language (str): Language for Wikinews search (e.g. "english").
+ adaptive_search (bool): Whether to expand or shrink date ranges based on query.
+ time_period (str): Defines the look-back window used to filter search results ("all", "y", "m", "w", "d").
+ llm (Optional[BaseLLM]): Language model used for query optimization and classification.
+ max_filtered_results (Optional[int]): Maximum number of results to keep after filtering.
+ max_results (int): Maximum number of search results to return.
+ search_snippets_only (bool): If True, full article content is ignored.
+ """
+
+ super().__init__(
+ llm=llm,
+ max_filtered_results=max_filtered_results,
+ max_results=max_results,
+ search_snippets_only=search_snippets_only,
+ **kwargs,
+ )
+
+ # Language initialization
+ self.language = resolve_wikinews_language(
+ search_language, headers=HEADERS
+ )
+
+ # Adaptive search
+ self.adaptive_search: bool = adaptive_search
+
+ # Date range initialization
+ now = datetime.now(UTC)
+ delta = TIME_PERIOD_DELTAS.get(time_period, timedelta(days=365))
+ self.from_date: datetime = (
+ now - delta if delta else datetime.min.replace(tzinfo=UTC)
+ )
+ self.to_date: datetime = now
+
+ # Preserve original date range so adaptive search can restore it
+ self._original_date_range = (self.from_date, self.to_date)
+
+ # API base URL
+ self.api_url: str = "https://{language}.wikinews.org/w/api.php"
+
+ def _optimize_query_for_wikinews(self, query: str) -> str:
+ """
+ Optimize a natural language query for Wikinews search.
+ Uses LLM to transform questions into effective news search queries.
+
+ Args:
+ query (str): Natural language query
+
+ Returns:
+ Optimized search query for Wikinews
+ """
+ if not self.llm:
+ return query
+
+ try:
+ # Prompt for query optimization
+ prompt = f"""Transform this natural language question into a very short Wikinews search query.
+
+Original query: "{query}"
+
+CRITICAL RULES:
+1. ONLY RETURN THE EXACT SEARCH QUERY - NO EXPLANATIONS, NO COMMENTS
+2. Keep it EXTREMELY BRIEF - MAXIMUM 3-4 words total
+3. Focus only on the main topic/person/event
+4. Include proper names when relevant
+5. Remove ALL unnecessary words (e.g. "news", "latest", "about", ...)
+6. DO NOT use Boolean operators (no AND/OR)
+7. DO NOT use quotes
+
+EXAMPLE CONVERSIONS:
+- "What's the impact of rising interest rates on UK housing market?" -> "UK housing rates"
+- "Latest developments in the Ukraine-Russia peace negotiations" -> "Ukraine Russia negotiations"
+- "How are tech companies responding to AI regulation?" -> "tech AI regulation"
+- "What is Donald Trump's current political activity?" -> "Trump political activity"
+
+Return ONLY the extremely brief search query.
+"""
+ # Get response from LLM
+ response = self.llm.invoke(prompt)
+
+ # Clean up the candidate optimized query
+ optimized_query = extract_clean_query(response)
+
+ if not optimized_query:
+ logger.warning(
+ "LLM returned empty optimized query, using original query"
+ )
+ return query
+
+ logger.info(f"Original query: '{query}'")
+ logger.info(f"Optimized for Wikinews: '{optimized_query}'")
+
+ return optimized_query
+
+ except Exception:
+ logger.exception("Error optimizing query. Using original query.")
+ return query # Return original query on error
+
+ def _adapt_date_range_for_query(self, query: str) -> None:
+ """
+ Adapt the date range based on the query type (historical vs recent events).
+
+ Args:
+ query (str): The search query
+ """
+ # Reset to original date parameters first
+ self.from_date, self.to_date = self._original_date_range
+
+ if not self.adaptive_search or not self.llm:
+ return
+
+ # Do not adapt for very short queries (no enough context)
+ if len(query.split()) <= 4:
+ return
+
+ try:
+ prompt = f"""Classify this query based on temporal scope.
+
+Query: "{query}"
+
+Current date: {datetime.now(UTC).strftime("%Y-%m-%d")}
+Cutoff: Events within the last {DEFAULT_RECENT_BACKWARD_DAYS} days are CURRENT
+
+Classification rules:
+- CURRENT: Recent events (last {DEFAULT_RECENT_BACKWARD_DAYS} days), ongoing situations, "latest", "recent", "today", "this week"
+- HISTORICAL: Events before {DEFAULT_RECENT_BACKWARD_DAYS} days ago, timelines, chronologies, past tense ("what happened", "history of")
+- UNCLEAR: Ambiguous temporal context
+
+Respond with ONE WORD ONLY: CURRENT, HISTORICAL, or UNCLEAR"""
+ # Get response from LLM
+ response = self.llm.invoke(prompt)
+ response_text = (
+ getattr(response, "content", None)
+ or getattr(response, "text", None)
+ or str(response)
+ )
+ answer = remove_think_tags(response_text).strip().upper()
+
+ if "CURRENT" in answer:
+ # For current events, focus on recent content
+ logger.info(
+ f"Query '{query}' classified as CURRENT - focusing on recent content"
+ )
+ self.from_date = datetime.now(UTC) - timedelta(
+ days=DEFAULT_RECENT_BACKWARD_DAYS
+ )
+ elif "HISTORICAL" in answer:
+ # For historical queries, go back as far as possible
+ logger.info(
+ f"Query '{query}' classified as HISTORICAL - extending search timeframe"
+ )
+ self.from_date = datetime.min.replace(tzinfo=UTC)
+ else:
+ logger.info(
+ f"Query '{query}' classified as UNCLEAR - keeping original date range"
+ )
+
+ except Exception:
+ # Keep original date parameters on error
+ logger.exception(
+ "Error adapting dates for query type. Keeping original date range."
+ )
+
+ def _fetch_search_results(
+ self, query: str, sroffset: int
+ ) -> List[Dict[str, Any]]:
+ """Fetch search results from Wikinews API.
+
+ Args:
+ query (str): The search query.
+ sroffset (int): The result offset for pagination.
+
+ Returns:
+ List of search result items.
+ """
+ retries = 0
+ while retries < MAX_RETRIES:
+ params = {
+ "action": "query",
+ "list": "search",
+ "srsearch": query,
+ "srprop": "snippet|timestamp",
+ "srlimit": 50,
+ "sroffset": sroffset,
+ "format": "json",
+ }
+
+ # Apply rate limiting before search request
+ self._last_wait_time = self.rate_tracker.apply_rate_limit(
+ self.engine_type
+ )
+
+ try:
+ response = requests.get(
+ self.api_url.format(language=self.language),
+ params=params,
+ headers=HEADERS,
+ timeout=TIMEOUT,
+ )
+ response.raise_for_status()
+ data = response.json()
+ return data.get("query", {}).get("search", [])
+ except (
+ requests.exceptions.RequestException,
+ json.JSONDecodeError,
+ ) as e:
+ logger.warning(
+ f"Error fetching search results: {e}, retrying..."
+ )
+ retries += 1
+
+ return []
+
+ def _process_search_result(
+ self, result: Dict[str, Any], query: str
+ ) -> Optional[Dict[str, Any]]:
+ """Process and filter a single search result.
+
+ Args:
+ result (Dict[str, Any]): A single search result item.
+ query (str): The search query.
+
+ Returns:
+ Processed result or None if filtered out.
+ """
+ page_id = result.get("pageid")
+ title = result.get("title", "")
+ snippet = clean_wikinews_snippet(result.get("snippet", ""))
+
+ try:
+ last_edit_timestamp = result.get("timestamp", "")
+ last_edit_date = datetime.fromisoformat(
+ last_edit_timestamp.replace("Z", "+00:00")
+ )
+ except ValueError:
+ logger.warning(
+ f"Error parsing last edit date for page {page_id}, using current date as fallback."
+ )
+ last_edit_date = datetime.now(UTC)
+
+ # First filter: last edit date must be after from_date
+ if last_edit_date < self.from_date:
+ # In this case we can skip fetching full content
+ return None
+
+ # Fetch full article content and extract actual publication date
+ # Note: Wikinews API do not allow to retrieve publication date in batched search results
+ full_content, publication_date = self._fetch_full_content_and_pubdate(
+ page_id, last_edit_date
+ )
+
+ # Second filter: publication date within range
+ if publication_date < self.from_date or publication_date > self.to_date:
+ return None
+
+ # Third filter: check if all query words are in title or content (naive approach)
+ # Note: Wikinews search return false positive if query words are in "related" articles section
+ combined_text = f"{title} {full_content}".lower()
+ if not all(word.lower() in combined_text for word in query.split()):
+ return None
+
+ # If only snippets are requested, we use snippet as full content
+ if self.search_snippets_only:
+ full_content = snippet
+
+ return {
+ "id": page_id,
+ "title": title,
+ "snippet": snippet,
+ "source": "wikinews",
+ "url": f"https://{self.language}.wikinews.org/?curid={page_id}", # Used by '_filter_for_relevance' function
+ "link": f"https://{self.language}.wikinews.org/?curid={page_id}", # Used by citation handler
+ "content": full_content,
+ "full_content": full_content,
+ "publication_date": publication_date,
+ }
+
+ def _fetch_full_content_and_pubdate(
+ self, page_id: int, fallback_date: datetime
+ ) -> Tuple[str, datetime]:
+ """Fetch full article content and publication date from Wikinews API.
+
+ Args:
+ page_id (int): The Wikinews page ID.
+ fallback_date (datetime): Fallback date if publication date cannot be determined.
+
+ Returns:
+ Tuple of (full_content, publication_date)
+ """
+ try:
+ content_params = {
+ "action": "query",
+ "prop": "revisions|extracts",
+ "pageids": page_id,
+ "rvprop": "timestamp",
+ "rvdir": "newer", # Older revisions first
+ "rvlimit": 1, # Get the first revision (i.e. publication)
+ "explaintext": True,
+ "format": "json",
+ }
+
+ # Apply rate limiting before content request
+ self._last_wait_time = self.rate_tracker.apply_rate_limit(
+ self.engine_type
+ )
+
+ content_resp = requests.get(
+ self.api_url.format(language=self.language),
+ params=content_params,
+ headers=HEADERS,
+ timeout=TIMEOUT,
+ )
+ content_resp.raise_for_status()
+ content_data = content_resp.json()
+
+ page_data = (
+ content_data.get("query", {})
+ .get("pages", {})
+ .get(str(page_id), {})
+ )
+ full_content = page_data.get("extract", "")
+ revisions = page_data.get("revisions", [])
+
+ if revisions:
+ try:
+ # First revision timestamp is the publication date
+ publication_date = datetime.fromisoformat(
+ revisions[0]["timestamp"].replace("Z", "+00:00")
+ )
+ except ValueError:
+ logger.warning(
+ f"Error parsing publication date for page {page_id}, using fallback date."
+ )
+ publication_date = fallback_date
+ else:
+ logger.warning(
+ f"No revisions found for page {page_id}, using fallback date."
+ )
+ publication_date = fallback_date
+
+ return full_content, publication_date
+
+ except (
+ requests.exceptions.RequestException,
+ json.JSONDecodeError,
+ ) as e:
+ logger.warning(f"Error fetching content for page {page_id}: {e}")
+ return "", fallback_date
+
+ def _get_previews(self, query: str) -> List[Dict[str, Any]]:
+ """
+ Retrieve article previews from Wikinews based on the query.
+
+ Args:
+ query (str): The search query
+
+ Returns:
+ List of relevant article previews
+ """
+ # Adapt date range based on query and optimize query (if LLM is available)
+ self._adapt_date_range_for_query(query)
+ optimized_query = self._optimize_query_for_wikinews(query)
+
+ articles = []
+ sroffset = 0
+
+ while len(articles) < self.max_results:
+ search_results = self._fetch_search_results(
+ optimized_query, sroffset
+ )
+ if not search_results:
+ # No more results available (or multiple retries failed)
+ break
+
+ for result in search_results:
+ article = self._process_search_result(result, optimized_query)
+ if article:
+ articles.append(article)
+ if len(articles) >= self.max_results:
+ break
+
+ sroffset += len(search_results)
+
+ return articles
+
+ def _get_full_content(
+ self, relevant_items: List[Dict[str, Any]]
+ ) -> List[Dict[str, Any]]:
+ """
+ Retrieve full content for relevant Wikinews articles.
+
+ Args:
+ relevant_items (List[Dict[str, Any]]): List of relevant article previews
+
+ Returns:
+ List of articles with full content
+ """
+ # Since full content is already fetched in _get_previews, just return relevant items
+ return relevant_items
diff --git a/src/local_deep_research/web_search_engines/search_engine_factory.py b/src/local_deep_research/web_search_engines/search_engine_factory.py
index 7ce9479ad2..780038f23d 100644
--- a/src/local_deep_research/web_search_engines/search_engine_factory.py
+++ b/src/local_deep_research/web_search_engines/search_engine_factory.py
@@ -521,10 +521,18 @@ def get_search(
}
)
- if search_tool in ["serpapi", "brave", "google_pse"]:
+ if search_tool in ["serpapi", "brave", "google_pse", "wikinews"]:
params["search_language"] = search_language
- if search_tool == "serpapi":
+ if search_tool == "wikinews":
+ params["search_snippets_only"] = search_snippets_only
+ params["adaptive_search"] = bool(
+ settings_snapshot.get(
+ "search.engine.web.wikinews.adaptive_search", {}
+ ).get("value", False)
+ )
+
+ if search_tool in ["serpapi", "wikinews"]:
params["time_period"] = time_period
# Create and return the search engine