-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
495 lines (472 loc) · 28.7 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="//code.jquery.com/jquery-3.7.0.min.js" integrity="sha256-2Pmvv0kuTBOenSvLm6bvfBSSHrUJ+3A7x6P5Ebd07/g=" crossorigin="anonymous"></script>
<link href="//cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<script src="//cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/default.min.css" integrity="sha512-hasIneQUHlh06VNBe7f6ZcHmeRTLIaQWFd43YriJ0UND19bvYRauxthDg8E4eVNPm9bRUhr5JGeqH7FRFXQu5g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="shortcut icon" href="#">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js" integrity="sha512-rdhY3cbXURo13l/WU9VlaRyaIYeJ/KBakckXIvJNAQde8DgpOmE+eZf7ha4vdqVjTtwQt69bD2wH2LXob/LB7Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="//cdn.jsdelivr.net/npm/markdown-it@13.0.1/dist/markdown-it.min.js" integrity="sha256-hNyljag6giCsjv/yKmxK8/VeHzvMDvc5u8AzmRvm1BI=" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.11/clipboard.min.js" integrity="sha512-7O5pXpc0oCRrxk8RUfDYFgn0nO1t+jLuIOQdOMRp4APB7uZ4vSjspzp5y6YDtDs4VzUSTbWzBFZ/LKJhnyFOKw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="//cdn.jsdelivr.net/npm/rdflib@2.2.32/dist/rdflib.min.js"></script>
<script src="version.js"></script>
<script src="lib/solid-client-authn.bundle.js" integrity="sha512-xCsU0QV+pkzlr9dAZIJT22XBI4HTmumAb6Y6zwNiauzMS6djYzY1vbXWCZKbdWsqJIqg86VM795REQfcJcql2Q=="></script>
<link href="css/chat.css" rel="stylesheet"/>
<link href="css/assistants.css" rel="stylesheet"/>
<!-- JS Files -->
<script src="js/ui.js"></script>
<script src="js/auth.js"></script>
<script src="js/chat.js"></script>
<script src="js/profile.js"></script>
<script src="js/websocket.js"></script>
<script src="js/storage.js"></script>
<script src="js/files.js"></script>
<script src="js/audio.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div class="grid-container">
<div class="assistant-configuration">
<button class="btn" id="close-assistant-configuration-btn">
<span data-toggle="tooltip" data-bs-placement="right" title="Close Assistant Configuration">
<img src="svg/expand-left.svg"/>
</span>
</button>
<div class="assistants-dropdown">
<div class="assistants-dropdown-btn" id="assistantsDropdown">
<span class="assistants-dropdown-text">Select an Assistant</span>
<span class="expand-vertical btn-icon">
<img src="svg/expand-vertical.svg"/>
</span>
</div>
<div class="assistants-dropdown-menu hidden"></div>
</div>
<div class="model-configuration-fields">
<div class="assistant-label">
<label for="name" class="field-label">Name</label>
<input type="text" id="assistant-name" class="field-input" placeholder="Enter a name for the assistant">
<div class="assistant-id field-id"></div>
</div>
<div class="field">
<label for="instructions" class="field-label">Instructions</label>
<textarea id="instructions" class="field-input" placeholder="Assistants instructions"></textarea>
</div>
<div class="field">
<label class="switch">
<input type="checkbox" id="assistant-publish">
<span class="slider"></span>
</label>
<span data-toggle="tooltip" data-bs-placement="top" title="Whether this assistant object to be considered in production mode or as a draft">Published</span>
</div>
<div class="field">
<label for="model" class="field-label">Model</label>
<div class="models-dropdown">
<div class="models-dropdown-btn" id="modelDropdown">
<span class="models-dropdown-text"></span>
<span class="expand-vertical btn-icon">
<img src="svg/expand-vertical.svg"/>
</span>
</div>
<div class="models-dropdown-menu hidden"></div>
</div>
</div>
<div class="tools-section">
<h3 class="section-title">TOOLS</h3>
<div class="tool-item">
<label class="switch">
<input type="checkbox" id="file-search">
<span class="slider"></span>
</label>
<span>File search</span>
<button class="files-btn" id="vs-files-btn">+ Files</button>
</div>
<div class="vector-store"></div>
<!--div class="tool-item">
<label class="switch">
<input type="checkbox">
<span class="slider"></span>
</label>
<span>Code interpreter</span>
</div-->
</div>
<div class="functions-section">
<div class="section-header">
<h3 class="section-title">FUNCTIONS</h3>
<button class="functions-btn">+ Functions</button>
</div>
<div class="functions-list"></div>
</div>
<div class="model-config-section">
<h3 class="section-title">MODEL CONFIGURATION</h3>
<!-- <div class="field">
<label for="response-format" class="field-label">Response format</label>
<label class="switch">
<input type="checkbox">
<span class="slider"></span>
</label>
<span>JSON object</span>
</div> -->
<div class="field" id="temperature-field">
<label for="temperature_in" data-toggle="tooltip" data-bs-placement="top" class="field-label"
title="Temperature is a parameter that controls the “creativity” or randomness of the text generated by GPT. A higher temperature (e.g., 0.7) results in more diverse and creative output, while a lower temperature (e.g., 0.2) makes the output more deterministic and focused.">
Temperature
</label>
<input type="text" id="temperature" class="form-control params" value="1">
</div>
<div class="field">
<input type="range" class="form-range" id="temperature_in" min="0" step="0.01" max="2" value="0.2">
</div>
<div class="field" id="top-p-field">
<label for="top_p_in" data-toggle="tooltip" data-bs-placement="top" class="field-label"
title="Top_p sampling is an alternative to temperature sampling. Instead of considering all possible tokens, GPT considers only a subset of tokens (the nucleus) whose cumulative probability mass adds up to a certain threshold.">
Top p
</label>
<input type="text" id="top_p" class="form-control params" value="0.5">
</div>
<div class="field">
<input type="range" class="form-range" id="top_p_in" min="0" step="0.01" max="1" value="1">
</div>
<div class="field" id="max-tokens-field">
<label for="max_tokens_in" data-toggle="tooltip" data-bs-placement="top" class="field-label"
title="Maximum number of tokens before to stop generation, infinite is limited by API limits, certain models as gpt-4-vision always needs this setting to be specified.">
Max Tokens
</label>
<input type="text" id="max_tokens" class="form-control params" value="300">
</div>
<div class="field">
<input type="range" class="form-range" id="max_tokens_in" min="0" step="1" max="4096" value="4096">
</div>
<div class="field" id="max-threads-field">
<label for="max_threads_in" data-toggle="tooltip" data-bs-placement="top" class="field-label"
title="Maximum number of session entries visible in log list.">
Max Threads
</label>
<input type="text" id="max_threads" class="form-control params" value="100">
</div>
<div class="field">
<input type="range" class="form-range" id="max_threads_in" min="20" step="10" max="100" value="100">
</div>
</div>
<div class="session-configuration">
<h3 class="section-title">SESSION CONFIGURATION</h3>
<div class="field enable-audio-field" id="enable-audio-field">
<label for="enable_audio" data-toggle="tooltip" data-bs-placement="top" class="field-label" id="audio-field-label" title="Enable audio recording for the session.">
Enable Audio
</label>
<input type="checkbox" id="enable_audio" class="form-check-input">
</div>
<div class="field enable-debug-field" id="enable-debug-field">
<label for="enable_debug" data-toggle="tooltip" data-bs-placement="top" class="field-label" id="debug-field-label" title="Enable function tools debug for the session.">
Enable Debug
</label>
<input type="checkbox" id="enable_debug" class="form-check-input">
</div>
<!--<div class="field" id="animation-speed-field">
<label for="animation_speed_in" data-toggle="tooltip" data-bs-placement="top" class="field-label"
title="Animation speed for session replay upon loaded from storage.">
Animation Speed
</label>
</div>
<div class="field">
<input type="range" class="form-range" id="animation_speed_in" min="0" step="10" max="500" value="0">
</div> -->
</div>
<!-- <div class="api-version-section">
<h3 class="section-title">API VERSION</h3>
<div class="api-version">
<span>Latest</span>
<button class="switch-version-button">Switch to v1</button>
</div>
<div class="api-timestamp">Updated 5/14, 2:41 PM</div>
</div> -->
<div class="assistant-buttons">
<button class="assistant-btn" id="save-assistant-button" title="Save">Save</button>
<button class="assistant-btn" id="delete-assistant">
<img src="svg/trash.svg" alt="Trash Icon" class="assistant-icon trash">
</button>
<!--button class="assistant-btn" id="clone-assistant-button">
<img src="svg/clipboard.svg" alt="Copy Icon" class="assistant-icon copy">
Clone
</button-->
</div>
</div>
</div>
<div class="chat-window">
<button class="btn" id="open-assistant-configuration-btn">
<span data-toggle="tooltip" data-bs-placement="right" title="Open Assistant Configuration">
<img src="svg/expand-right.svg"/>
</span>
</button>
<div class="top-content-wrapper">
<div class="threads-dropdown">
<div class="threads-dropdown-btn">
<span class="threads-dropdown-text">Threads</span>
<span class="expand-vertical btn-icon">
<img src="svg/expand-vertical.svg"/>
</span>
</div>
<div class="threads-dropdown-menu">
<!-- Dynamic content will be injected here to show a user's threads -->
</div>
</div>
<div class="top-menu-buttons">
<button class="top-menu-button new-thread" title="New Thread">New Thread</button>
<!-- <button class="top-menu-button" id="new-assistant" title="New Assistant">New Assistant</button> -->
</div>
<div class="chat-window-buttons">
<!-- <button class="icon-button" title="About"><img src="svg/book.svg" alt="About"></button> -->
<input type="text" class="field-input search-input" />
<button class="icon-button" title="Share"><img src="svg/export.svg" alt="Share"></button>
<button class="icon-button" id="import-thread-button" title="Import Thread"><img src="svg/import.svg" alt="Import Thread"></button>
<button class="icon-button api-key" title="Api Key"><img src="svg/vertical-key.svg" alt="Api Key"></button>
<button class="top-menu-button login-button" title="Login">Login</button>
<a class="uid hidden" data-bs-placement="top" target="_blank" href="" title="">
<img id="uid icon" src="svg/user.svg">
</a>
<button class="top-menu-button logout-button hidden" title="Logout">Logout</button>
</div>
</div>
<div class="chat-messages">
<!-- Dynamicall filled with chat messages -->
</div>
</div>
<div class="user-input-wrapper">
<div class="continue-button-group">
<button id="continue-button" class="button continue-button">Resume Chat</button>
</div>
<div class="reconnect-button-group">
<button id="reconnect-button" class="button reconnect-button">Reconnect</button>
</div>
<div class="textbox-container" id="user-input-textbox">
<input type="file" style="display:none;" multiple="" id="fs-upload">
<div class="assistants-suggestions-dropdown hidden"></div>
<div class="loader"></div>
<div class="uploaded-files-container"></div>
<div class="user-input-container">
<label id="assistant-id"></label>
<textarea id="user-input" placeholder="Type your question here (use ⇧⏎ for line break)..."></textarea>
<input type="file" id="local-storage-thread-input" accept=".json" style="display: none;">
</div>
<div class="buttons-container">
<div class="left-buttons">
<button class="icon-button" id="record-button" title="Record"><img src="svg/microphone.svg" alt="Microphone"></button>
<button class="icon-button" id="stop-recording-button" title="Stop Recording"><img src="svg/stop-recording.svg" alt="Stop Recording"></button>
<button class="icon-button" id="file-upload-button" title="Upload File"><img src="svg/paperclip-2.svg" alt="File Search"></button>
</div>
<div class="right-buttons">
<div class="run-button-group">
<button class="run-button chat-btn" id="run-submit">
<img src="svg/caret-right-circle.svg" alt="Caret Right Circle" class="icon">
Run
</button>
<button class="stop-button chat-btn" id="stop-submit">
<img src="svg/stop-fill.svg" alt="Stop" class="icon">
Stop
</button>
<div class="separator"></div>
<button class="dropdown-button" id="run-dropdown">
<img src="svg/down-arrow.svg" alt="Dropdown Arrow" class="dropdown-icon">
</button>
</div>
</div>
</div>
</div>
<div class="footer">
Personal Assistant Interface (Metal) - Version <label id="vad_version">1.0.0</label>
</div>
</div>
</div>
<!-- Modals -->
<div id="api-key-modal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Please enter your OpenAI API key</h2>
<div class="input-group">
<label for="api-key-input">OpenAI API Key</label>
<input type="text" id="api-key-input" placeholder="Enter your OpenAI API key">
</div>
<div class="button-group api-modal-buttons">
<button id="save-api-key" class="button save-button">Save</button>
<button id="remove-api-key" class="button remove-button">Remove</button>
</div>
</div>
</div>
<div id="login-modal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Authentication</h2>
<p>Please authenticate to continue</p>
<div class="button-group login-modal-buttons">
<button id="login-button" class="button login-button">Log In</button>
</div>
</div>
</div>
<div id="share-thread-modal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Share Thread Messages</h2>
<p>
The personal storage folder URI will be used to store the current chat session.
Make sure you have access to it with the currently logged-in account.
If it is not automatically detected, then your profile does not support pim:storage or it is not accessible.
</p>
<div class="input-group">
<label for="personal-storage-export-input">Personal Storage</label>
<input type="text" id="personal-storage-export-input" placeholder="Personal storage URI">
</div>
<div class="button-group share-thread-modal-buttons">
<button id="export-chat" class="button export-chat-button">Export to Personal Storage</button>
<button id="share-link" class="button share-link-button">Get Link</button>
<button id="copy-messages" class="button copy-messages-button">Copy All Messages</button>
</div>
<div class="share-animation-speed">
<div class="field" id="animation-speed-field">
<label for="share_animation_speed_in" data-toggle="tooltip" data-bs-placement="top" class="field-label"
title="Animation speed for share link session replay.">
Share Animation Speed
</label>
</div>
<div class="field">
<input type="range" class="form-range" id="share_animation_speed_in" min="0" step="10" max="500" value="0">
</div>
</div>
</div>
</div>
<div id="personal-storage-modal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Personal Storage (WebDAV)</h2>
<div class="input-group">
<label for="personal-storage-import-input">Personal Storage</label>
<div class="personal-storage-import-input-field">
<input type="text" id="personal-storage-import-input" placeholder="Personal storage URI">
<button id="search-storage" class="button search-button">Search</button>
</div>
</div>
<div class="personal-storage-threads">
<!-- Dynamic content will be added here when threads are found -->
</div>
</div>
</div>
<div id="import-thread-modal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Import Thread</h2>
<p>
Choose thread import source
</p>
<div class="button-group import-thread-modal-buttons">
<button class="button import-thread-buttom" id="personal-storage">Personal Storage (WebDAV)</button>
<button class="button import-thread-button" id="local-storage">Local Storage</button>
</div>
</div>
</div>
<div id="function-modal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Add function</h2>
<p>The model will intelligently decide to call functions based on the input it receives from the user.</p>
<div class="input-group" id="function-input">
</div>
<div class="button-group">
<button class="button functions-save-button save-button">Save</button>
</div>
</div>
</div>
<div id="attach-files-modal" class="modal attach-files-modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Attach files to file search</h2>
<div id="drop_zone" class="drag-drop-area drop_zone">
<img src="svg/images.svg" alt="Upload Icon">
<p>Drag your files here or <a href="#" id="file-upload-link">click to upload</a></p>
<p>Information in attached files will be available to this thread.</p>
<input type="file" id="file-input" style="display: none;">
</div>
<div id="fs-spinner" class="spinner"></div>
<div id="uploaded-files" class="uploaded-files">
<table>
<thead>
<tr>
<th>File</th>
<th>Size</th>
<th></th>
</tr>
</thead>
<tbody>
<!-- Uploaded files will be displayed here -->
</tbody>
</table>
</div>
<div class="button-group">
<button class="button done-button">Done</button>
</div>
</div>
</div>
<div id="vs-files-modal" class="modal attach-files-modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Attach files to Vector Store</h2>
<div class="contol-group">
<label for="vs_id" class="h6">Vector Store Id</label>
<input type="text" class="form-control" id="vs_id">
<!--button class="files-btn" id="vs-fetch">Select</button-->
</div>
<div id="vs_drop_zone" class="drag-drop-area drop_zone">
<img src="svg/images.svg" alt="Upload Icon">
<p>Drag your files here or <a href="#" id="vs-upload-link">click to upload</a></p>
<p>Information in attached files will be added to vector store.</p>
<input type="file" id="vs-input" style="display: none;">
</div>
<div id="vs-spinner" class="spinner"></div>
<div id="vs-files" class="uploaded-files">
<table>
<thead>
<tr>
<th>File</th>
<th><label data-toggle="tooltip" data-bs-placement="left" title="The vector store usage in bytes. Note that this may be different from the original file size.">Space</label></th>
<th></th>
</tr>
</thead>
<tbody>
<!-- Uploaded files will be displayed here -->
</tbody>
</table>
</div>
<div class="button-group">
<button class="button vs-done-button">Save</button>
</div>
</div>
</div>
<div class="modal fade" id="auth-modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title" id="tool-auth-text" data-toggle="tooltip" data-bs-placement="top" title="Enter credential to authorize the external tool">Authorization required</h3>
</div>
<div class="modal-body">
<div class="form-group">
<div class="form-check form-switch" id="oauth-sw">
<input type="checkbox" id="auth-api-type" class="form-check-input">
<label class="form-check-label" for="auth-api-type">Use API Key</label>
</div>
<div id="auth-api-key-inp">
<label for="auth-key" class="form-label">API Key</label>
<input type="text" id="auth-key" value="" class="form-control" placeholder="Enter API Key"/>
</div>
</div>
</div>
<div class="modal-footer button-group api-modal-buttons">
<button type="button" class="button save-button" id="btn-auth-key-set">Authorize</button>
<button type="button" class="button remove-button" data-bs-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<div class='notice'>
<div id="msg"></div>
</div>
</body>
</html>