LukasBe commited on
Commit
6b7f862
·
verified ·
1 Parent(s): 5193b56

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +525 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Math Research Assistant
3
- emoji: 😻
4
- colorFrom: blue
5
- colorTo: indigo
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: math-research-assistant
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: green
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,525 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Mathematical Research Paper Drafting Assistant</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <script src="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.js"></script>
10
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css">
11
+ <script src="https://cdn.jsdelivr.net/npm/highlight.js@11.7.0/lib/core.min.js"></script>
12
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@11.7.0/styles/github.min.css">
13
+ <style>
14
+ .katex-display {
15
+ margin: 1em 0;
16
+ padding: 1em;
17
+ background-color: #f8f9fa;
18
+ border-radius: 0.5rem;
19
+ }
20
+ .latex-preview {
21
+ min-height: 200px;
22
+ border: 1px solid #e5e7eb;
23
+ border-radius: 0.5rem;
24
+ padding: 1rem;
25
+ background-color: white;
26
+ }
27
+ .hljs {
28
+ background-color: #f8f9fa;
29
+ border-radius: 0.5rem;
30
+ padding: 1rem;
31
+ }
32
+ .sidebar-item {
33
+ transition: all 0.2s ease;
34
+ }
35
+ .sidebar-item:hover {
36
+ background-color: #f3f4f6;
37
+ }
38
+ .sidebar-item.active {
39
+ background-color: #e5e7eb;
40
+ border-left: 4px solid #3b82f6;
41
+ }
42
+ .progress-step {
43
+ position: relative;
44
+ }
45
+ .progress-step:not(:last-child):after {
46
+ content: '';
47
+ position: absolute;
48
+ top: 20px;
49
+ left: 50%;
50
+ height: 2px;
51
+ width: 100%;
52
+ background-color: #d1d5db;
53
+ z-index: 0;
54
+ }
55
+ .progress-step.active:not(:last-child):after {
56
+ background-color: #3b82f6;
57
+ }
58
+ .progress-step.completed:not(:last-child):after {
59
+ background-color: #3b82f6;
60
+ }
61
+ .progress-step.completed .step-icon {
62
+ background-color: #10b981;
63
+ border-color: #10b981;
64
+ color: white;
65
+ }
66
+ .progress-step.active .step-icon {
67
+ background-color: #3b82f6;
68
+ border-color: #3b82f6;
69
+ color: white;
70
+ }
71
+ .ai-response {
72
+ position: relative;
73
+ }
74
+ .ai-response:before {
75
+ content: '';
76
+ position: absolute;
77
+ top: 0;
78
+ left: 0;
79
+ width: 4px;
80
+ height: 100%;
81
+ background-color: #3b82f6;
82
+ border-radius: 4px 0 0 4px;
83
+ }
84
+ .user-input {
85
+ position: relative;
86
+ }
87
+ .user-input:before {
88
+ content: '';
89
+ position: absolute;
90
+ top: 0;
91
+ left: 0;
92
+ width: 4px;
93
+ height: 100%;
94
+ background-color: #10b981;
95
+ border-radius: 4px 0 0 4px;
96
+ }
97
+ .feedback-panel {
98
+ position: relative;
99
+ }
100
+ .feedback-panel:before {
101
+ content: '';
102
+ position: absolute;
103
+ top: 0;
104
+ left: 0;
105
+ width: 4px;
106
+ height: 100%;
107
+ background-color: #f59e0b;
108
+ border-radius: 4px 0 0 4px;
109
+ }
110
+ .consensus-panel {
111
+ position: relative;
112
+ }
113
+ .consensus-panel:before {
114
+ content: '';
115
+ position: absolute;
116
+ top: 0;
117
+ left: 0;
118
+ width: 4px;
119
+ height: 100%;
120
+ background-color: #8b5cf6;
121
+ border-radius: 4px 0 0 4px;
122
+ }
123
+ .split-view {
124
+ display: grid;
125
+ grid-template-columns: 1fr 1fr;
126
+ gap: 1rem;
127
+ }
128
+ @media (max-width: 768px) {
129
+ .split-view {
130
+ grid-template-columns: 1fr;
131
+ }
132
+ }
133
+ </style>
134
+ </head>
135
+ <body class="bg-gray-50 min-h-screen">
136
+ <div class="flex flex-col min-h-screen">
137
+ <!-- Header -->
138
+ <header class="bg-white shadow-sm py-4 px-6">
139
+ <div class="flex justify-between items-center">
140
+ <h1 class="text-2xl font-bold text-gray-800">
141
+ <i class="fas fa-square-root-alt text-blue-500 mr-2"></i>
142
+ Math Research Assistant
143
+ </h1>
144
+ <div class="flex items-center space-x-4">
145
+ <button id="apiKeysBtn" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium">
146
+ <i class="fas fa-key mr-2"></i>API Keys
147
+ </button>
148
+ <button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium">
149
+ <i class="fas fa-download mr-2"></i>Export
150
+ </button>
151
+ </div>
152
+ </div>
153
+ </header>
154
+
155
+ <!-- Main Content -->
156
+ <div class="flex flex-1 overflow-hidden">
157
+ <!-- Sidebar -->
158
+ <div class="w-64 bg-white border-r border-gray-200 overflow-y-auto">
159
+ <div class="p-4">
160
+ <h2 class="font-semibold text-gray-700 mb-2">Project History</h2>
161
+ <div class="space-y-1" id="historySidebar">
162
+ <!-- History items will be added here dynamically -->
163
+ </div>
164
+ </div>
165
+ </div>
166
+
167
+ <!-- Main Panel -->
168
+ <div class="flex-1 overflow-y-auto p-6">
169
+ <!-- Progress Bar -->
170
+ <div class="bg-white rounded-lg shadow-sm p-4 mb-6">
171
+ <div class="flex justify-between items-center mb-4">
172
+ <h2 class="text-lg font-semibold text-gray-800">Research Paper Drafting Progress</h2>
173
+ <div class="flex items-center space-x-2">
174
+ <span class="text-sm text-gray-500" id="currentStage">Idea Generation</span>
175
+ <span class="text-sm font-medium text-blue-600">Step 1 of 8</span>
176
+ </div>
177
+ </div>
178
+ <div class="flex justify-between relative">
179
+ <div class="progress-step completed" data-step="1">
180
+ <div class="flex flex-col items-center">
181
+ <div class="step-icon w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center mb-1 bg-white z-10">
182
+ <i class="fas fa-lightbulb text-gray-400"></i>
183
+ </div>
184
+ <span class="text-xs font-medium text-gray-700">Idea Gen</span>
185
+ </div>
186
+ </div>
187
+ <div class="progress-step completed" data-step="2">
188
+ <div class="flex flex-col items-center">
189
+ <div class="step-icon w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center mb-1 bg-white z-10">
190
+ <i class="fas fa-seedling text-gray-400"></i>
191
+ </div>
192
+ <span class="text-xs font-medium text-gray-700">Development</span>
193
+ </div>
194
+ </div>
195
+ <div class="progress-step completed" data-step="3">
196
+ <div class="flex flex-col items-center">
197
+ <div class="step-icon w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center mb-1 bg-white z-10">
198
+ <i class="fas fa-comment-medical text-gray-400"></i>
199
+ </div>
200
+ <span class="text-xs font-medium text-gray-700">First Critique</span>
201
+ </div>
202
+ </div>
203
+ <div class="progress-step active" data-step="4">
204
+ <div class="flex flex-col items-center">
205
+ <div class="step-icon w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center mb-1 bg-white z-10">
206
+ <i class="fas fa-sync-alt text-gray-400"></i>
207
+ </div>
208
+ <span class="text-xs font-medium text-gray-700">Refinement</span>
209
+ </div>
210
+ </div>
211
+ <div class="progress-step" data-step="5">
212
+ <div class="flex flex-col items-center">
213
+ <div class="step-icon w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center mb-1 bg-white z-10">
214
+ <i class="fas fa-search text-gray-400"></i>
215
+ </div>
216
+ <span class="text-xs font-medium text-gray-700">Deep Critique</span>
217
+ </div>
218
+ </div>
219
+ <div class="progress-step" data-step="6">
220
+ <div class="flex flex-col items-center">
221
+ <div class="step-icon w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center mb-1 bg-white z-10">
222
+ <i class="fas fa-handshake text-gray-400"></i>
223
+ </div>
224
+ <span class="text-xs font-medium text-gray-700">Consensus</span>
225
+ </div>
226
+ </div>
227
+ <div class="progress-step" data-step="7">
228
+ <div class="flex flex-col items-center">
229
+ <div class="step-icon w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center mb-1 bg-white z-10">
230
+ <i class="fas fa-list-ol text-gray-400"></i>
231
+ </div>
232
+ <span class="text-xs font-medium text-gray-700">Outline</span>
233
+ </div>
234
+ </div>
235
+ <div class="progress-step" data-step="8">
236
+ <div class="flex flex-col items-center">
237
+ <div class="step-icon w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center mb-1 bg-white z-10">
238
+ <i class="fas fa-file-alt text-gray-400"></i>
239
+ </div>
240
+ <span class="text-xs font-medium text-gray-700">LaTeX Draft</span>
241
+ </div>
242
+ </div>
243
+ </div>
244
+ </div>
245
+
246
+ <!-- Current Stage Content -->
247
+ <div id="stageContent">
248
+ <!-- Iterative Refinement Stage (Default shown) -->
249
+ <div class="stage-panel" id="refinementStage">
250
+ <div class="bg-white rounded-lg shadow-sm overflow-hidden mb-6">
251
+ <div class="px-6 py-4 border-b border-gray-200">
252
+ <h3 class="text-lg font-medium text-gray-900">
253
+ <i class="fas fa-sync-alt text-blue-500 mr-2"></i>
254
+ Iterative Refinement
255
+ </h3>
256
+ <p class="text-sm text-gray-500 mt-1">Review and refine your research idea based on feedback from Gemini.</p>
257
+ </div>
258
+ <div class="p-6">
259
+ <div class="split-view">
260
+ <!-- GPT Input/Output -->
261
+ <div class="space-y-4">
262
+ <div class="user-input bg-white rounded-lg border border-gray-200 p-4">
263
+ <div class="flex justify-between items-center mb-2">
264
+ <span class="text-xs font-semibold text-green-600 bg-green-50 px-2 py-1 rounded">USER INPUT</span>
265
+ <div class="flex space-x-2">
266
+ <button class="text-xs text-gray-500 hover:text-gray-700">
267
+ <i class="fas fa-edit"></i>
268
+ </button>
269
+ </div>
270
+ </div>
271
+ <div class="prose max-w-none text-sm text-gray-700">
272
+ <p>Develop a framework for applying sheaf theory to distributed optimization problems, with particular focus on consensus algorithms in multi-agent systems.</p>
273
+ </div>
274
+ </div>
275
+ <div class="ai-response bg-white rounded-lg border border-gray-200 p-4">
276
+ <div class="flex justify-between items-center mb-2">
277
+ <span class="text-xs font-semibold text-blue-600 bg-blue-50 px-2 py-1 rounded">GPT-4 RESPONSE</span>
278
+ <div class="flex space-x-2">
279
+ <button class="text-xs text-gray-500 hover:text-gray-700">
280
+ <i class="fas fa-copy"></i>
281
+ </button>
282
+ </div>
283
+ </div>
284
+ <div class="prose max-w-none text-sm text-gray-700">
285
+ <p>The proposed framework leverages sheaf theory to model information flow in distributed systems. Key components:</p>
286
+ <ol class="list-decimal pl-5 space-y-1">
287
+ <li>Represent agents as stalks in a sheaf</li>
288
+ <li>Define restriction maps to capture local communication constraints</li>
289
+ <li>Use global sections to identify consensus states</li>
290
+ <li>Obstruction cocycles detect inconsistencies in distributed knowledge</li>
291
+ </ol>
292
+ <p>This provides a topological perspective on convergence properties.</p>
293
+ </div>
294
+ </div>
295
+ </div>
296
+
297
+ <!-- Gemini Feedback -->
298
+ <div class="space-y-4">
299
+ <div class="feedback-panel bg-white rounded-lg border border-gray-200 p-4">
300
+ <div class="flex justify-between items-center mb-2">
301
+ <span class="text-xs font-semibold text-yellow-600 bg-yellow-50 px-2 py-1 rounded">GEMINI FEEDBACK</span>
302
+ <div class="flex space-x-2">
303
+ <button class="text-xs text-gray-500 hover:text-gray-700">
304
+ <i class="fas fa-copy"></i>
305
+ </button>
306
+ </div>
307
+ </div>
308
+ <div class="prose max-w-none text-sm text-gray-700">
309
+ <p class="font-medium">Critical Issues Identified:</p>
310
+ <ul class="list-disc pl-5 space-y-1">
311
+ <li>The assumption about global sections existing is too strong for most practical distributed systems</li>
312
+ <li>Obstruction cocycle definition is incomplete without specifying coefficient sheaf</li>
313
+ <li>No consideration of dynamic topology changes</li>
314
+ </ul>
315
+ <p class="font-medium mt-2">Suggestions:</p>
316
+ <ul class="list-disc pl-5 space-y-1">
317
+ <li>Consider using sheaf cohomology with compact support</li>
318
+ <li>Explicitly define the coefficient sheaf (e.g., constant sheaf of ℝ)</li>
319
+ <li>Add time parameter to handle dynamic networks</li>
320
+ </ul>
321
+ </div>
322
+ </div>
323
+
324
+ <!-- Editable Response Area -->
325
+ <div class="bg-white rounded-lg border border-gray-200">
326
+ <div class="px-4 py-3 border-b border-gray-200">
327
+ <span class="text-xs font-semibold text-gray-600">REVISE YOUR IDEA</span>
328
+ </div>
329
+ <textarea class="w-full p-4 text-sm text-gray-700 focus:outline-none min-h-[150px]" placeholder="Incorporate feedback and refine your research idea here...">The framework applies sheaf theory to distributed optimization, with these improvements:
330
+ 1. Agents modeled as stalks with time-dependent restriction maps
331
+ 2. Sheaf cohomology with compact support to analyze convergence
332
+ 3. Constant sheaf of ℝ for obstruction cocycle calculations
333
+ 4. Dynamic topology handled via parameterized sheaves</textarea>
334
+ </div>
335
+ </div>
336
+ </div>
337
+
338
+ <!-- Iteration Controls -->
339
+ <div class="flex justify-between mt-6">
340
+ <div class="flex space-x-2">
341
+ <button class="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium">
342
+ <i class="fas fa-redo mr-2"></i>Restart Step
343
+ </button>
344
+ <button class="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium">
345
+ <i class="fas fa-history mr-2"></i>View Previous
346
+ </button>
347
+ </div>
348
+ <div class="flex space-x-2">
349
+ <button class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium">
350
+ <i class="fas fa-sync-alt mr-2"></i>Refine Again
351
+ </button>
352
+ <button class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium" id="nextStageBtn">
353
+ <i class="fas fa-arrow-right mr-2"></i>Next Stage
354
+ </button>
355
+ </div>
356
+ </div>
357
+ </div>
358
+ </div>
359
+
360
+ <!-- Convergence Indicator -->
361
+ <div class="bg-white rounded-lg shadow-sm overflow-hidden">
362
+ <div class="px-6 py-4 border-b border-gray-200">
363
+ <h3 class="text-lg font-medium text-gray-900">
364
+ <i class="fas fa-chart-line text-blue-500 mr-2"></i>
365
+ Convergence Indicator
366
+ </h3>
367
+ </div>
368
+ <div class="p-6">
369
+ <div class="flex items-center">
370
+ <div class="w-full bg-gray-200 rounded-full h-4">
371
+ <div class="bg-blue-600 h-4 rounded-full" style="width: 75%"></div>
372
+ </div>
373
+ <span class="ml-4 text-sm font-medium text-gray-700">75% Converged</span>
374
+ </div>
375
+ <p class="text-sm text-gray-500 mt-2">After 3 iterations, the feedback from Gemini is becoming more consistent with fewer new issues identified.</p>
376
+ </div>
377
+ </div>
378
+ </div>
379
+
380
+ <!-- Other stages (hidden by default) -->
381
+ <div class="stage-panel hidden" id="deepCritiqueStage">
382
+ <!-- Deep Critique content would go here -->
383
+ </div>
384
+
385
+ <div class="stage-panel hidden" id="consensusStage">
386
+ <!-- Consensus content would go here -->
387
+ </div>
388
+ </div>
389
+ </div>
390
+ </div>
391
+ </div>
392
+
393
+ <!-- API Keys Modal -->
394
+ <div id="apiKeysModal" class="fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center hidden z-50">
395
+ <div class="bg-white rounded-lg shadow-xl max-w-md w-full">
396
+ <div class="px-6 py-4 border-b border-gray-200">
397
+ <h3 class="text-lg font-medium text-gray-900">
398
+ <i class="fas fa-key mr-2 text-blue-500"></i>
399
+ API Key Management
400
+ </h3>
401
+ </div>
402
+ <div class="p-6">
403
+ <div class="space-y-4">
404
+ <div>
405
+ <label class="block text-sm font-medium text-gray-700 mb-1">OpenAI API Key</label>
406
+ <input type="password" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="sk-...">
407
+ </div>
408
+ <div>
409
+ <label class="block text-sm font-medium text-gray-700 mb-1">Gemini API Key</label>
410
+ <input type="password" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="AIza...">
411
+ </div>
412
+ <div>
413
+ <label class="block text-sm font-medium text-gray-700 mb-1">Grok-3 API Key</label>
414
+ <input type="password" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="gk-...">
415
+ </div>
416
+ <div>
417
+ <label class="block text-sm font-medium text-gray-700 mb-1">Claude API Key</label>
418
+ <input type="password" class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500" placeholder="sk-ant-...">
419
+ </div>
420
+ </div>
421
+ <div class="flex justify-end mt-6 space-x-3">
422
+ <button id="cancelApiKeys" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium">
423
+ Cancel
424
+ </button>
425
+ <button id="saveApiKeys" class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium">
426
+ Save Keys
427
+ </button>
428
+ </div>
429
+ </div>
430
+ </div>
431
+ </div>
432
+
433
+ <script>
434
+ // Initialize the app
435
+ document.addEventListener('DOMContentLoaded', function() {
436
+ // Add sample history items
437
+ const historySidebar = document.getElementById('historySidebar');
438
+ const historyItems = [
439
+ { id: 1, title: 'Initial Idea Generation', time: '10:23 AM', active: false },
440
+ { id: 2, title: 'Idea Development', time: '10:35 AM', active: false },
441
+ { id: 3, title: 'First Critique Round', time: '10:52 AM', active: false },
442
+ { id: 4, title: 'Iteration 1 Refinement', time: '11:07 AM', active: false },
443
+ { id: 5, title: 'Iteration 2 Refinement', time: '11:23 AM', active: false },
444
+ { id: 6, title: 'Current Refinement', time: '11:41 AM', active: true }
445
+ ];
446
+
447
+ historyItems.forEach(item => {
448
+ const itemEl = document.createElement('div');
449
+ itemEl.className = `sidebar-item p-3 text-sm cursor-pointer rounded ${item.active ? 'active' : ''}`;
450
+ itemEl.innerHTML = `
451
+ <div class="font-medium text-gray-700">${item.title}</div>
452
+ <div class="text-xs text-gray-500">${item.time}</div>
453
+ `;
454
+ historySidebar.appendChild(itemEl);
455
+ });
456
+
457
+ // API Key Modal Handling
458
+ const apiKeysBtn = document.getElementById('apiKeysBtn');
459
+ const apiKeysModal = document.getElementById('apiKeysModal');
460
+ const cancelApiKeys = document.getElementById('cancelApiKeys');
461
+ const saveApiKeys = document.getElementById('saveApiKeys');
462
+
463
+ apiKeysBtn.addEventListener('click', () => {
464
+ apiKeysModal.classList.remove('hidden');
465
+ });
466
+
467
+ cancelApiKeys.addEventListener('click', () => {
468
+ apiKeysModal.classList.add('hidden');
469
+ });
470
+
471
+ saveApiKeys.addEventListener('click', () => {
472
+ apiKeysModal.classList.add('hidden');
473
+ // In a real app, you would save the API keys securely here
474
+ alert('API keys saved (simulated)');
475
+ });
476
+
477
+ // Next Stage Button
478
+ const nextStageBtn = document.getElementById('nextStageBtn');
479
+ const currentStageEl = document.getElementById('currentStage');
480
+ const refinementStage = document.getElementById('refinementStage');
481
+ const deepCritiqueStage = document.getElementById('deepCritiqueStage');
482
+
483
+ nextStageBtn.addEventListener('click', () => {
484
+ // Update progress steps
485
+ document.querySelector('.progress-step[data-step="4"]').classList.remove('active');
486
+ document.querySelector('.progress-step[data-step="4"]').classList.add('completed');
487
+ document.querySelector('.progress-step[data-step="5"]').classList.add('active');
488
+
489
+ // Update current stage text
490
+ currentStageEl.textContent = 'Deep Critique';
491
+ document.querySelector('.progress-step[data-step="5"] span').textContent = '5/8';
492
+
493
+ // Switch to next stage (in a real app, this would load new content)
494
+ refinementStage.classList.add('hidden');
495
+ deepCritiqueStage.classList.remove('hidden');
496
+
497
+ // Update the next stage button for the new stage
498
+ nextStageBtn.innerHTML = '<i class="fas fa-arrow-right mr-2"></i>Next Stage';
499
+ });
500
+
501
+ // Initialize LaTeX rendering (would be used in later stages)
502
+ function renderLaTeX() {
503
+ const latexElements = document.querySelectorAll('.latex-content');
504
+ latexElements.forEach(el => {
505
+ try {
506
+ katex.render(el.textContent, el, {
507
+ displayMode: true,
508
+ throwOnError: false
509
+ });
510
+ } catch (e) {
511
+ console.error(e);
512
+ }
513
+ });
514
+ }
515
+
516
+ // Initialize syntax highlighting (would be used in later stages)
517
+ function initSyntaxHighlighting() {
518
+ document.querySelectorAll('pre code').forEach((block) => {
519
+ hljs.highlightElement(block);
520
+ });
521
+ }
522
+ });
523
+ </script>
524
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=LukasBe/math-research-assistant" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
525
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ --- ## 2. UI Flow Requirements To support this workflow effectively, the UI must guide the user through each stage with clarity and flexibility. ### 2.1 General UI Principles - **Step Indicator / Progress Bar:** Visualize the current stage (Idea generation, Critique, Iteration, Consensus, Paper drafting). - **Input/Output Panels:** Separate areas for user prompts and AI responses, with clear role labeling. - **Editable Inputs:** Allow users to edit AI outputs before sending to the next stage. - **History Sidebar:** Display past iterations, feedback, and consensus reports for easy reference. - **Iteration Controls:** Buttons for "Send to Next Model," "Revise," "Accept Feedback," and "Restart Step." - **Consensus Summary Panel:** Aggregate feedback from Gemini and Grok-3 for user review. - **LaTeX Preview:** Render LaTeX output dynamically with a library like KaTeX or MathJax. - **Export Options:** Download final LaTeX as `.tex` file. - **API Key Management:** Modal or settings panel for users to input and manage API keys securely. ### 2.2 UI Components per Workflow Stage | Stage | UI Components \& Features | | :-- | :-- | | **Idea Generation (GPT)** | Textarea for initial idea input, "Generate Ideas" button, list of 7 ideas displayed with selection capability. | | **Idea Development (GPT)** | Editable textarea with selected idea, "Develop Idea" button, AI response panel. | | **First Critique (Gemini)** | Feedback panel showing errors and suggestions, editable response area for user to incorporate feedback. | | **Iterative Refinement** | Split view: GPT input/output and Gemini feedback side-by-side, iteration controls, convergence indicator. | | **Deep Critique (Grok-3)** | Display Grok-3’s fundamental critique and alternative suggestions, user can accept or request re-analysis. | | **Consensus Report (Gemini)** | Summary panel showing final consensus, editable for user notes or adjustments. | | **Paper Outline (Claude)** | Outline preview panel, approve/reject buttons, input for style/notation conventions. | | **LaTeX Drafting (Claude)** | LaTeX code viewer with syntax highlighting, live preview, and export button. | --- ## 3. cURL Command Samples for Each Service Below are example cURL commands to interact with each AI service, based on the process. --- ### 3.1 GPT-3.5/4 (OpenAI) - Idea Generation \& Development ```bash curl https://api.openai.com/v1/chat/completions \ -H "Authorization: Bearer YOUR_OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o", "messages": [ { "role": "system", "content": "You are a helpful assistant for mathematical research." }, { "role": "user", "content": "Suggest 7 novel research ideas related to [math research idea X]." } ], "temperature": 0.7 }' ``` **Sample Response (truncated):** ```json { "choices": [ { "message": { "content": "1. Persistent homology in optimization landscapes...\n2. Sheaf-theoretic distributed optimization...\n..." } } ] } ``` --- ### 3.2 Gemini (Google) - Error Detection \& Feedback ```bash curl -X POST \ https://generativelanguage.googleapis.com/v1beta/models/gemini-pro:generateContent \ -H "Authorization: Bearer YOUR_GEMINI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "parts": [ { "text": "Please review the following mathematical research idea for errors:\n[Insert GPT output here]" } ] } ], "generationConfig": { "temperature": 0.2, "maxOutputTokens": 1024 } }' ``` **Sample Response (truncated):** ```json { "candidates": [ { "content": { "parts": [ { "text": "Issues found:\n1. Assumption of global sections is invalid...\n2. Obstruction cocycle definition incomplete..." } ] } } ] } ``` --- ### 3.3 Grok-3 (xAI) - Deep Critique \& Alternative Directions ```bash curl -X POST \ https://api.grok.x/v1/chat/completions \ -H "Authorization: Bearer YOUR_GROK_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "system", "content": "You are a critical mathematical researcher." }, { "role": "user", "content": "Analyze this consensus research report and identify fundamental errors:\n[Detailed report]" } ], "model": "grok-3", "temperature": 0.7 }' ``` **Sample Response:** ```json { "choices": [ { "message": { "content": "Fundamental flaw: obstruction classes are discrete invariants, not continuous. Suggest discrete Morse theory instead." } } ] } ``` --- ### 3.4 Claude (Anthropic) - Paper Outline \& LaTeX Drafting ```bash curl -X POST \ https://api.anthropic.com/v1/messages \ -H "x-api-key: YOUR_CLAUDE_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-3-7-sonnet", "max_tokens": 4000, "messages": [ { "role": "user", "content": "Outline a formal academic paper based on this consensus report:\n[Final consensus report]" } ] }' ``` **Sample Response (Outline):** ```json { "content": [ { "text": "# Paper Outline\n1. Introduction\n2. Preliminaries\n3. Framework\n4. Results\n5. Conclusion\n" } ] } ```