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.

refactor: delete dead files default_search_engines.py and mock_llm_config.py (#4450) (#4460)

LearningCircuit5dc0b59cabd1
diff --git a/src/local_deep_research/web_search_engines/default_search_engines.py b/src/local_deep_research/web_search_engines/default_search_engines.py
deleted file mode 100644
index 1a8869ff06..0000000000
--- a/src/local_deep_research/web_search_engines/default_search_engines.py
+++ /dev/null
@@ -1,40 +0,0 @@
-"""
-Default search engine configurations.
-This file can be used to initialize the search engine configurations.
-"""
-
-
-def get_default_elasticsearch_config():
- """
- Returns the default Elasticsearch search engine configuration.
-
- Returns:
- dict: Default configuration for Elasticsearch search engine
- """
- return {
- "module_path": ".engines.search_engine_elasticsearch",
- "class_name": "ElasticsearchSearchEngine",
- "requires_llm": True,
- "default_params": {
- "hosts": ["http://172.16.4.131:9200"],
- "index_name": "sample_documents",
- "highlight_fields": ["content", "title"],
- "search_fields": ["content", "title"],
- },
- "description": "Search engine for Elasticsearch databases",
- "strengths": "Efficient for searching document collections and structured data",
- "weaknesses": "Requires an Elasticsearch instance and properly indexed data",
- "reliability": "High, depending on your Elasticsearch setup",
- }
-
-
-def get_default_search_engine_configs():
- """
- Returns a dictionary of default search engine configurations.
-
- Returns:
- dict: Dictionary of default search engine configurations
- """
- return {
- "elasticsearch": get_default_elasticsearch_config(),
- }
diff --git a/tests/mock_llm_config.py b/tests/mock_llm_config.py
deleted file mode 100644
index 91eb1e8d94..0000000000
--- a/tests/mock_llm_config.py
+++ /dev/null
@@ -1,55 +0,0 @@
-"""
-This is a mock llm_config.py module for testing.
-Place this in your tests directory as mock_llm_config.py
-"""
-
-import sys
-import types
-from unittest.mock import Mock
-
-
-def create_mock_llm_config():
- """Create a mock llm_config module for testing."""
- # Create a mock module
- mock_module = types.ModuleType("mock_llm_config")
-
- # Add necessary functions and variables
- def get_llm(*args, **kwargs):
- return Mock()
-
- mock_module.get_llm = get_llm
- mock_module.VALID_PROVIDERS = [
- "ollama",
- "openai",
- "anthropic",
- "openai_endpoint",
- "lmstudio",
- "llamacpp",
- "none",
- ]
-
- # Add other necessary attributes
- mock_module.AVAILABLE_PROVIDERS = {"ollama": "Ollama (local models)"}
- mock_module.get_available_providers = lambda: (
- mock_module.AVAILABLE_PROVIDERS
- )
-
- return mock_module
-
-
-# For use in test setup
-def patch_llm_config(monkeypatch):
- """
- Patch the llm_config module in the pytest setup.
-
- Usage in a test:
-
- def test_something(monkeypatch):
- patch_llm_config(monkeypatch)
- # Now imports will use the mock module
- """
- mock_module = create_mock_llm_config()
- monkeypatch.setitem(
- sys.modules, "local_deep_research.config.llm_config", mock_module
- )
- monkeypatch.setattr("local_deep_research.config.llm_config", mock_module)
diff --git a/tests/web_search_engines/test_default_search_engines.py b/tests/web_search_engines/test_default_search_engines.py
deleted file mode 100644
index 0c8035a10f..0000000000
--- a/tests/web_search_engines/test_default_search_engines.py
+++ /dev/null
@@ -1,113 +0,0 @@
-"""
-Tests for the default search engine configurations.
-
-Tests cover:
-- Default Elasticsearch configuration
-- Default search engine configs
-"""
-
-
-class TestGetDefaultElasticsearchConfig:
- """Tests for get_default_elasticsearch_config function."""
-
- def test_returns_dict(self):
- """Function returns a dictionary."""
- from local_deep_research.web_search_engines.default_search_engines import (
- get_default_elasticsearch_config,
- )
-
- result = get_default_elasticsearch_config()
-
- assert isinstance(result, dict)
-
- def test_has_required_keys(self):
- """Config has required keys."""
- from local_deep_research.web_search_engines.default_search_engines import (
- get_default_elasticsearch_config,
- )
-
- result = get_default_elasticsearch_config()
-
- assert "module_path" in result
- assert "class_name" in result
- assert "requires_llm" in result
- assert "default_params" in result
- assert "description" in result
-
- def test_correct_class_name(self):
- """Config has correct class name."""
- from local_deep_research.web_search_engines.default_search_engines import (
- get_default_elasticsearch_config,
- )
-
- result = get_default_elasticsearch_config()
-
- assert result["class_name"] == "ElasticsearchSearchEngine"
-
- def test_has_hosts_param(self):
- """Config has hosts in default params."""
- from local_deep_research.web_search_engines.default_search_engines import (
- get_default_elasticsearch_config,
- )
-
- result = get_default_elasticsearch_config()
-
- assert "hosts" in result["default_params"]
- assert isinstance(result["default_params"]["hosts"], list)
-
- def test_has_index_name(self):
- """Config has index name in default params."""
- from local_deep_research.web_search_engines.default_search_engines import (
- get_default_elasticsearch_config,
- )
-
- result = get_default_elasticsearch_config()
-
- assert "index_name" in result["default_params"]
-
- def test_has_search_fields(self):
- """Config has search fields in default params."""
- from local_deep_research.web_search_engines.default_search_engines import (
- get_default_elasticsearch_config,
- )
-
- result = get_default_elasticsearch_config()
-
- assert "search_fields" in result["default_params"]
- assert isinstance(result["default_params"]["search_fields"], list)
-
-
-class TestGetDefaultSearchEngineConfigs:
- """Tests for get_default_search_engine_configs function."""
-
- def test_returns_dict(self):
- """Function returns a dictionary."""
- from local_deep_research.web_search_engines.default_search_engines import (
- get_default_search_engine_configs,
- )
-
- result = get_default_search_engine_configs()
-
- assert isinstance(result, dict)
-
- def test_has_elasticsearch(self):
- """Config includes elasticsearch."""
- from local_deep_research.web_search_engines.default_search_engines import (
- get_default_search_engine_configs,
- )
-
- result = get_default_search_engine_configs()
-
- assert "elasticsearch" in result
-
- def test_elasticsearch_config_matches(self):
- """Elasticsearch config matches dedicated function."""
- from local_deep_research.web_search_engines.default_search_engines import (
- get_default_elasticsearch_config,
- get_default_search_engine_configs,
- )
-
- configs = get_default_search_engine_configs()
- es_config = get_default_elasticsearch_config()
-
- assert configs["elasticsearch"] == es_config