-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
2585 lines (2220 loc) · 109 KB
/
index.html
File metadata and controls
2585 lines (2220 loc) · 109 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Groq AI Desktop - Prompt Engineering Studio</title>
<style>
:root {
--primary: #232D4B;
--accent: #E57200;
--bg-primary: #f8fafc;
--bg-secondary: #ffffff;
--text-primary: #232D4B;
--text-secondary: #4a5568;
--text-muted: #718096;
--border: #e2e8f0;
--border-focus: #E57200;
--success: #48bb78;
--error: #e53e3e;
--warning: #ed8936;
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
--radius-sm: 6px;
--radius-md: 8px;
--radius-lg: 12px;
--radius-xl: 16px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background: var(--bg-primary);
min-height: 100vh;
color: var(--text-primary);
line-height: 1.6;
}
.app-container {
max-width: 1600px;
margin: 0 auto;
padding: 24px;
min-height: 100vh;
}
/* Header Styles */
header {
background: var(--bg-secondary);
border-radius: var(--radius-xl);
padding: 32px;
margin-bottom: 24px;
box-shadow: var(--shadow-md);
border: 1px solid var(--border);
}
.header-content h1 {
color: var(--text-primary);
font-size: 2.25rem;
margin-bottom: 8px;
text-align: center;
font-weight: 600;
letter-spacing: -0.025em;
}
.header-content .subtitle {
color: var(--accent);
font-size: 1.125rem;
text-align: center;
margin-bottom: 8px;
font-weight: 500;
}
.header-content .credits {
color: var(--text-secondary);
font-size: 0.875rem;
text-align: center;
margin-bottom: 24px;
line-height: 1.5;
}
.api-setup {
display: flex;
gap: 12px;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.api-setup label {
font-weight: 500;
color: var(--text-primary);
margin-bottom: 4px;
}
.api-setup input {
padding: 12px 16px;
border: 2px solid var(--border);
border-radius: var(--radius-md);
font-size: 0.875rem;
width: 320px;
transition: all 0.2s ease;
background: var(--bg-secondary);
}
.api-setup input:focus {
outline: none;
border-color: var(--border-focus);
box-shadow: 0 0 0 3px rgba(229, 114, 0, 0.1);
}
.btn {
padding: 12px 24px;
border: none;
border-radius: var(--radius-md);
cursor: pointer;
font-size: 0.875rem;
font-weight: 500;
transition: all 0.2s ease;
display: inline-flex;
align-items: center;
gap: 8px;
text-decoration: none;
background: var(--bg-secondary);
border: 2px solid var(--border);
}
.btn:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(229, 114, 0, 0.1);
}
.btn-primary {
background: linear-gradient(135deg, var(--primary), var(--accent));
color: white;
border: none;
}
.btn-primary:hover:not(:disabled) {
transform: translateY(-1px);
box-shadow: var(--shadow-lg);
}
.btn-secondary {
background: var(--bg-secondary);
color: var(--text-primary);
border: 2px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
border-color: var(--accent);
background: rgba(229, 114, 0, 0.05);
}
.btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* Main Content Layout */
main {
display: grid;
grid-template-columns: 1fr 400px;
gap: 24px;
min-height: 70vh;
}
.chat-section {
background: var(--bg-secondary);
border-radius: var(--radius-xl);
padding: 24px;
box-shadow: var(--shadow-md);
border: 1px solid var(--border);
display: flex;
flex-direction: column;
}
aside {
background: var(--bg-secondary);
border-radius: var(--radius-xl);
padding: 24px;
box-shadow: var(--shadow-md);
border: 1px solid var(--border);
overflow-y: auto;
max-height: 80vh;
}
/* Chat Styles */
.chat-output {
flex: 1;
border: 2px solid var(--border);
border-radius: var(--radius-lg);
padding: 20px;
margin-bottom: 20px;
background: var(--bg-primary);
font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
font-size: 0.875rem;
line-height: 1.6;
overflow-y: auto;
min-height: 400px;
white-space: pre-wrap;
color: var(--text-primary);
}
.message {
margin-bottom: 16px;
padding: 12px 16px;
border-radius: var(--radius-md);
border-left: 4px solid var(--border);
}
.message.user {
background: rgba(229, 114, 0, 0.05);
border-left-color: var(--accent);
}
.message.assistant {
background: rgba(35, 45, 75, 0.05);
border-left-color: var(--primary);
}
.message.system {
background: rgba(72, 187, 120, 0.05);
border-left-color: var(--success);
}
.message.error {
background: rgba(229, 62, 62, 0.05);
border-left-color: var(--error);
}
.message.streaming {
border-left-color: var(--warning);
background: rgba(237, 137, 54, 0.05);
}
.message.streaming .message-header::after {
content: '';
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--warning);
margin-left: 8px;
animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 0.4; }
50% { opacity: 1; }
}
.input-section {
display: flex;
gap: 12px;
align-items: flex-end;
}
.prompt-input {
flex: 1;
padding: 16px;
border: 2px solid var(--border);
border-radius: var(--radius-lg);
font-size: 0.875rem;
resize: vertical;
min-height: 100px;
font-family: inherit;
background: var(--bg-secondary);
transition: all 0.2s ease;
}
.prompt-input:focus {
outline: none;
border-color: var(--border-focus);
box-shadow: 0 0 0 3px rgba(229, 114, 0, 0.1);
}
/* Control Styles */
.control-group {
margin-bottom: 24px;
}
.control-group h3 {
margin-bottom: 16px;
color: var(--text-primary);
font-size: 1rem;
font-weight: 600;
border-bottom: 2px solid var(--border);
padding-bottom: 8px;
}
.control-item {
margin-bottom: 16px;
}
.control-item label {
display: block;
margin-bottom: 6px;
font-weight: 500;
color: var(--text-primary);
font-size: 0.875rem;
}
.control-item select,
.control-item input[type="text"] {
width: 100%;
padding: 10px 12px;
border: 2px solid var(--border);
border-radius: var(--radius-md);
font-size: 0.875rem;
background: var(--bg-secondary);
transition: all 0.2s ease;
}
.control-item select:focus,
.control-item input[type="text"]:focus {
outline: none;
border-color: var(--border-focus);
box-shadow: 0 0 0 3px rgba(229, 114, 0, 0.1);
}
.slider-container {
display: flex;
align-items: center;
gap: 12px;
}
.slider {
flex: 1;
height: 8px;
border-radius: 4px;
background: var(--border);
outline: none;
-webkit-appearance: none;
cursor: pointer;
}
.slider::-webkit-slider-thumb {
appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--accent);
cursor: pointer;
box-shadow: var(--shadow-sm);
}
.slider::-moz-range-thumb {
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--accent);
cursor: pointer;
border: none;
box-shadow: var(--shadow-sm);
}
.slider-value {
min-width: 50px;
text-align: center;
font-weight: 600;
color: var(--text-primary);
font-size: 0.875rem;
background: var(--bg-primary);
padding: 4px 8px;
border-radius: var(--radius-sm);
}
.template-btn {
display: block;
width: 100%;
margin-bottom: 8px;
padding: 12px 16px;
background: var(--bg-primary);
border: 2px solid var(--border);
border-radius: var(--radius-md);
cursor: pointer;
font-size: 0.875rem;
text-align: left;
transition: all 0.2s ease;
color: var(--text-primary);
}
.template-btn:hover {
background: rgba(229, 114, 0, 0.05);
border-color: var(--accent);
}
.template-btn:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(229, 114, 0, 0.1);
}
/* Status Bar */
footer {
background: var(--bg-secondary);
border-radius: var(--radius-lg);
padding: 16px 24px;
margin-top: 24px;
box-shadow: var(--shadow-md);
border: 2px solid var(--border);
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 16px;
}
.status-item {
display: flex;
align-items: center;
gap: 8px;
color: var(--text-primary);
font-size: 0.875rem;
font-weight: 500;
}
.status-indicator {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--success);
}
.status-indicator.disconnected {
background: var(--error);
}
/* Loading and Alert Styles */
.loading {
display: none;
text-align: center;
margin: 20px 0;
color: var(--text-primary);
}
.loading.active {
display: block;
}
.spinner {
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid var(--border);
border-top: 3px solid var(--accent);
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.alert {
padding: 12px 16px;
border-radius: var(--radius-md);
margin: 16px 0;
display: none;
font-size: 0.875rem;
font-weight: 500;
}
.alert.active {
display: block;
}
.alert.error {
background: rgba(229, 62, 62, 0.1);
color: var(--error);
border: 1px solid rgba(229, 62, 62, 0.2);
}
.alert.success {
background: rgba(72, 187, 120, 0.1);
color: var(--success);
border: 1px solid rgba(72, 187, 120, 0.2);
}
/* Guide Styles */
.guide-section {
background: var(--bg-secondary);
border-radius: var(--radius-xl);
padding: 24px;
margin-bottom: 24px;
box-shadow: var(--shadow-md);
border: 1px solid var(--border);
display: none;
}
.guide-tabs {
display: flex;
gap: 8px;
margin-bottom: 24px;
border-bottom: 2px solid var(--border);
}
.guide-tab {
padding: 12px 16px;
background: transparent;
border: none;
border-radius: var(--radius-md) var(--radius-md) 0 0;
cursor: pointer;
font-size: 0.875rem;
font-weight: 500;
color: var(--text-secondary);
transition: all 0.2s ease;
}
.guide-tab.active {
background: var(--accent);
color: white;
}
.guide-tab:hover:not(.active) {
background: rgba(229, 114, 0, 0.1);
color: var(--accent);
}
.guide-content {
display: none;
}
.guide-content.active {
display: block;
}
.pattern-card {
background: var(--bg-primary);
border: 2px solid var(--border);
border-radius: var(--radius-lg);
padding: 20px;
margin-bottom: 16px;
}
.pattern-title {
font-size: 1.125rem;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 8px;
}
.pattern-type {
display: inline-block;
padding: 4px 8px;
background: var(--accent);
color: white;
border-radius: var(--radius-sm);
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 12px;
}
.pattern-description {
color: var(--text-secondary);
margin-bottom: 12px;
line-height: 1.5;
}
.pattern-example {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 12px;
font-family: 'SF Mono', Monaco, monospace;
font-size: 0.75rem;
color: var(--text-primary);
white-space: pre-wrap;
}
.example-card {
background: var(--bg-primary);
border: 2px solid var(--border);
border-radius: var(--radius-lg);
padding: 20px;
margin-bottom: 16px;
}
.example-text {
background: var(--bg-secondary);
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: 16px;
font-family: 'SF Mono', Monaco, monospace;
font-size: 0.875rem;
color: var(--text-primary);
white-space: pre-wrap;
margin-bottom: 12px;
}
.example-btn {
padding: 8px 16px;
background: var(--accent);
color: white;
border: none;
border-radius: var(--radius-md);
cursor: pointer;
font-size: 0.875rem;
font-weight: 500;
transition: all 0.2s ease;
}
.example-btn:hover {
background: #d16600;
transform: translateY(-1px);
}
/* File Upload Styles */
.file-upload {
border: 2px dashed var(--border);
border-radius: var(--radius-lg);
padding: 24px;
text-align: center;
transition: all 0.2s ease;
cursor: pointer;
margin-bottom: 16px;
}
.file-upload:hover {
border-color: var(--accent);
background: rgba(229, 114, 0, 0.02);
}
.file-upload.dragover {
border-color: var(--accent);
background: rgba(229, 114, 0, 0.05);
}
.file-upload input[type="file"] {
display: none;
}
.file-upload-text {
color: var(--text-secondary);
font-size: 0.875rem;
margin-bottom: 8px;
}
.uploaded-files {
margin-top: 12px;
}
.uploaded-file {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
background: var(--bg-primary);
border: 1px solid var(--border);
border-radius: var(--radius-md);
margin-bottom: 8px;
font-size: 0.875rem;
}
.file-remove {
color: var(--error);
cursor: pointer;
font-weight: 600;
}
/* Responsive Design */
@media (max-width: 1200px) {
main {
grid-template-columns: 1fr;
}
aside {
max-height: none;
}
}
@media (max-width: 768px) {
.app-container {
padding: 16px;
}
header {
padding: 24px;
}
.header-content h1 {
font-size: 1.875rem;
}
.api-setup {
flex-direction: column;
align-items: stretch;
}
.api-setup input {
width: 100%;
}
.guide-tabs {
flex-direction: column;
}
footer {
flex-direction: column;
align-items: stretch;
}
.status-item {
justify-content: center;
}
}
/* Accessibility Improvements */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* Focus styles */
*:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: var(--bg-primary);
border-radius: 4px;
}
::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--text-muted);
}
</style>
</head>
<body>
<div class="app-container">
<header role="banner">
<div class="header-content">
<h1>G-AI Desktop Studio</h1>
<div class="subtitle">University of Virginia - UVAi Vanguard Project</div>
<div class="credits">
Developed by <strong>Dr. Hudson Golino</strong><br>
Initial funding provided by <strong>The Jefferson Trust</strong>
</div>
<div class="api-setup">
<div>
<label for="apiKey" class="sr-only">Groq API Key</label>
<input type="password" id="apiKey" placeholder="Enter your Groq API Key" aria-label="Groq API Key" />
</div>
<button class="btn btn-primary" onclick="saveApiKey()" aria-describedby="connection-status">
Connect to Groq
</button>
<button class="btn btn-secondary" onclick="toggleGuide()">
Prompt Guide
</button>
</div>
</div>
</header>
<div class="alert error" id="errorMessage" role="alert" aria-live="polite"></div>
<div class="alert success" id="successMessage" role="alert" aria-live="polite"></div>
<!-- Prompt Engineering Guide -->
<section class="guide-section" id="promptGuide" aria-labelledby="guide-title">
<h2 id="guide-title" class="sr-only">Prompt Engineering Guide</h2>
<div class="guide-tabs" role="tablist" aria-label="Guide sections">
<button class="guide-tab active" role="tab" aria-selected="true" aria-controls="guideOverview" onclick="showGuideTab('overview')">Overview</button>
<button class="guide-tab" role="tab" aria-selected="false" aria-controls="guidePatterns" onclick="showGuideTab('patterns')">Patterns</button>
<button class="guide-tab" role="tab" aria-selected="false" aria-controls="guideExamples" onclick="showGuideTab('examples')">Examples</button>
</div>
<div id="guideOverview" class="guide-content active" role="tabpanel" aria-labelledby="overview-tab">
<h2 style="color: var(--text-primary); margin-bottom: 20px;">Prompt Engineering Fundamentals</h2>
<p style="margin-bottom: 20px; line-height: 1.6; color: var(--text-secondary);">
<strong>Prompting</strong> is the methodology through which we communicate instructions, parameters, and expectations to large language models. The more precise and comprehensive your prompts, the higher the quality of the output.
</p>
<h3 style="color: var(--accent); margin: 25px 0 15px 0;">Pattern Selection Guide</h3>
<table style="width: 100%; border-collapse: collapse; margin: 20px 0; background: white; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);">
<thead>
<tr style="background: var(--primary); color: white;">
<th style="padding: 12px; border: 1px solid var(--border); text-align: left; font-weight: 600;">Task Type</th>
<th style="padding: 12px; border: 1px solid var(--border); text-align: left; font-weight: 600;">Recommended Pattern</th>
<th style="padding: 12px; border: 1px solid var(--border); text-align: left; font-weight: 600;">Why It Works</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 10px; border: 1px solid var(--border);">Simple Q&A, definitions</td>
<td style="padding: 10px; border: 1px solid var(--border);"><strong>Zero shot</strong></td>
<td style="padding: 10px; border: 1px solid var(--border);">Model already knows; instructions suffice</td>
</tr>
<tr style="background: var(--bg-primary);">
<td style="padding: 10px; border: 1px solid var(--border);">Extraction / classification</td>
<td style="padding: 10px; border: 1px solid var(--border);"><strong>Few shot (1-3 samples)</strong></td>
<td style="padding: 10px; border: 1px solid var(--border);">Teaches exact labels & JSON keys</td>
</tr>
<tr>
<td style="padding: 10px; border: 1px solid var(--border);">Creative writing</td>
<td style="padding: 10px; border: 1px solid var(--border);"><strong>Zero shot + role</strong></td>
<td style="padding: 10px; border: 1px solid var(--border);">Freedom + persona = coherent style</td>
</tr>
<tr style="background: var(--bg-primary);">
<td style="padding: 10px; border: 1px solid var(--border);">Multi-step math / logic</td>
<td style="padding: 10px; border: 1px solid var(--border);"><strong>Chain of Thought</strong></td>
<td style="padding: 10px; border: 1px solid var(--border);">Forces stepwise reasoning</td>
</tr>
<tr>
<td style="padding: 10px; border: 1px solid var(--border);">Edge-case heavy tasks</td>
<td style="padding: 10px; border: 1px solid var(--border);"><strong>Few shot (2-5 samples)</strong></td>
<td style="padding: 10px; border: 1px solid var(--border);">Covers exceptions & rare labels</td>
</tr>
<tr style="background: var(--bg-primary);">
<td style="padding: 10px; border: 1px solid var(--border);">Mission-critical accuracy</td>
<td style="padding: 10px; border: 1px solid var(--border);"><strong>Guided CoT + Self Consistency</strong></td>
<td style="padding: 10px; border: 1px solid var(--border);">Multiple reasoned paths to consensus</td>
</tr>
<tr>
<td style="padding: 10px; border: 1px solid var(--border);">Tool-use / knowledge-heavy</td>
<td style="padding: 10px; border: 1px solid var(--border);"><strong>ReAct (Reasoning + Acting)</strong></td>
<td style="padding: 10px; border: 1px solid var(--border);">Thinks, calls tools, repeats for solutions</td>
</tr>
<tr style="background: var(--bg-primary);">
<td style="padding: 10px; border: 1px solid var(--border);">Comprehensive summarization</td>
<td style="padding: 10px; border: 1px solid var(--border);"><strong>Chain of Density (CoD)</strong></td>
<td style="padding: 10px; border: 1px solid var(--border);">Stepwise compression keeps essentials</td>
</tr>
<tr>
<td style="padding: 10px; border: 1px solid var(--border);">Accuracy-critical facts</td>
<td style="padding: 10px; border: 1px solid var(--border);"><strong>Chain of Verification (CoVe)</strong></td>
<td style="padding: 10px; border: 1px solid var(--border);">Asks and answers its own checks</td>
</tr>
</tbody>
</table>
</div>
<div id="guidePatterns" class="guide-content" style="display: none;" role="tabpanel" aria-labelledby="patterns-tab">
<h2 style="color: var(--text-primary); margin-bottom: 20px;">Advanced Prompt Patterns</h2>
<div class="pattern-card">
<div class="pattern-title">Zero Shot</div>
<div class="pattern-type">BASIC</div>
<div class="pattern-description">
Tells the model exactly what you want without examples. Uses the model's pre-training knowledge.
</div>
<div class="pattern-example">Example: "Analyze the sentiment of this text: 'I love this product!' Classify as Positive, Negative, or Neutral."</div>
</div>
<div class="pattern-card">
<div class="pattern-title">Few Shot (1-3 samples)</div>
<div class="pattern-type">INTERMEDIATE</div>
<div class="pattern-description">
Provides 1-3 examples to teach the model the exact input-output mapping you want.
</div>
<div class="pattern-example">Example: "Classify emotions:
Input: 'I'm thrilled!' → Output: Joy
Input: 'This is terrible.' → Output: Anger
Input: 'I'm worried about tomorrow.' → Output: ?</div>
</div>
<div class="pattern-card">
<div class="pattern-title">Zero Shot + Role</div>
<div class="pattern-type">INTERMEDIATE</div>
<div class="pattern-description">
Combines role-playing with zero-shot prompting for creative and persona-driven tasks.
</div>
<div class="pattern-example">Example: "You are a seasoned mystery novelist. Write the opening paragraph of a detective story set in 1920s New York."</div>
</div>
<div class="pattern-card">
<div class="pattern-title">Chain of Thought</div>
<div class="pattern-type">ADVANCED</div>
<div class="pattern-description">
Instructs the model to think through problems step-by-step before providing the final answer.
</div>
<div class="pattern-example">Example: "Solve this step by step: What is 15% of 240?
Let's think step by step:
1. Convert percentage to decimal: 15% = 0.15
2. Multiply: 240 × 0.15 = 36"</div>
</div>
<div class="pattern-card">
<div class="pattern-title">Few Shot (2-5 samples)</div>
<div class="pattern-type">ADVANCED</div>
<div class="pattern-description">
Uses more examples to handle edge cases and complex classification tasks.
</div>
<div class="pattern-example">Example: "Classify urgency with multiple examples:
'Server down' → High
'Password reset' → Low
'Payment failed' → Medium
'App crashes' → High
'Feature request' → Low
Now classify: 'Cannot access account' → ?"</div>
</div>
<div class="pattern-card">
<div class="pattern-title">Guided CoT + Self Consistency</div>
<div class="pattern-type">EXPERT</div>
<div class="pattern-description">
Provides structured reasoning steps and uses multiple reasoning paths for consensus.
</div>
<div class="pattern-example">Example: "Solve this using these steps: 1) Identify key variables 2) Apply relevant formula 3) Calculate result 4) Verify answer. Generate 3 different solution paths and choose the most consistent result."</div>
</div>
<div class="pattern-card">
<div class="pattern-title">ReAct (Reasoning + Acting)</div>
<div class="pattern-type">EXPERT</div>
<div class="pattern-description">
Combines reasoning with tool use, creating a feedback loop of thinking and acting.
</div>
<div class="pattern-example">Example: "Thought: I need to find current weather data
Action: Search[weather New York today]
Observation: Temperature is 75°F, sunny
Thought: Now I can provide a complete answer"</div>
</div>
<div class="pattern-card">
<div class="pattern-title">Chain of Density (CoD)</div>
<div class="pattern-type">EXPERT</div>
<div class="pattern-description">
Iteratively creates more information-dense summaries while maintaining fixed length.
</div>
<div class="pattern-example">Example: "Summarize this article in exactly 50 words. Then rewrite adding 2 more key entities. Repeat 3 times, making each version more information-dense."</div>
</div>
<div class="pattern-card">
<div class="pattern-title">Chain of Verification (CoVe)</div>
<div class="pattern-type">EXPERT</div>
<div class="pattern-description">
Creates a draft response, generates verification questions, answers them, then provides a corrected final response.
</div>
<div class="pattern-example">Example: "Draft: [Initial analysis]
Verification: 1) Is this factually correct? 2) Are there gaps in reasoning?
Final: [Corrected analysis based on verification]"</div>
</div>
</div>
<div id="guideExamples" class="guide-content" style="display: none;" role="tabpanel" aria-labelledby="examples-tab">
<h2 style="color: var(--text-primary); margin-bottom: 20px;">Ready-to-Use Examples</h2>
<div class="example-card">
<h3 style="color: var(--accent); margin-bottom: 10px;">Zero Shot Example</h3>
<div class="example-text">You are a data analyst. Analyze the following sales data and provide three key insights: [INSERT_DATA_HERE]</div>
<button class="example-btn" onclick="loadExamplePrompt('zeroshot')">Load This Example</button>
</div>
<div class="example-card">
<h3 style="color: var(--accent); margin-bottom: 10px;">Few Shot Example</h3>
<div class="example-text">Classify customer feedback:
Example 1: "Great product, fast shipping!" → Positive
Example 2: "Item was damaged, poor packaging" → Negative
Example 3: "Average quality, nothing special" → Neutral
Now classify: "[INSERT_FEEDBACK_HERE]"</div>
<button class="example-btn" onclick="loadExamplePrompt('fewshot')">Load This Example</button>
</div>
<div class="example-card">
<h3 style="color: var(--accent); margin-bottom: 10px;">Zero Shot + Role Example</h3>
<div class="example-text">You are a senior software architect with 15 years of experience. A junior developer asks you to explain microservices architecture. Provide a clear, practical explanation with real-world examples.</div>
<button class="example-btn" onclick="loadExamplePrompt('zeroshotrole')">Load This Example</button>
</div>
<div class="example-card">
<h3 style="color: var(--accent); margin-bottom: 10px;">Chain of Thought Example</h3>
<div class="example-text">Solve this problem step by step:
"A company's revenue increased by 25% in Q1, then decreased by 15% in Q2. If Q2 revenue was $850,000, what was the original revenue before Q1?"
Let's think step by step:
1. First, I need to identify what we know
2. Then work backwards from Q2 to Q1
3. Then from Q1 to the original revenue</div>
<button class="example-btn" onclick="loadExamplePrompt('chainofthought')">Load This Example</button>
</div>
<div class="example-card">
<h3 style="color: var(--accent); margin-bottom: 10px;">Chain of Verification Example</h3>