MessageInput.svelte 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <script lang="ts">
  2. import toast from 'svelte-french-toast';
  3. import { onMount, tick } from 'svelte';
  4. import { settings } from '$lib/stores';
  5. import { calculateSHA256, findWordIndices } from '$lib/utils';
  6. import Prompts from './MessageInput/PromptCommands.svelte';
  7. import Suggestions from './MessageInput/Suggestions.svelte';
  8. import { uploadDocToVectorDB } from '$lib/apis/rag';
  9. export let submitPrompt: Function;
  10. export let stopResponse: Function;
  11. export let suggestionPrompts = [];
  12. export let autoScroll = true;
  13. let filesInputElement;
  14. let promptsElement;
  15. let inputFiles;
  16. let dragged = false;
  17. export let files = [];
  18. export let fileUploadEnabled = true;
  19. export let speechRecognitionEnabled = true;
  20. export let speechRecognitionListening = false;
  21. export let prompt = '';
  22. export let messages = [];
  23. let speechRecognition;
  24. const speechRecognitionHandler = () => {
  25. // Check if SpeechRecognition is supported
  26. if (speechRecognitionListening) {
  27. speechRecognition.stop();
  28. } else {
  29. if ('SpeechRecognition' in window || 'webkitSpeechRecognition' in window) {
  30. // Create a SpeechRecognition object
  31. speechRecognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
  32. // Set continuous to true for continuous recognition
  33. speechRecognition.continuous = true;
  34. // Set the timeout for turning off the recognition after inactivity (in milliseconds)
  35. const inactivityTimeout = 3000; // 3 seconds
  36. let timeoutId;
  37. // Start recognition
  38. speechRecognition.start();
  39. speechRecognitionListening = true;
  40. // Event triggered when speech is recognized
  41. speechRecognition.onresult = function (event) {
  42. // Clear the inactivity timeout
  43. clearTimeout(timeoutId);
  44. // Handle recognized speech
  45. console.log(event);
  46. const transcript = event.results[Object.keys(event.results).length - 1][0].transcript;
  47. prompt = `${prompt}${transcript}`;
  48. // Restart the inactivity timeout
  49. timeoutId = setTimeout(() => {
  50. console.log('Speech recognition turned off due to inactivity.');
  51. speechRecognition.stop();
  52. }, inactivityTimeout);
  53. };
  54. // Event triggered when recognition is ended
  55. speechRecognition.onend = function () {
  56. // Restart recognition after it ends
  57. console.log('recognition ended');
  58. speechRecognitionListening = false;
  59. if (prompt !== '' && $settings?.speechAutoSend === true) {
  60. submitPrompt(prompt);
  61. }
  62. };
  63. // Event triggered when an error occurs
  64. speechRecognition.onerror = function (event) {
  65. console.log(event);
  66. toast.error(`Speech recognition error: ${event.error}`);
  67. speechRecognitionListening = false;
  68. };
  69. } else {
  70. toast.error('SpeechRecognition API is not supported in this browser.');
  71. }
  72. }
  73. };
  74. const uploadDoc = async (file) => {
  75. console.log(file);
  76. const doc = {
  77. type: 'doc',
  78. name: file.name,
  79. collection_name: '',
  80. upload_status: false,
  81. error: ''
  82. };
  83. files = [...files, doc];
  84. const res = await uploadDocToVectorDB(localStorage.token, '', file);
  85. if (res) {
  86. doc.upload_status = true;
  87. doc.collection_name = res.collection_name;
  88. files = files;
  89. }
  90. };
  91. onMount(() => {
  92. const dropZone = document.querySelector('body');
  93. dropZone?.addEventListener('dragover', (e) => {
  94. e.preventDefault();
  95. dragged = true;
  96. });
  97. dropZone.addEventListener('drop', async (e) => {
  98. e.preventDefault();
  99. console.log(e);
  100. if (e.dataTransfer?.files) {
  101. let reader = new FileReader();
  102. reader.onload = (event) => {
  103. files = [
  104. ...files,
  105. {
  106. type: 'image',
  107. url: `${event.target.result}`
  108. }
  109. ];
  110. };
  111. const inputFiles = e.dataTransfer?.files;
  112. if (inputFiles && inputFiles.length > 0) {
  113. const file = inputFiles[0];
  114. if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
  115. reader.readAsDataURL(file);
  116. } else if (
  117. [
  118. 'application/pdf',
  119. 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  120. 'text/plain',
  121. 'text/csv'
  122. ].includes(file['type'])
  123. ) {
  124. uploadDoc(file);
  125. } else {
  126. toast.error(`Unsupported File Type '${file['type']}'.`);
  127. }
  128. } else {
  129. toast.error(`File not found.`);
  130. }
  131. }
  132. dragged = false;
  133. });
  134. dropZone?.addEventListener('dragleave', () => {
  135. dragged = false;
  136. });
  137. });
  138. </script>
  139. {#if dragged}
  140. <div
  141. class="fixed w-full h-full flex z-50 touch-none pointer-events-none"
  142. id="dropzone"
  143. role="region"
  144. aria-label="Drag and Drop Container"
  145. >
  146. <div class="absolute rounded-xl w-full h-full backdrop-blur bg-gray-800/40 flex justify-center">
  147. <div class="m-auto pt-64 flex flex-col justify-center">
  148. <div class="max-w-md">
  149. <div class=" text-center text-6xl mb-3">🗂️</div>
  150. <div class="text-center dark:text-white text-2xl font-semibold z-50">Add Files</div>
  151. <div class=" mt-2 text-center text-sm dark:text-gray-200 w-full">
  152. Drop any files/images here to add to the conversation
  153. </div>
  154. </div>
  155. </div>
  156. </div>
  157. </div>
  158. {/if}
  159. <div class="fixed bottom-0 w-full">
  160. <div class="px-2.5 pt-2.5 -mb-0.5 mx-auto inset-x-0 bg-transparent flex justify-center">
  161. <div class="flex flex-col max-w-3xl w-full">
  162. <div>
  163. {#if autoScroll === false && messages.length > 0}
  164. <div class=" flex justify-center mb-4">
  165. <button
  166. class=" bg-white border border-gray-100 dark:border-none dark:bg-white/20 p-1.5 rounded-full"
  167. on:click={() => {
  168. autoScroll = true;
  169. window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
  170. }}
  171. >
  172. <svg
  173. xmlns="http://www.w3.org/2000/svg"
  174. viewBox="0 0 20 20"
  175. fill="currentColor"
  176. class="w-5 h-5"
  177. >
  178. <path
  179. fill-rule="evenodd"
  180. d="M10 3a.75.75 0 01.75.75v10.638l3.96-4.158a.75.75 0 111.08 1.04l-5.25 5.5a.75.75 0 01-1.08 0l-5.25-5.5a.75.75 0 111.08-1.04l3.96 4.158V3.75A.75.75 0 0110 3z"
  181. clip-rule="evenodd"
  182. />
  183. </svg>
  184. </button>
  185. </div>
  186. {/if}
  187. </div>
  188. <div class="w-full">
  189. {#if prompt.charAt(0) === '/'}
  190. <Prompts bind:this={promptsElement} bind:prompt />
  191. {:else if messages.length == 0 && suggestionPrompts.length !== 0}
  192. <Suggestions {suggestionPrompts} {submitPrompt} />
  193. {/if}
  194. </div>
  195. </div>
  196. </div>
  197. <div class="bg-white dark:bg-gray-800">
  198. <div class="max-w-3xl px-2.5 -mb-0.5 mx-auto inset-x-0">
  199. <div class="bg-gradient-to-t from-white dark:from-gray-800 from-40% pb-2">
  200. <input
  201. bind:this={filesInputElement}
  202. bind:files={inputFiles}
  203. type="file"
  204. hidden
  205. on:change={async () => {
  206. let reader = new FileReader();
  207. reader.onload = (event) => {
  208. files = [
  209. ...files,
  210. {
  211. type: 'image',
  212. url: `${event.target.result}`
  213. }
  214. ];
  215. inputFiles = null;
  216. filesInputElement.value = '';
  217. };
  218. if (inputFiles && inputFiles.length > 0) {
  219. const file = inputFiles[0];
  220. if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
  221. reader.readAsDataURL(file);
  222. } else if (
  223. [
  224. 'application/pdf',
  225. 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  226. 'text/plain',
  227. 'text/csv'
  228. ].includes(file['type'])
  229. ) {
  230. uploadDoc(file);
  231. filesInputElement.value = '';
  232. } else {
  233. toast.error(`Unsupported File Type '${file['type']}'.`);
  234. inputFiles = null;
  235. }
  236. } else {
  237. toast.error(`File not found.`);
  238. }
  239. }}
  240. />
  241. <form
  242. class=" flex flex-col relative w-full rounded-xl border dark:border-gray-600 bg-white dark:bg-gray-800 dark:text-gray-100"
  243. on:submit|preventDefault={() => {
  244. submitPrompt(prompt);
  245. }}
  246. >
  247. {#if files.length > 0}
  248. <div class="mx-2 mt-2 mb-1 flex flex-wrap gap-2">
  249. {#each files as file, fileIdx}
  250. <div class=" relative group">
  251. {#if file.type === 'image'}
  252. <img src={file.url} alt="input" class=" h-16 w-16 rounded-xl object-cover" />
  253. {:else if file.type === 'doc'}
  254. <div
  255. class="h-16 w-[15rem] flex items-center space-x-3 px-2.5 dark:bg-gray-600 rounded-xl border border-gray-200 dark:border-none"
  256. >
  257. <div class="p-2.5 bg-red-400 text-white rounded-lg">
  258. {#if file.upload_status}
  259. <svg
  260. xmlns="http://www.w3.org/2000/svg"
  261. viewBox="0 0 24 24"
  262. fill="currentColor"
  263. class="w-6 h-6"
  264. >
  265. <path
  266. fill-rule="evenodd"
  267. d="M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5H5.625ZM7.5 15a.75.75 0 0 1 .75-.75h7.5a.75.75 0 0 1 0 1.5h-7.5A.75.75 0 0 1 7.5 15Zm.75 2.25a.75.75 0 0 0 0 1.5H12a.75.75 0 0 0 0-1.5H8.25Z"
  268. clip-rule="evenodd"
  269. />
  270. <path
  271. d="M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
  272. />
  273. </svg>
  274. {:else}
  275. <svg
  276. class=" w-6 h-6 translate-y-[0.5px]"
  277. fill="currentColor"
  278. viewBox="0 0 24 24"
  279. xmlns="http://www.w3.org/2000/svg"
  280. ><style>
  281. .spinner_qM83 {
  282. animation: spinner_8HQG 1.05s infinite;
  283. }
  284. .spinner_oXPr {
  285. animation-delay: 0.1s;
  286. }
  287. .spinner_ZTLf {
  288. animation-delay: 0.2s;
  289. }
  290. @keyframes spinner_8HQG {
  291. 0%,
  292. 57.14% {
  293. animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
  294. transform: translate(0);
  295. }
  296. 28.57% {
  297. animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33);
  298. transform: translateY(-6px);
  299. }
  300. 100% {
  301. transform: translate(0);
  302. }
  303. }
  304. </style><circle class="spinner_qM83" cx="4" cy="12" r="2.5" /><circle
  305. class="spinner_qM83 spinner_oXPr"
  306. cx="12"
  307. cy="12"
  308. r="2.5"
  309. /><circle
  310. class="spinner_qM83 spinner_ZTLf"
  311. cx="20"
  312. cy="12"
  313. r="2.5"
  314. /></svg
  315. >
  316. {/if}
  317. </div>
  318. <div class="flex flex-col justify-center -space-y-0.5">
  319. <div class=" dark:text-gray-100 text-sm font-medium line-clamp-1">
  320. {file.name}
  321. </div>
  322. <div class=" text-gray-500 text-sm">Document</div>
  323. </div>
  324. </div>
  325. {/if}
  326. <div class=" absolute -top-1 -right-1">
  327. <button
  328. class=" bg-gray-400 text-white border border-white rounded-full group-hover:visible invisible transition"
  329. type="button"
  330. on:click={() => {
  331. files.splice(fileIdx, 1);
  332. files = files;
  333. }}
  334. >
  335. <svg
  336. xmlns="http://www.w3.org/2000/svg"
  337. viewBox="0 0 20 20"
  338. fill="currentColor"
  339. class="w-4 h-4"
  340. >
  341. <path
  342. d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
  343. />
  344. </svg>
  345. </button>
  346. </div>
  347. </div>
  348. {/each}
  349. </div>
  350. {/if}
  351. <div class=" flex">
  352. {#if fileUploadEnabled}
  353. <div class=" self-end mb-2 ml-1.5">
  354. <button
  355. class=" text-gray-600 dark:text-gray-200 transition rounded-lg p-1 ml-1"
  356. type="button"
  357. on:click={() => {
  358. filesInputElement.click();
  359. }}
  360. >
  361. <svg
  362. xmlns="http://www.w3.org/2000/svg"
  363. viewBox="0 0 20 20"
  364. fill="currentColor"
  365. class="w-5 h-5"
  366. >
  367. <path
  368. fill-rule="evenodd"
  369. d="M15.621 4.379a3 3 0 00-4.242 0l-7 7a3 3 0 004.241 4.243h.001l.497-.5a.75.75 0 011.064 1.057l-.498.501-.002.002a4.5 4.5 0 01-6.364-6.364l7-7a4.5 4.5 0 016.368 6.36l-3.455 3.553A2.625 2.625 0 119.52 9.52l3.45-3.451a.75.75 0 111.061 1.06l-3.45 3.451a1.125 1.125 0 001.587 1.595l3.454-3.553a3 3 0 000-4.242z"
  370. clip-rule="evenodd"
  371. />
  372. </svg>
  373. </button>
  374. </div>
  375. {/if}
  376. <textarea
  377. id="chat-textarea"
  378. class=" dark:bg-gray-800 dark:text-gray-100 outline-none w-full py-3 px-2 {fileUploadEnabled
  379. ? ''
  380. : ' pl-4'} rounded-xl resize-none h-[48px]"
  381. placeholder={speechRecognitionListening ? 'Listening...' : 'Send a message'}
  382. bind:value={prompt}
  383. on:keypress={(e) => {
  384. if (e.keyCode == 13 && !e.shiftKey) {
  385. e.preventDefault();
  386. }
  387. if (prompt !== '' && e.keyCode == 13 && !e.shiftKey) {
  388. submitPrompt(prompt);
  389. }
  390. }}
  391. on:keydown={async (e) => {
  392. if (prompt === '' && e.key == 'ArrowUp') {
  393. e.preventDefault();
  394. const userMessageElement = [
  395. ...document.getElementsByClassName('user-message')
  396. ]?.at(-1);
  397. const editButton = [
  398. ...document.getElementsByClassName('edit-user-message-button')
  399. ]?.at(-1);
  400. console.log(userMessageElement);
  401. userMessageElement.scrollIntoView({ block: 'center' });
  402. editButton?.click();
  403. }
  404. if (prompt.charAt(0) === '/' && e.key === 'ArrowUp') {
  405. promptsElement.selectUp();
  406. const commandOptionButton = [
  407. ...document.getElementsByClassName('selected-command-option-button')
  408. ]?.at(-1);
  409. commandOptionButton.scrollIntoView({ block: 'center' });
  410. }
  411. if (prompt.charAt(0) === '/' && e.key === 'ArrowDown') {
  412. promptsElement.selectDown();
  413. const commandOptionButton = [
  414. ...document.getElementsByClassName('selected-command-option-button')
  415. ]?.at(-1);
  416. commandOptionButton.scrollIntoView({ block: 'center' });
  417. }
  418. if (prompt.charAt(0) === '/' && e.key === 'Enter') {
  419. e.preventDefault();
  420. const commandOptionButton = [
  421. ...document.getElementsByClassName('selected-command-option-button')
  422. ]?.at(-1);
  423. commandOptionButton?.click();
  424. }
  425. if (prompt.charAt(0) === '/' && e.key === 'Tab') {
  426. e.preventDefault();
  427. const commandOptionButton = [
  428. ...document.getElementsByClassName('selected-command-option-button')
  429. ]?.at(-1);
  430. commandOptionButton?.click();
  431. } else if (e.key === 'Tab') {
  432. const words = findWordIndices(prompt);
  433. if (words.length > 0) {
  434. const word = words.at(0);
  435. const fullPrompt = prompt;
  436. prompt = prompt.substring(0, word?.endIndex + 1);
  437. await tick();
  438. e.target.scrollTop = e.target.scrollHeight;
  439. prompt = fullPrompt;
  440. await tick();
  441. e.preventDefault();
  442. e.target.setSelectionRange(word?.startIndex, word.endIndex + 1);
  443. }
  444. }
  445. }}
  446. rows="1"
  447. on:input={(e) => {
  448. e.target.style.height = '';
  449. e.target.style.height = Math.min(e.target.scrollHeight, 200) + 'px';
  450. }}
  451. on:paste={(e) => {
  452. const clipboardData = e.clipboardData || window.clipboardData;
  453. if (clipboardData && clipboardData.items) {
  454. for (const item of clipboardData.items) {
  455. if (item.type.indexOf('image') !== -1) {
  456. const blob = item.getAsFile();
  457. const reader = new FileReader();
  458. reader.onload = function (e) {
  459. files = [
  460. ...files,
  461. {
  462. type: 'image',
  463. url: `${e.target.result}`
  464. }
  465. ];
  466. };
  467. reader.readAsDataURL(blob);
  468. }
  469. }
  470. }
  471. }}
  472. />
  473. <div class="self-end mb-2 flex space-x-0.5 mr-2">
  474. {#if messages.length == 0 || messages.at(-1).done == true}
  475. {#if speechRecognitionEnabled}
  476. <button
  477. class=" text-gray-600 dark:text-gray-300 transition rounded-lg p-1.5 mr-0.5 self-center"
  478. type="button"
  479. on:click={() => {
  480. speechRecognitionHandler();
  481. }}
  482. >
  483. {#if speechRecognitionListening}
  484. <svg
  485. class=" w-5 h-5 translate-y-[0.5px]"
  486. fill="currentColor"
  487. viewBox="0 0 24 24"
  488. xmlns="http://www.w3.org/2000/svg"
  489. ><style>
  490. .spinner_qM83 {
  491. animation: spinner_8HQG 1.05s infinite;
  492. }
  493. .spinner_oXPr {
  494. animation-delay: 0.1s;
  495. }
  496. .spinner_ZTLf {
  497. animation-delay: 0.2s;
  498. }
  499. @keyframes spinner_8HQG {
  500. 0%,
  501. 57.14% {
  502. animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
  503. transform: translate(0);
  504. }
  505. 28.57% {
  506. animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33);
  507. transform: translateY(-6px);
  508. }
  509. 100% {
  510. transform: translate(0);
  511. }
  512. }
  513. </style><circle class="spinner_qM83" cx="4" cy="12" r="2.5" /><circle
  514. class="spinner_qM83 spinner_oXPr"
  515. cx="12"
  516. cy="12"
  517. r="2.5"
  518. /><circle class="spinner_qM83 spinner_ZTLf" cx="20" cy="12" r="2.5" /></svg
  519. >
  520. {:else}
  521. <svg
  522. xmlns="http://www.w3.org/2000/svg"
  523. viewBox="0 0 20 20"
  524. fill="currentColor"
  525. class="w-5 h-5 translate-y-[0.5px]"
  526. >
  527. <path d="M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z" />
  528. <path
  529. d="M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5h-1.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z"
  530. />
  531. </svg>
  532. {/if}
  533. </button>
  534. {/if}
  535. <button
  536. class="{prompt !== ''
  537. ? 'bg-black text-white hover:bg-gray-900 dark:bg-white dark:text-black dark:hover:bg-gray-100 '
  538. : 'text-white bg-gray-100 dark:text-gray-800 dark:bg-gray-600 disabled'} transition rounded-lg p-1 mr-0.5 w-7 h-7 self-center"
  539. type="submit"
  540. disabled={prompt === ''}
  541. >
  542. <svg
  543. xmlns="http://www.w3.org/2000/svg"
  544. viewBox="0 0 20 20"
  545. fill="currentColor"
  546. class="w-5 h-5"
  547. >
  548. <path
  549. fill-rule="evenodd"
  550. d="M10 17a.75.75 0 01-.75-.75V5.612L5.29 9.77a.75.75 0 01-1.08-1.04l5.25-5.5a.75.75 0 011.08 0l5.25 5.5a.75.75 0 11-1.08 1.04l-3.96-4.158V16.25A.75.75 0 0110 17z"
  551. clip-rule="evenodd"
  552. />
  553. </svg>
  554. </button>
  555. {:else}
  556. <button
  557. class="bg-white hover:bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-800 transition rounded-lg p-1.5"
  558. on:click={stopResponse}
  559. >
  560. <svg
  561. xmlns="http://www.w3.org/2000/svg"
  562. viewBox="0 0 24 24"
  563. fill="currentColor"
  564. class="w-5 h-5"
  565. >
  566. <path
  567. fill-rule="evenodd"
  568. d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm6-2.438c0-.724.588-1.312 1.313-1.312h4.874c.725 0 1.313.588 1.313 1.313v4.874c0 .725-.588 1.313-1.313 1.313H9.564a1.312 1.312 0 01-1.313-1.313V9.564z"
  569. clip-rule="evenodd"
  570. />
  571. </svg>
  572. </button>
  573. {/if}
  574. </div>
  575. </div>
  576. </form>
  577. <div class="mt-1.5 text-xs text-gray-500 text-center">
  578. LLMs can make mistakes. Verify important information.
  579. </div>
  580. </div>
  581. </div>
  582. </div>
  583. </div>