local-deep-research 0.1.26__py3-none-any.whl → 0.2.2__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.
- local_deep_research/__init__.py +23 -22
- local_deep_research/__main__.py +16 -0
- local_deep_research/advanced_search_system/__init__.py +7 -0
- local_deep_research/advanced_search_system/filters/__init__.py +8 -0
- local_deep_research/advanced_search_system/filters/base_filter.py +38 -0
- local_deep_research/advanced_search_system/filters/cross_engine_filter.py +200 -0
- local_deep_research/advanced_search_system/findings/base_findings.py +81 -0
- local_deep_research/advanced_search_system/findings/repository.py +452 -0
- local_deep_research/advanced_search_system/knowledge/__init__.py +1 -0
- local_deep_research/advanced_search_system/knowledge/base_knowledge.py +151 -0
- local_deep_research/advanced_search_system/knowledge/standard_knowledge.py +159 -0
- local_deep_research/advanced_search_system/questions/__init__.py +1 -0
- local_deep_research/advanced_search_system/questions/base_question.py +64 -0
- local_deep_research/advanced_search_system/questions/decomposition_question.py +445 -0
- local_deep_research/advanced_search_system/questions/standard_question.py +119 -0
- local_deep_research/advanced_search_system/repositories/__init__.py +7 -0
- local_deep_research/advanced_search_system/strategies/__init__.py +1 -0
- local_deep_research/advanced_search_system/strategies/base_strategy.py +118 -0
- local_deep_research/advanced_search_system/strategies/iterdrag_strategy.py +450 -0
- local_deep_research/advanced_search_system/strategies/parallel_search_strategy.py +312 -0
- local_deep_research/advanced_search_system/strategies/rapid_search_strategy.py +270 -0
- local_deep_research/advanced_search_system/strategies/standard_strategy.py +300 -0
- local_deep_research/advanced_search_system/tools/__init__.py +1 -0
- local_deep_research/advanced_search_system/tools/base_tool.py +100 -0
- local_deep_research/advanced_search_system/tools/knowledge_tools/__init__.py +1 -0
- local_deep_research/advanced_search_system/tools/question_tools/__init__.py +1 -0
- local_deep_research/advanced_search_system/tools/search_tools/__init__.py +1 -0
- local_deep_research/api/__init__.py +5 -5
- local_deep_research/api/research_functions.py +154 -160
- local_deep_research/app.py +8 -0
- local_deep_research/citation_handler.py +25 -16
- local_deep_research/{config.py → config/config_files.py} +102 -110
- local_deep_research/config/llm_config.py +472 -0
- local_deep_research/config/search_config.py +77 -0
- local_deep_research/defaults/__init__.py +10 -5
- local_deep_research/defaults/main.toml +2 -2
- local_deep_research/defaults/search_engines.toml +60 -34
- local_deep_research/main.py +121 -19
- local_deep_research/migrate_db.py +147 -0
- local_deep_research/report_generator.py +87 -45
- local_deep_research/search_system.py +153 -283
- local_deep_research/setup_data_dir.py +35 -0
- local_deep_research/test_migration.py +178 -0
- local_deep_research/utilities/__init__.py +0 -0
- local_deep_research/utilities/db_utils.py +49 -0
- local_deep_research/{utilties → utilities}/enums.py +2 -2
- local_deep_research/{utilties → utilities}/llm_utils.py +63 -29
- local_deep_research/utilities/search_utilities.py +242 -0
- local_deep_research/{utilties → utilities}/setup_utils.py +4 -2
- local_deep_research/web/__init__.py +0 -1
- local_deep_research/web/app.py +86 -1709
- local_deep_research/web/app_factory.py +289 -0
- local_deep_research/web/database/README.md +70 -0
- local_deep_research/web/database/migrate_to_ldr_db.py +289 -0
- local_deep_research/web/database/migrations.py +447 -0
- local_deep_research/web/database/models.py +117 -0
- local_deep_research/web/database/schema_upgrade.py +107 -0
- local_deep_research/web/models/database.py +294 -0
- local_deep_research/web/models/settings.py +94 -0
- local_deep_research/web/routes/api_routes.py +559 -0
- local_deep_research/web/routes/history_routes.py +354 -0
- local_deep_research/web/routes/research_routes.py +715 -0
- local_deep_research/web/routes/settings_routes.py +1583 -0
- local_deep_research/web/services/research_service.py +947 -0
- local_deep_research/web/services/resource_service.py +149 -0
- local_deep_research/web/services/settings_manager.py +669 -0
- local_deep_research/web/services/settings_service.py +187 -0
- local_deep_research/web/services/socket_service.py +210 -0
- local_deep_research/web/static/css/custom_dropdown.css +277 -0
- local_deep_research/web/static/css/settings.css +1223 -0
- local_deep_research/web/static/css/styles.css +525 -48
- local_deep_research/web/static/js/components/custom_dropdown.js +428 -0
- local_deep_research/web/static/js/components/detail.js +348 -0
- local_deep_research/web/static/js/components/fallback/formatting.js +122 -0
- local_deep_research/web/static/js/components/fallback/ui.js +215 -0
- local_deep_research/web/static/js/components/history.js +487 -0
- local_deep_research/web/static/js/components/logpanel.js +949 -0
- local_deep_research/web/static/js/components/progress.js +1107 -0
- local_deep_research/web/static/js/components/research.js +1865 -0
- local_deep_research/web/static/js/components/results.js +766 -0
- local_deep_research/web/static/js/components/settings.js +3981 -0
- local_deep_research/web/static/js/components/settings_sync.js +106 -0
- local_deep_research/web/static/js/main.js +226 -0
- local_deep_research/web/static/js/services/api.js +253 -0
- local_deep_research/web/static/js/services/audio.js +31 -0
- local_deep_research/web/static/js/services/formatting.js +119 -0
- local_deep_research/web/static/js/services/pdf.js +622 -0
- local_deep_research/web/static/js/services/socket.js +882 -0
- local_deep_research/web/static/js/services/ui.js +546 -0
- local_deep_research/web/templates/base.html +72 -0
- local_deep_research/web/templates/components/custom_dropdown.html +47 -0
- local_deep_research/web/templates/components/log_panel.html +32 -0
- local_deep_research/web/templates/components/mobile_nav.html +22 -0
- local_deep_research/web/templates/components/settings_form.html +299 -0
- local_deep_research/web/templates/components/sidebar.html +21 -0
- local_deep_research/web/templates/pages/details.html +73 -0
- local_deep_research/web/templates/pages/history.html +51 -0
- local_deep_research/web/templates/pages/progress.html +57 -0
- local_deep_research/web/templates/pages/research.html +139 -0
- local_deep_research/web/templates/pages/results.html +59 -0
- local_deep_research/web/templates/settings_dashboard.html +78 -192
- local_deep_research/web/utils/__init__.py +0 -0
- local_deep_research/web/utils/formatters.py +76 -0
- local_deep_research/web_search_engines/engines/full_search.py +18 -16
- local_deep_research/web_search_engines/engines/meta_search_engine.py +182 -131
- local_deep_research/web_search_engines/engines/search_engine_arxiv.py +224 -139
- local_deep_research/web_search_engines/engines/search_engine_brave.py +88 -71
- local_deep_research/web_search_engines/engines/search_engine_ddg.py +48 -39
- local_deep_research/web_search_engines/engines/search_engine_github.py +415 -204
- local_deep_research/web_search_engines/engines/search_engine_google_pse.py +123 -90
- local_deep_research/web_search_engines/engines/search_engine_guardian.py +210 -157
- local_deep_research/web_search_engines/engines/search_engine_local.py +532 -369
- local_deep_research/web_search_engines/engines/search_engine_local_all.py +42 -36
- local_deep_research/web_search_engines/engines/search_engine_pubmed.py +358 -266
- local_deep_research/web_search_engines/engines/search_engine_searxng.py +212 -160
- local_deep_research/web_search_engines/engines/search_engine_semantic_scholar.py +213 -170
- local_deep_research/web_search_engines/engines/search_engine_serpapi.py +84 -68
- local_deep_research/web_search_engines/engines/search_engine_wayback.py +186 -154
- local_deep_research/web_search_engines/engines/search_engine_wikipedia.py +115 -77
- local_deep_research/web_search_engines/search_engine_base.py +174 -99
- local_deep_research/web_search_engines/search_engine_factory.py +192 -102
- local_deep_research/web_search_engines/search_engines_config.py +22 -15
- {local_deep_research-0.1.26.dist-info → local_deep_research-0.2.2.dist-info}/METADATA +177 -97
- local_deep_research-0.2.2.dist-info/RECORD +135 -0
- {local_deep_research-0.1.26.dist-info → local_deep_research-0.2.2.dist-info}/WHEEL +1 -2
- {local_deep_research-0.1.26.dist-info → local_deep_research-0.2.2.dist-info}/entry_points.txt +3 -0
- local_deep_research/defaults/llm_config.py +0 -338
- local_deep_research/utilties/search_utilities.py +0 -114
- local_deep_research/web/static/js/app.js +0 -3763
- local_deep_research/web/templates/api_keys_config.html +0 -82
- local_deep_research/web/templates/collections_config.html +0 -90
- local_deep_research/web/templates/index.html +0 -348
- local_deep_research/web/templates/llm_config.html +0 -120
- local_deep_research/web/templates/main_config.html +0 -89
- local_deep_research/web/templates/search_engines_config.html +0 -154
- local_deep_research/web/templates/settings.html +0 -519
- local_deep_research-0.1.26.dist-info/RECORD +0 -61
- local_deep_research-0.1.26.dist-info/top_level.txt +0 -1
- /local_deep_research/{utilties → config}/__init__.py +0 -0
- {local_deep_research-0.1.26.dist-info → local_deep_research-0.2.2.dist-info}/licenses/LICENSE +0 -0
@@ -1,82 +0,0 @@
|
|
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 - API Keys</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="api-keys-settings">
|
21
|
-
<div class="page-header">
|
22
|
-
<div class="results-header">
|
23
|
-
<h1>API Keys 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>API Keys Configuration File</h2>
|
35
|
-
<p>To edit your API keys configuration, open this file with your preferred text editor. Note that files beginning with a dot or located in configuration directories may be hidden by default in your file explorer. You may need to enable "Show Hidden Files" in your file explorer settings to view it.</p>
|
36
|
-
<div class="file-path">{{ secrets_file_path }}</div>
|
37
|
-
|
38
|
-
<button onclick="openFileLocation('{{ secrets_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">Configuration Example</h3>
|
43
|
-
<pre class="config-example">
|
44
|
-
# API Keys for Deep Research System
|
45
|
-
# This file contains sensitive information and should not be shared.
|
46
|
-
|
47
|
-
# LLM Service API Keys
|
48
|
-
ANTHROPIC_API_KEY = "your-anthropic-api-key-here"
|
49
|
-
OPENAI_API_KEY = "your-openai-api-key-here"
|
50
|
-
|
51
|
-
# Search Service API Keys
|
52
|
-
GOOGLE_API_KEY = "your-google-api-key-here"
|
53
|
-
SERP_API_KEY = "your-serp-api-key-here"
|
54
|
-
GUARDIAN_API_KEY = "your-guardian-api-key-here"
|
55
|
-
GOOGLE_PSE_API_KEY = "your-google-pse-api-key-here"
|
56
|
-
GOOGLE_PSE_ENGINE_ID = "your-google-pse-engine-id-here"
|
57
|
-
</pre>
|
58
|
-
</div>
|
59
|
-
</div>
|
60
|
-
</div>
|
61
|
-
</main>
|
62
|
-
</div>
|
63
|
-
|
64
|
-
<script>
|
65
|
-
function openFileLocation(filePath) {
|
66
|
-
// Create a hidden form and submit it to a route that will open the file location
|
67
|
-
const form = document.createElement('form');
|
68
|
-
form.method = 'POST';
|
69
|
-
form.action = "{{ url_for('research.open_file_location') }}";
|
70
|
-
|
71
|
-
const input = document.createElement('input');
|
72
|
-
input.type = 'hidden';
|
73
|
-
input.name = 'file_path';
|
74
|
-
input.value = filePath;
|
75
|
-
|
76
|
-
form.appendChild(input);
|
77
|
-
document.body.appendChild(form);
|
78
|
-
form.submit();
|
79
|
-
}
|
80
|
-
</script>
|
81
|
-
</body>
|
82
|
-
</html>
|
@@ -1,90 +0,0 @@
|
|
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 - Local Collections</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="collections-settings">
|
21
|
-
<div class="page-header">
|
22
|
-
<div class="results-header">
|
23
|
-
<h1>Local Document Collections</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>Local Collections Configuration File</h2>
|
35
|
-
<p>To edit your local collections configuration, open this file with your preferred text editor:</p>
|
36
|
-
<div class="file-path">{{ collections_file_path }}</div>
|
37
|
-
|
38
|
-
<button onclick="openFileLocation('{{ collections_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
|
-
[project_docs]
|
45
|
-
name = "Project Documents"
|
46
|
-
description = "Project documentation and specifications"
|
47
|
-
paths = ["/path/to/project_documents"]
|
48
|
-
enabled = true
|
49
|
-
embedding_model = "all-MiniLM-L6-v2"
|
50
|
-
embedding_device = "cpu" # "cpu" or "cuda" for GPU
|
51
|
-
embedding_model_type = "sentence_transformers"
|
52
|
-
max_results = 20
|
53
|
-
max_filtered_results = 5
|
54
|
-
chunk_size = 1000
|
55
|
-
chunk_overlap = 200
|
56
|
-
cache_dir = ".cache/local_search/project_docs"
|
57
|
-
|
58
|
-
# Default embedding settings for all collections
|
59
|
-
[DEFAULT_EMBEDDING_SETTINGS]
|
60
|
-
DEFAULT_EMBEDDING_MODEL = "all-MiniLM-L6-v2"
|
61
|
-
DEFAULT_EMBEDDING_DEVICE = "cpu"
|
62
|
-
DEFAULT_EMBEDDING_MODEL_TYPE = "sentence_transformers"
|
63
|
-
FORCE_REINDEX = false
|
64
|
-
CACHE_DIR = ".cache/local_search"
|
65
|
-
</pre>
|
66
|
-
</div>
|
67
|
-
</div>
|
68
|
-
</div>
|
69
|
-
</main>
|
70
|
-
</div>
|
71
|
-
|
72
|
-
<script>
|
73
|
-
function openFileLocation(filePath) {
|
74
|
-
// Create a hidden form and submit it to a route that will open the file location
|
75
|
-
const form = document.createElement('form');
|
76
|
-
form.method = 'POST';
|
77
|
-
form.action = "{{ url_for('research.open_file_location') }}";
|
78
|
-
|
79
|
-
const input = document.createElement('input');
|
80
|
-
input.type = 'hidden';
|
81
|
-
input.name = 'file_path';
|
82
|
-
input.value = filePath;
|
83
|
-
|
84
|
-
form.appendChild(input);
|
85
|
-
document.body.appendChild(form);
|
86
|
-
form.submit();
|
87
|
-
}
|
88
|
-
</script>
|
89
|
-
</body>
|
90
|
-
</html>
|
@@ -1,348 +0,0 @@
|
|
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</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
|
-
<!-- Change to CDN version that works in browsers -->
|
10
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/github-dark.min.css">
|
11
|
-
</head>
|
12
|
-
<body>
|
13
|
-
<div class="app-container">
|
14
|
-
<!-- Sidebar -->
|
15
|
-
<aside class="sidebar">
|
16
|
-
<div class="sidebar-header">
|
17
|
-
<h2 id="logo-link" style="cursor: pointer;"><i class="fas fa-atom"></i> Deep Research</h2>
|
18
|
-
</div>
|
19
|
-
<nav class="sidebar-nav">
|
20
|
-
<ul>
|
21
|
-
<li class="active" data-page="new-research"><i class="fas fa-search"></i> New Research</li>
|
22
|
-
<li data-page="history"><i class="fas fa-history"></i> History</li>
|
23
|
-
<li data-page="settings"><i class="fas fa-cog"></i> <a href="{{ url_for('research.settings_page') }}">Settings</a></li>
|
24
|
-
</ul>
|
25
|
-
</nav>
|
26
|
-
<div class="sidebar-footer">
|
27
|
-
<p>v0.1.0 | <i class="fas fa-brain"></i></p>
|
28
|
-
</div>
|
29
|
-
</aside>
|
30
|
-
|
31
|
-
<!-- Main Content -->
|
32
|
-
<main class="main-content">
|
33
|
-
<!-- New Research Page -->
|
34
|
-
<div class="page active" id="new-research">
|
35
|
-
<div class="page-header">
|
36
|
-
<h1>Start New Research</h1>
|
37
|
-
</div>
|
38
|
-
<div class="card research-card">
|
39
|
-
<div class="card-content">
|
40
|
-
<form id="research-form">
|
41
|
-
<div class="form-group">
|
42
|
-
<label for="query">Research Query</label>
|
43
|
-
<textarea id="query" name="query" rows="3" placeholder="Enter your research topic or question..."></textarea>
|
44
|
-
</div>
|
45
|
-
<div class="form-group">
|
46
|
-
<label>Research Mode</label>
|
47
|
-
<div class="mode-selection">
|
48
|
-
<div class="mode-option active" data-mode="quick">
|
49
|
-
<div class="mode-icon"><i class="fas fa-bolt"></i></div>
|
50
|
-
<div class="mode-info">
|
51
|
-
<h3>Quick Summary</h3>
|
52
|
-
<p>Generated in a few minutes</p>
|
53
|
-
</div>
|
54
|
-
</div>
|
55
|
-
<div class="mode-option" data-mode="detailed">
|
56
|
-
<div class="mode-icon"><i class="fas fa-microscope"></i></div>
|
57
|
-
<div class="mode-info">
|
58
|
-
<h3>Detailed Report</h3>
|
59
|
-
<p>In-depth analysis (takes longer)</p>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
</div>
|
63
|
-
</div>
|
64
|
-
<div class="form-options">
|
65
|
-
<div class="form-option">
|
66
|
-
<label for="notification-toggle" class="checkbox-label">
|
67
|
-
<input type="checkbox" id="notification-toggle" checked>
|
68
|
-
<span class="checkbox-text">Sound notifications when complete</span>
|
69
|
-
</label>
|
70
|
-
</div>
|
71
|
-
</div>
|
72
|
-
<div class="form-actions">
|
73
|
-
<button type="submit" class="btn btn-primary" id="start-research-btn"><i class="fas fa-rocket"></i> Start Research</button>
|
74
|
-
</div>
|
75
|
-
</form>
|
76
|
-
</div>
|
77
|
-
</div>
|
78
|
-
</div>
|
79
|
-
|
80
|
-
<!-- History Page -->
|
81
|
-
<div class="page" id="history">
|
82
|
-
<div class="page-header">
|
83
|
-
<h1>Research History</h1>
|
84
|
-
</div>
|
85
|
-
<div class="card">
|
86
|
-
<div class="card-content">
|
87
|
-
<div class="history-list" id="history-list">
|
88
|
-
<!-- Will be populated dynamically -->
|
89
|
-
<div class="loading-spinner centered">
|
90
|
-
<div class="spinner"></div>
|
91
|
-
</div>
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
</div>
|
95
|
-
</div>
|
96
|
-
|
97
|
-
<!-- Research Progress Page -->
|
98
|
-
<div class="page" id="research-progress">
|
99
|
-
<div class="page-header">
|
100
|
-
<h1>Research in Progress</h1>
|
101
|
-
</div>
|
102
|
-
<div class="card">
|
103
|
-
<div class="card-content">
|
104
|
-
<div class="progress-info">
|
105
|
-
<div class="current-query-container">
|
106
|
-
<div class="current-query-label">Current Query:</div>
|
107
|
-
<div id="current-query" class="current-query"></div>
|
108
|
-
</div>
|
109
|
-
<div class="progress-container">
|
110
|
-
<div class="progress-bar">
|
111
|
-
<div id="progress-fill" class="progress-fill"></div>
|
112
|
-
</div>
|
113
|
-
<div id="progress-percentage" class="progress-percentage">0%</div>
|
114
|
-
</div>
|
115
|
-
<div id="progress-status" class="progress-status">Initializing research process...</div>
|
116
|
-
<div class="progress-actions">
|
117
|
-
<button id="terminate-research-btn" class="btn btn-outline terminate-btn" style="display: none;">
|
118
|
-
<i class="fas fa-stop-circle"></i> Terminate Research
|
119
|
-
</button>
|
120
|
-
<div id="error-message" class="error-message" style="display: none;"></div>
|
121
|
-
<button id="try-again-btn" class="btn btn-primary" style="display: none; margin-top: 15px;">
|
122
|
-
<i class="fas fa-redo"></i> Try Again
|
123
|
-
</button>
|
124
|
-
</div>
|
125
|
-
</div>
|
126
|
-
</div>
|
127
|
-
</div>
|
128
|
-
</div>
|
129
|
-
|
130
|
-
<!-- Research Details Page -->
|
131
|
-
<div class="page" id="research-details">
|
132
|
-
<div class="page-header">
|
133
|
-
<div class="results-header">
|
134
|
-
<h1>Research Details</h1>
|
135
|
-
<div class="results-actions">
|
136
|
-
<button class="btn btn-outline" id="back-to-history-from-details"><i class="fas fa-arrow-left"></i> Back to History</button>
|
137
|
-
</div>
|
138
|
-
</div>
|
139
|
-
</div>
|
140
|
-
<div class="card">
|
141
|
-
<div class="card-content">
|
142
|
-
<div class="research-metadata">
|
143
|
-
<div class="metadata-item">
|
144
|
-
<span class="metadata-label">Query:</span>
|
145
|
-
<span id="detail-query" class="metadata-value"></span>
|
146
|
-
</div>
|
147
|
-
<div class="metadata-item">
|
148
|
-
<span class="metadata-label">Status:</span>
|
149
|
-
<span id="detail-status" class="metadata-value"></span>
|
150
|
-
</div>
|
151
|
-
<div class="metadata-item">
|
152
|
-
<span class="metadata-label">Mode:</span>
|
153
|
-
<span id="detail-mode" class="metadata-value"></span>
|
154
|
-
</div>
|
155
|
-
<div class="metadata-item">
|
156
|
-
<span class="metadata-label">Progress:</span>
|
157
|
-
<div class="detail-progress-container">
|
158
|
-
<div class="detail-progress-bar">
|
159
|
-
<div class="detail-progress-fill" id="detail-progress-fill"></div>
|
160
|
-
</div>
|
161
|
-
<span id="detail-progress-percentage">0%</span>
|
162
|
-
</div>
|
163
|
-
</div>
|
164
|
-
</div>
|
165
|
-
|
166
|
-
<div class="research-log-container">
|
167
|
-
<h3>Research Progress Log</h3>
|
168
|
-
<div class="research-log" id="research-log">
|
169
|
-
<!-- Will be populated dynamically -->
|
170
|
-
<div class="loading-spinner centered">
|
171
|
-
<div class="spinner"></div>
|
172
|
-
</div>
|
173
|
-
</div>
|
174
|
-
</div>
|
175
|
-
|
176
|
-
<div class="detail-actions" id="detail-actions">
|
177
|
-
<!-- Conditionally shown based on research status -->
|
178
|
-
</div>
|
179
|
-
</div>
|
180
|
-
</div>
|
181
|
-
</div>
|
182
|
-
|
183
|
-
<!-- Research Results Page -->
|
184
|
-
<div class="page" id="research-results">
|
185
|
-
<div class="page-header">
|
186
|
-
<div class="results-header">
|
187
|
-
<h1>Research Results</h1>
|
188
|
-
<div class="results-actions">
|
189
|
-
<button class="btn btn-outline" id="download-pdf-btn"><i class="fas fa-file-pdf"></i> Download PDF</button>
|
190
|
-
<button class="btn btn-outline" id="back-to-history"><i class="fas fa-arrow-left"></i> Back to History</button>
|
191
|
-
</div>
|
192
|
-
</div>
|
193
|
-
</div>
|
194
|
-
<div class="card results-card">
|
195
|
-
<div class="card-content">
|
196
|
-
<div class="results-metadata">
|
197
|
-
<div class="metadata-item">
|
198
|
-
<span class="metadata-label">Query:</span>
|
199
|
-
<span id="result-query" class="metadata-value"></span>
|
200
|
-
</div>
|
201
|
-
<div class="metadata-item">
|
202
|
-
<span class="metadata-label">Generated:</span>
|
203
|
-
<span id="result-date" class="metadata-value"></span>
|
204
|
-
</div>
|
205
|
-
<div class="metadata-item">
|
206
|
-
<span class="metadata-label">Mode:</span>
|
207
|
-
<span id="result-mode" class="metadata-value"></span>
|
208
|
-
</div>
|
209
|
-
</div>
|
210
|
-
<div class="results-content" id="results-content">
|
211
|
-
<!-- Will be populated dynamically -->
|
212
|
-
<div class="loading-spinner centered">
|
213
|
-
<div class="spinner"></div>
|
214
|
-
</div>
|
215
|
-
</div>
|
216
|
-
</div>
|
217
|
-
</div>
|
218
|
-
</div>
|
219
|
-
|
220
|
-
<!-- Collapsible Log Panel -->
|
221
|
-
<div class="collapsible-log-panel">
|
222
|
-
<div class="log-panel-header" id="log-panel-toggle">
|
223
|
-
<i class="fas fa-chevron-down toggle-icon"></i>
|
224
|
-
<span>Research Logs</span>
|
225
|
-
<span class="log-indicator" id="log-indicator">0</span>
|
226
|
-
</div>
|
227
|
-
<div class="log-panel-content" id="log-panel-content">
|
228
|
-
<div class="log-controls">
|
229
|
-
<div class="log-filter">
|
230
|
-
<div class="filter-buttons">
|
231
|
-
<button class="small-btn selected" onclick="window.filterLogsByType('all')">All</button>
|
232
|
-
<button class="small-btn" onclick="window.filterLogsByType('milestone')">Milestones</button>
|
233
|
-
<button class="small-btn" onclick="window.filterLogsByType('info')">Info</button>
|
234
|
-
<button class="small-btn" onclick="window.filterLogsByType('error')">Errors</button>
|
235
|
-
</div>
|
236
|
-
</div>
|
237
|
-
</div>
|
238
|
-
<div class="console-log" id="console-log-container">
|
239
|
-
<!-- Logs will be added here dynamically -->
|
240
|
-
<div class="empty-log-message">No logs yet. Research logs will appear here as they occur.</div>
|
241
|
-
</div>
|
242
|
-
</div>
|
243
|
-
</div>
|
244
|
-
</main>
|
245
|
-
</div>
|
246
|
-
|
247
|
-
<!-- Templates -->
|
248
|
-
<template id="history-item-template">
|
249
|
-
<div class="history-item">
|
250
|
-
<div class="history-item-header">
|
251
|
-
<div class="history-item-title"></div>
|
252
|
-
<div class="history-item-status"></div>
|
253
|
-
</div>
|
254
|
-
<div class="history-item-meta">
|
255
|
-
<div class="history-item-date"></div>
|
256
|
-
<div class="history-item-mode"></div>
|
257
|
-
</div>
|
258
|
-
<div class="history-item-actions">
|
259
|
-
<button class="btn btn-sm btn-outline view-btn"><i class="fas fa-eye"></i> View</button>
|
260
|
-
<button class="btn btn-sm btn-outline pdf-btn" style="display: none;"><i class="fas fa-file-pdf"></i> PDF</button>
|
261
|
-
<!-- Delete button will be added dynamically -->
|
262
|
-
</div>
|
263
|
-
</div>
|
264
|
-
</template>
|
265
|
-
|
266
|
-
<!-- Mobile Tab Bar -->
|
267
|
-
<nav class="mobile-tab-bar">
|
268
|
-
<ul>
|
269
|
-
<li class="active" data-page="new-research">
|
270
|
-
<i class="fas fa-search"></i>
|
271
|
-
<span>Research</span>
|
272
|
-
</li>
|
273
|
-
<li data-page="history">
|
274
|
-
<i class="fas fa-history"></i>
|
275
|
-
<span>History</span>
|
276
|
-
</li>
|
277
|
-
<li data-page="settings">
|
278
|
-
<a href="{{ url_for('research.settings_page') }}">
|
279
|
-
<i class="fas fa-cog"></i>
|
280
|
-
<span>Settings</span>
|
281
|
-
</a>
|
282
|
-
</li>
|
283
|
-
</ul>
|
284
|
-
</nav>
|
285
|
-
|
286
|
-
<template id="log-entry-template">
|
287
|
-
<div class="log-entry">
|
288
|
-
<div class="log-entry-time"></div>
|
289
|
-
<div class="log-entry-content">
|
290
|
-
<div class="log-entry-message"></div>
|
291
|
-
<div class="log-entry-progress"></div>
|
292
|
-
</div>
|
293
|
-
</div>
|
294
|
-
</template>
|
295
|
-
|
296
|
-
<!-- Updated Scripts with proper CDN versions -->
|
297
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.4.1/socket.io.min.js"></script>
|
298
|
-
<script src="https://cdn.jsdelivr.net/npm/marked@4.3.0/lib/marked.umd.min.js"></script>
|
299
|
-
<!-- Update highlight.js to browser compatible version -->
|
300
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
|
301
|
-
<!-- PDF generation libraries -->
|
302
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
|
303
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js" integrity="sha512-BNaRQnYJYiPSqHHDb58B0yaPfCu+Wgds8Gp/gU33kqBtgNS4tSPHuGibyoeqMV/TJlSKda6FXzoEyYGjTe+vXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
304
|
-
<script src="{{ url_for('research.serve_static', path='js/app.js') }}"></script>
|
305
|
-
<script>
|
306
|
-
document.addEventListener('DOMContentLoaded', function() {
|
307
|
-
// Initialize the terminate button event listener
|
308
|
-
const terminateBtn = document.getElementById('terminate-research-btn');
|
309
|
-
if (terminateBtn) {
|
310
|
-
terminateBtn.addEventListener('click', function() {
|
311
|
-
// Get the current research ID from the page
|
312
|
-
const currentResearchId = window.currentResearchId;
|
313
|
-
if (currentResearchId) {
|
314
|
-
window.terminateResearch(currentResearchId);
|
315
|
-
} else {
|
316
|
-
console.error('No active research ID found');
|
317
|
-
alert('No active research found to terminate');
|
318
|
-
}
|
319
|
-
});
|
320
|
-
}
|
321
|
-
});
|
322
|
-
|
323
|
-
// Configure marked to not use eval
|
324
|
-
if (typeof marked !== 'undefined') {
|
325
|
-
marked.setOptions({
|
326
|
-
headerIds: false,
|
327
|
-
mangle: false,
|
328
|
-
smartypants: false
|
329
|
-
});
|
330
|
-
}
|
331
|
-
|
332
|
-
// Configure html2canvas to avoid using eval if possible
|
333
|
-
if (typeof html2canvas !== 'undefined') {
|
334
|
-
// Disable features that might use eval
|
335
|
-
window.html2canvas_noSandbox = true;
|
336
|
-
}
|
337
|
-
</script>
|
338
|
-
|
339
|
-
<!-- Add a template for console log entries -->
|
340
|
-
<template id="console-log-entry-template">
|
341
|
-
<div class="console-log-entry">
|
342
|
-
<span class="log-timestamp"></span>
|
343
|
-
<span class="log-badge"></span>
|
344
|
-
<span class="log-message"></span>
|
345
|
-
</div>
|
346
|
-
</template>
|
347
|
-
</body>
|
348
|
-
</html>
|
@@ -1,120 +0,0 @@
|
|
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 - LLM 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="llm-settings">
|
21
|
-
<div class="page-header">
|
22
|
-
<div class="results-header">
|
23
|
-
<h1>Language Model 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>LLM Configuration File</h2>
|
35
|
-
<p>To edit your LLM configuration, open this file with your preferred text editor:</p>
|
36
|
-
<div class="file-path">{{ llm_file_path }}</div>
|
37
|
-
|
38
|
-
<button onclick="openFileLocation('{{ llm_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
|
-
"""
|
45
|
-
LLM configuration for Local Deep Research.
|
46
|
-
|
47
|
-
This file is loaded as a Python module, allowing for complex
|
48
|
-
customization of LLM behavior.
|
49
|
-
"""
|
50
|
-
|
51
|
-
# Default model settings
|
52
|
-
DEFAULT_MODEL = "mistral"
|
53
|
-
DEFAULT_MODEL_TYPE = "ollama" # Options: ollama, openai, anthropic
|
54
|
-
DEFAULT_TEMPERATURE = 0.7
|
55
|
-
MAX_TOKENS = 30000
|
56
|
-
|
57
|
-
# API keys and endpoints (consider using environment variables instead)
|
58
|
-
USE_OPENAI_ENDPOINT = False
|
59
|
-
OPENAI_ENDPOINT_URL = "https://openrouter.ai/api/v1"
|
60
|
-
OPENAI_ENDPOINT_REQUIRES_MODEL = True
|
61
|
-
|
62
|
-
# Custom model loading function
|
63
|
-
def get_llm(model_name=None, model_type=None, temperature=None, **kwargs):
|
64
|
-
"""
|
65
|
-
Get a language model instance.
|
66
|
-
|
67
|
-
Args:
|
68
|
-
model_name: Name of the model to use
|
69
|
-
model_type: Type of model provider
|
70
|
-
temperature: Model temperature
|
71
|
-
**kwargs: Additional parameters
|
72
|
-
|
73
|
-
Returns:
|
74
|
-
A LangChain language model instance
|
75
|
-
"""
|
76
|
-
# Use defaults if not provided
|
77
|
-
model_name = model_name or DEFAULT_MODEL
|
78
|
-
model_type = model_type or DEFAULT_MODEL_TYPE
|
79
|
-
temperature = temperature or DEFAULT_TEMPERATURE
|
80
|
-
|
81
|
-
# If using Ollama
|
82
|
-
if model_type == "ollama":
|
83
|
-
from langchain_ollama import ChatOllama
|
84
|
-
return ChatOllama(
|
85
|
-
model=model_name,
|
86
|
-
temperature=temperature,
|
87
|
-
**kwargs
|
88
|
-
)
|
89
|
-
|
90
|
-
# Default fallback
|
91
|
-
from langchain_ollama import ChatOllama
|
92
|
-
return ChatOllama(
|
93
|
-
model="mistral",
|
94
|
-
temperature=0.7,
|
95
|
-
**kwargs
|
96
|
-
)
|
97
|
-
</pre>
|
98
|
-
</div>
|
99
|
-
</div>
|
100
|
-
</div>
|
101
|
-
</main>
|
102
|
-
</div>
|
103
|
-
|
104
|
-
<script>
|
105
|
-
function openFileLocation(path) {
|
106
|
-
fetch('/research/open_file_location', {
|
107
|
-
method: 'POST',
|
108
|
-
headers: {
|
109
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
110
|
-
},
|
111
|
-
body: 'file_path=' + encodeURIComponent(path)
|
112
|
-
})
|
113
|
-
.then(response => {
|
114
|
-
// Handle response
|
115
|
-
})
|
116
|
-
.catch(error => console.error('Error:', error));
|
117
|
-
}
|
118
|
-
</script>
|
119
|
-
</body>
|
120
|
-
</html>
|