local-deep-research 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. local_deep_research/__init__.py +24 -0
  2. local_deep_research/citation_handler.py +113 -0
  3. local_deep_research/config.py +166 -0
  4. local_deep_research/defaults/__init__.py +44 -0
  5. local_deep_research/defaults/llm_config.py +269 -0
  6. local_deep_research/defaults/local_collections.toml +47 -0
  7. local_deep_research/defaults/main.toml +57 -0
  8. local_deep_research/defaults/search_engines.toml +244 -0
  9. local_deep_research/local_collections.py +141 -0
  10. local_deep_research/main.py +113 -0
  11. local_deep_research/report_generator.py +206 -0
  12. local_deep_research/search_system.py +241 -0
  13. local_deep_research/utilties/__init__.py +0 -0
  14. local_deep_research/utilties/enums.py +9 -0
  15. local_deep_research/utilties/llm_utils.py +116 -0
  16. local_deep_research/utilties/search_utilities.py +115 -0
  17. local_deep_research/utilties/setup_utils.py +6 -0
  18. local_deep_research/web/__init__.py +2 -0
  19. local_deep_research/web/app.py +1209 -0
  20. local_deep_research/web/static/css/styles.css +1008 -0
  21. local_deep_research/web/static/js/app.js +2078 -0
  22. local_deep_research/web/templates/api_keys_config.html +82 -0
  23. local_deep_research/web/templates/collections_config.html +90 -0
  24. local_deep_research/web/templates/index.html +312 -0
  25. local_deep_research/web/templates/llm_config.html +120 -0
  26. local_deep_research/web/templates/main_config.html +89 -0
  27. local_deep_research/web/templates/search_engines_config.html +154 -0
  28. local_deep_research/web/templates/settings.html +519 -0
  29. local_deep_research/web/templates/settings_dashboard.html +207 -0
  30. local_deep_research/web_search_engines/__init__.py +0 -0
  31. local_deep_research/web_search_engines/engines/__init__.py +0 -0
  32. local_deep_research/web_search_engines/engines/full_search.py +128 -0
  33. local_deep_research/web_search_engines/engines/meta_search_engine.py +274 -0
  34. local_deep_research/web_search_engines/engines/search_engine_arxiv.py +367 -0
  35. local_deep_research/web_search_engines/engines/search_engine_brave.py +245 -0
  36. local_deep_research/web_search_engines/engines/search_engine_ddg.py +123 -0
  37. local_deep_research/web_search_engines/engines/search_engine_github.py +663 -0
  38. local_deep_research/web_search_engines/engines/search_engine_google_pse.py +283 -0
  39. local_deep_research/web_search_engines/engines/search_engine_guardian.py +337 -0
  40. local_deep_research/web_search_engines/engines/search_engine_local.py +901 -0
  41. local_deep_research/web_search_engines/engines/search_engine_local_all.py +153 -0
  42. local_deep_research/web_search_engines/engines/search_engine_medrxiv.py +623 -0
  43. local_deep_research/web_search_engines/engines/search_engine_pubmed.py +992 -0
  44. local_deep_research/web_search_engines/engines/search_engine_serpapi.py +230 -0
  45. local_deep_research/web_search_engines/engines/search_engine_wayback.py +474 -0
  46. local_deep_research/web_search_engines/engines/search_engine_wikipedia.py +242 -0
  47. local_deep_research/web_search_engines/full_search.py +254 -0
  48. local_deep_research/web_search_engines/search_engine_base.py +197 -0
  49. local_deep_research/web_search_engines/search_engine_factory.py +233 -0
  50. local_deep_research/web_search_engines/search_engines_config.py +54 -0
  51. local_deep_research-0.1.0.dist-info/LICENSE +21 -0
  52. local_deep_research-0.1.0.dist-info/METADATA +328 -0
  53. local_deep_research-0.1.0.dist-info/RECORD +56 -0
  54. local_deep_research-0.1.0.dist-info/WHEEL +5 -0
  55. local_deep_research-0.1.0.dist-info/entry_points.txt +3 -0
  56. local_deep_research-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,89 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Deep Research System - Search Settings</title>
7
+ <link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/styles.css') }}">
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
9
+ <link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.ico') }}">
10
+ </head>
11
+ <body>
12
+ <div class="app-container">
13
+ <!-- Sidebar -->
14
+ <aside class="sidebar">
15
+ <!-- Sidebar content (keep as is) -->
16
+ </aside>
17
+
18
+ <!-- Main Content -->
19
+ <main class="main-content">
20
+ <div class="page active" id="settings">
21
+ <div class="page-header">
22
+ <div class="results-header">
23
+ <h1>Search Settings</h1>
24
+ <div class="results-actions">
25
+ <a href="{{ url_for('research.settings_page') }}" class="btn btn-outline">
26
+ <i class="fas fa-arrow-left"></i> Back to Settings
27
+ </a>
28
+ </div>
29
+ </div>
30
+ </div>
31
+
32
+ <div class="card">
33
+ <div class="card-content">
34
+ <h2>Main Configuration File</h2>
35
+ <p>To edit your main configuration, open this file with your preferred text editor:</p>
36
+ <div class="file-path">{{ main_file_path }}</div>
37
+
38
+ <button onclick="openFileLocation('{{ main_file_path }}')" class="btn btn-primary">
39
+ <i class="fas fa-folder-open"></i> Open Containing Folder
40
+ </button>
41
+
42
+ <h3 class="mt-4">Default Configuration Example</h3>
43
+ <pre class="config-example">
44
+ [general]
45
+ output_dir = "research_outputs"
46
+ knowledge_accumulation = "ITERATION"
47
+ knowledge_accumulation_context_limit = 500000
48
+ enable_fact_checking = true
49
+
50
+ [search]
51
+ tool = "auto"
52
+ iterations = 3
53
+ questions_per_iteration = 3
54
+ searches_per_section = 2
55
+ max_results = 10
56
+ max_filtered_results = 5
57
+ region = "us"
58
+ time_period = "a"
59
+ search_language = "en"
60
+ safe_search = true
61
+ quality_check_urls = true
62
+ snippets_only = false
63
+ skip_relevance_filter = false
64
+ </pre>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ </main>
69
+ </div>
70
+
71
+ <script>
72
+ function openFileLocation(filePath) {
73
+ // Create a hidden form and submit it to a route that will open the file location
74
+ const form = document.createElement('form');
75
+ form.method = 'POST';
76
+ form.action = "{{ url_for('research.open_file_location') }}";
77
+
78
+ const input = document.createElement('input');
79
+ input.type = 'hidden';
80
+ input.name = 'file_path';
81
+ input.value = filePath;
82
+
83
+ form.appendChild(input);
84
+ document.body.appendChild(form);
85
+ form.submit();
86
+ }
87
+ </script>
88
+ </body>
89
+ </html>
@@ -0,0 +1,154 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Deep Research System - Search Engines</title>
7
+ <link rel="stylesheet" href="{{ url_for('research.serve_static', path='css/styles.css') }}">
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
9
+ <link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.ico') }}">
10
+ </head>
11
+ <body>
12
+ <div class="app-container">
13
+ <!-- Sidebar -->
14
+ <aside class="sidebar">
15
+ <!-- Sidebar content (keep as is) -->
16
+ </aside>
17
+
18
+ <!-- Main Content -->
19
+ <main class="main-content">
20
+ <div class="page active" id="search-engines-settings">
21
+ <div class="page-header">
22
+ <div class="results-header">
23
+ <h1>Search Engines Configuration</h1>
24
+ <div class="results-actions">
25
+ <a href="{{ url_for('research.settings_page') }}" class="btn btn-outline">
26
+ <i class="fas fa-arrow-left"></i> Back to Settings
27
+ </a>
28
+ </div>
29
+ </div>
30
+ </div>
31
+
32
+ <div class="card">
33
+ <div class="card-content">
34
+ <h2>Search Engines Configuration File</h2>
35
+ <p>To edit your search engines configuration, open this file with your preferred text editor:</p>
36
+ <div class="file-path">{{ search_engines_file_path }}</div>
37
+
38
+ <button onclick="openFileLocation('{{ search_engines_file_path }}')" class="btn btn-primary">
39
+ <i class="fas fa-folder-open"></i> Open Containing Folder
40
+ </button>
41
+
42
+ <h3 class="mt-4">Edit Raw Configuration</h3>
43
+ <div id="editor-container">
44
+ <div class="editor-header">
45
+ <h3>Search Engines Configuration (TOML format)</h3>
46
+ <span class="editor-lang">TOML</span>
47
+ </div>
48
+ <textarea id="raw_config_editor" class="config-raw-editor" rows="25">{{ raw_config }}</textarea>
49
+ <div class="form-actions">
50
+ <button type="button" class="btn btn-primary" onclick="saveRawConfig()">
51
+ <i class="fas fa-save"></i> Save Configuration
52
+ </button>
53
+ <button type="button" class="btn btn-outline" onclick="resetEditor()">
54
+ <i class="fas fa-undo"></i> Reset Changes
55
+ </button>
56
+ </div>
57
+ </div>
58
+
59
+ <h3 class="mt-4">Structure Reference</h3>
60
+ <p>Search engines are defined in TOML format with the following structure:</p>
61
+ <pre class="config-example">
62
+ # Define a search engine named "example_engine"
63
+ [example_engine]
64
+ module_path = "local_deep_research.web_search_engines.engines.search_engine_example"
65
+ class_name = "ExampleSearchEngine"
66
+ requires_api_key = false # or true if API key is required
67
+ reliability = 0.9 # Value between 0 and 1
68
+ strengths = ["strength1", "strength2"] # Array of strengths
69
+ weaknesses = ["weakness1", "weakness2"] # Array of weaknesses
70
+ supports_full_search = true # Whether this engine supports retrieving full content
71
+
72
+ # Optional: Define which API key environment variable to use
73
+ api_key_env = "EXAMPLE_API_KEY" # Only needed if requires_api_key is true
74
+
75
+ # Default parameters for this search engine
76
+ [example_engine.default_params]
77
+ max_results = 20
78
+ param1 = "value1"
79
+ param2 = true
80
+
81
+ # Special setting to define the default search engine
82
+ DEFAULT_SEARCH_ENGINE = "wikipedia"
83
+ </pre>
84
+
85
+ <h3 class="mt-4">Available Search Engines</h3>
86
+ <p>The following search engines are currently defined:</p>
87
+ <ul id="available-engines">
88
+ {% for engine_name in engine_names %}
89
+ <li><strong>{{ engine_name }}</strong></li>
90
+ {% endfor %}
91
+ </ul>
92
+
93
+ <div class="alert alert-info mt-4">
94
+ <i class="fas fa-info-circle"></i> Changes to search engines configuration will take effect after restarting the application.
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </main>
100
+ </div>
101
+
102
+ <script>
103
+ // Original config for reset functionality
104
+ const originalConfig = document.getElementById('raw_config_editor').value;
105
+
106
+ function openFileLocation(filePath) {
107
+ // Create a hidden form and submit it to a route that will open the file location
108
+ const form = document.createElement('form');
109
+ form.method = 'POST';
110
+ form.action = "{{ url_for('research.open_file_location') }}";
111
+
112
+ const input = document.createElement('input');
113
+ input.type = 'hidden';
114
+ input.name = 'file_path';
115
+ input.value = filePath;
116
+
117
+ form.appendChild(input);
118
+ document.body.appendChild(form);
119
+ form.submit();
120
+ }
121
+
122
+ function resetEditor() {
123
+ if (confirm('Are you sure you want to reset all changes?')) {
124
+ document.getElementById('raw_config_editor').value = originalConfig;
125
+ }
126
+ }
127
+
128
+ function saveRawConfig() {
129
+ const rawConfig = document.getElementById('raw_config_editor').value;
130
+
131
+ fetch('{{ url_for("research.save_search_engines_config") }}', {
132
+ method: 'POST',
133
+ headers: {
134
+ 'Content-Type': 'application/json',
135
+ },
136
+ body: JSON.stringify({ raw_config: rawConfig }),
137
+ })
138
+ .then(response => response.json())
139
+ .then(data => {
140
+ if (data.success) {
141
+ alert('Configuration saved successfully. Changes will take effect after restarting the application.');
142
+ // Reload the page to refresh the content
143
+ window.location.reload();
144
+ } else {
145
+ alert('Error saving configuration: ' + data.error);
146
+ }
147
+ })
148
+ .catch(error => {
149
+ alert('Error saving configuration: ' + error);
150
+ });
151
+ }
152
+ </script>
153
+ </body>
154
+ </html>