MessageInput.svelte 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  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. files = files;
  88. }
  89. };
  90. onMount(() => {
  91. const dropZone = document.querySelector('body');
  92. dropZone?.addEventListener('dragover', (e) => {
  93. e.preventDefault();
  94. dragged = true;
  95. });
  96. dropZone.addEventListener('drop', async (e) => {
  97. e.preventDefault();
  98. console.log(e);
  99. if (e.dataTransfer?.files) {
  100. let reader = new FileReader();
  101. reader.onload = (event) => {
  102. files = [
  103. ...files,
  104. {
  105. type: 'image',
  106. url: `${event.target.result}`
  107. }
  108. ];
  109. };
  110. const inputFiles = e.dataTransfer?.files;
  111. if (inputFiles && inputFiles.length > 0) {
  112. const file = inputFiles[0];
  113. if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
  114. reader.readAsDataURL(file);
  115. } else if (['application/pdf', 'text/plain', 'text/csv'].includes(file['type'])) {
  116. uploadDoc(file);
  117. } else {
  118. toast.error(`Unsupported File Type '${file['type']}'.`);
  119. }
  120. } else {
  121. toast.error(`File not found.`);
  122. }
  123. }
  124. dragged = false;
  125. });
  126. dropZone?.addEventListener('dragleave', () => {
  127. dragged = false;
  128. });
  129. });
  130. </script>
  131. {#if dragged}
  132. <div
  133. class="fixed w-full h-full flex z-50 touch-none pointer-events-none"
  134. id="dropzone"
  135. role="region"
  136. aria-label="Drag and Drop Container"
  137. >
  138. <div class="absolute rounded-xl w-full h-full backdrop-blur bg-gray-800/40 flex justify-center">
  139. <div class="m-auto pt-64 flex flex-col justify-center">
  140. <div class="max-w-md">
  141. <div class=" text-center text-6xl mb-3">🗂️</div>
  142. <div class="text-center dark:text-white text-2xl font-semibold z-50">Add Files</div>
  143. <div class=" mt-2 text-center text-sm dark:text-gray-200 w-full">
  144. Drop any files/images here to add to the conversation
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. {/if}
  151. <div class="fixed bottom-0 w-full">
  152. <div class="px-2.5 pt-2.5 -mb-0.5 mx-auto inset-x-0 bg-transparent flex justify-center">
  153. <div class="flex flex-col max-w-3xl w-full">
  154. <div>
  155. {#if autoScroll === false && messages.length > 0}
  156. <div class=" flex justify-center mb-4">
  157. <button
  158. class=" bg-white border border-gray-100 dark:border-none dark:bg-white/20 p-1.5 rounded-full"
  159. on:click={() => {
  160. autoScroll = true;
  161. window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
  162. }}
  163. >
  164. <svg
  165. xmlns="http://www.w3.org/2000/svg"
  166. viewBox="0 0 20 20"
  167. fill="currentColor"
  168. class="w-5 h-5"
  169. >
  170. <path
  171. fill-rule="evenodd"
  172. 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"
  173. clip-rule="evenodd"
  174. />
  175. </svg>
  176. </button>
  177. </div>
  178. {/if}
  179. </div>
  180. <div class="w-full">
  181. {#if prompt.charAt(0) === '/'}
  182. <Prompts bind:this={promptsElement} bind:prompt />
  183. {:else if messages.length == 0 && suggestionPrompts.length !== 0}
  184. <Suggestions {suggestionPrompts} {submitPrompt} />
  185. {/if}
  186. </div>
  187. </div>
  188. </div>
  189. <div class="bg-white dark:bg-gray-800">
  190. <div class="max-w-3xl px-2.5 -mb-0.5 mx-auto inset-x-0">
  191. <div class="bg-gradient-to-t from-white dark:from-gray-800 from-40% pb-2">
  192. <input
  193. bind:this={filesInputElement}
  194. bind:files={inputFiles}
  195. type="file"
  196. hidden
  197. on:change={async () => {
  198. let reader = new FileReader();
  199. reader.onload = (event) => {
  200. files = [
  201. ...files,
  202. {
  203. type: 'image',
  204. url: `${event.target.result}`
  205. }
  206. ];
  207. inputFiles = null;
  208. filesInputElement.value = '';
  209. };
  210. if (inputFiles && inputFiles.length > 0) {
  211. const file = inputFiles[0];
  212. if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
  213. reader.readAsDataURL(file);
  214. } else if (['application/pdf', 'text/plain', 'text/csv'].includes(file['type'])) {
  215. uploadDoc(file);
  216. filesInputElement.value = '';
  217. } else {
  218. toast.error(`Unsupported File Type '${file['type']}'.`);
  219. inputFiles = null;
  220. }
  221. } else {
  222. toast.error(`File not found.`);
  223. }
  224. }}
  225. />
  226. <form
  227. class=" flex flex-col relative w-full rounded-xl border dark:border-gray-600 bg-white dark:bg-gray-800 dark:text-gray-100"
  228. on:submit|preventDefault={() => {
  229. submitPrompt(prompt);
  230. }}
  231. >
  232. {#if files.length > 0}
  233. <div class="mx-2 mt-2 mb-1 flex flex-wrap gap-2">
  234. {#each files as file, fileIdx}
  235. <div class=" relative group">
  236. {#if file.type === 'image'}
  237. <img src={file.url} alt="input" class=" h-16 w-16 rounded-xl object-cover" />
  238. {:else if file.type === 'doc'}
  239. <div
  240. 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"
  241. >
  242. <div class="p-2.5 bg-red-400 text-white rounded-lg">
  243. {#if file.upload_status}
  244. <svg
  245. xmlns="http://www.w3.org/2000/svg"
  246. viewBox="0 0 24 24"
  247. fill="currentColor"
  248. class="w-6 h-6"
  249. >
  250. <path
  251. fill-rule="evenodd"
  252. 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"
  253. clip-rule="evenodd"
  254. />
  255. <path
  256. 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"
  257. />
  258. </svg>
  259. {:else}
  260. <svg
  261. class=" w-6 h-6 translate-y-[0.5px]"
  262. fill="currentColor"
  263. viewBox="0 0 24 24"
  264. xmlns="http://www.w3.org/2000/svg"
  265. ><style>
  266. .spinner_qM83 {
  267. animation: spinner_8HQG 1.05s infinite;
  268. }
  269. .spinner_oXPr {
  270. animation-delay: 0.1s;
  271. }
  272. .spinner_ZTLf {
  273. animation-delay: 0.2s;
  274. }
  275. @keyframes spinner_8HQG {
  276. 0%,
  277. 57.14% {
  278. animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
  279. transform: translate(0);
  280. }
  281. 28.57% {
  282. animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33);
  283. transform: translateY(-6px);
  284. }
  285. 100% {
  286. transform: translate(0);
  287. }
  288. }
  289. </style><circle class="spinner_qM83" cx="4" cy="12" r="2.5" /><circle
  290. class="spinner_qM83 spinner_oXPr"
  291. cx="12"
  292. cy="12"
  293. r="2.5"
  294. /><circle
  295. class="spinner_qM83 spinner_ZTLf"
  296. cx="20"
  297. cy="12"
  298. r="2.5"
  299. /></svg
  300. >
  301. {/if}
  302. </div>
  303. <div class="flex flex-col justify-center -space-y-0.5">
  304. <div class=" dark:text-gray-100 text-sm font-medium line-clamp-1">
  305. {file.name}
  306. </div>
  307. <div class=" text-gray-500 text-sm">Document</div>
  308. </div>
  309. </div>
  310. {/if}
  311. <div class=" absolute -top-1 -right-1">
  312. <button
  313. class=" bg-gray-400 text-white border border-white rounded-full group-hover:visible invisible transition"
  314. type="button"
  315. on:click={() => {
  316. files.splice(fileIdx, 1);
  317. files = files;
  318. }}
  319. >
  320. <svg
  321. xmlns="http://www.w3.org/2000/svg"
  322. viewBox="0 0 20 20"
  323. fill="currentColor"
  324. class="w-4 h-4"
  325. >
  326. <path
  327. 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"
  328. />
  329. </svg>
  330. </button>
  331. </div>
  332. </div>
  333. {/each}
  334. </div>
  335. {/if}
  336. <div class=" flex">
  337. {#if fileUploadEnabled}
  338. <div class=" self-end mb-2 ml-1.5">
  339. <button
  340. class=" text-gray-600 dark:text-gray-200 transition rounded-lg p-1 ml-1"
  341. type="button"
  342. on:click={() => {
  343. filesInputElement.click();
  344. }}
  345. >
  346. <svg
  347. xmlns="http://www.w3.org/2000/svg"
  348. viewBox="0 0 20 20"
  349. fill="currentColor"
  350. class="w-5 h-5"
  351. >
  352. <path
  353. fill-rule="evenodd"
  354. 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"
  355. clip-rule="evenodd"
  356. />
  357. </svg>
  358. </button>
  359. </div>
  360. {/if}
  361. <textarea
  362. id="chat-textarea"
  363. class=" dark:bg-gray-800 dark:text-gray-100 outline-none w-full py-3 px-2 {fileUploadEnabled
  364. ? ''
  365. : ' pl-4'} rounded-xl resize-none h-[48px]"
  366. placeholder={speechRecognitionListening ? 'Listening...' : 'Send a message'}
  367. bind:value={prompt}
  368. on:keypress={(e) => {
  369. if (e.keyCode == 13 && !e.shiftKey) {
  370. e.preventDefault();
  371. }
  372. if (prompt !== '' && e.keyCode == 13 && !e.shiftKey) {
  373. submitPrompt(prompt);
  374. }
  375. }}
  376. on:keydown={async (e) => {
  377. if (prompt === '' && e.key == 'ArrowUp') {
  378. e.preventDefault();
  379. const userMessageElement = [
  380. ...document.getElementsByClassName('user-message')
  381. ]?.at(-1);
  382. const editButton = [
  383. ...document.getElementsByClassName('edit-user-message-button')
  384. ]?.at(-1);
  385. console.log(userMessageElement);
  386. userMessageElement.scrollIntoView({ block: 'center' });
  387. editButton?.click();
  388. }
  389. if (prompt.charAt(0) === '/' && e.key === 'ArrowUp') {
  390. promptsElement.selectUp();
  391. const commandOptionButton = [
  392. ...document.getElementsByClassName('selected-command-option-button')
  393. ]?.at(-1);
  394. commandOptionButton.scrollIntoView({ block: 'center' });
  395. }
  396. if (prompt.charAt(0) === '/' && e.key === 'ArrowDown') {
  397. promptsElement.selectDown();
  398. const commandOptionButton = [
  399. ...document.getElementsByClassName('selected-command-option-button')
  400. ]?.at(-1);
  401. commandOptionButton.scrollIntoView({ block: 'center' });
  402. }
  403. if (prompt.charAt(0) === '/' && e.key === 'Enter') {
  404. e.preventDefault();
  405. const commandOptionButton = [
  406. ...document.getElementsByClassName('selected-command-option-button')
  407. ]?.at(-1);
  408. commandOptionButton?.click();
  409. }
  410. if (prompt.charAt(0) === '/' && e.key === 'Tab') {
  411. e.preventDefault();
  412. const commandOptionButton = [
  413. ...document.getElementsByClassName('selected-command-option-button')
  414. ]?.at(-1);
  415. commandOptionButton?.click();
  416. } else if (e.key === 'Tab') {
  417. const words = findWordIndices(prompt);
  418. if (words.length > 0) {
  419. const word = words.at(0);
  420. const fullPrompt = prompt;
  421. prompt = prompt.substring(0, word?.endIndex + 1);
  422. await tick();
  423. e.target.scrollTop = e.target.scrollHeight;
  424. prompt = fullPrompt;
  425. await tick();
  426. e.preventDefault();
  427. e.target.setSelectionRange(word?.startIndex, word.endIndex + 1);
  428. }
  429. }
  430. }}
  431. rows="1"
  432. on:input={(e) => {
  433. e.target.style.height = '';
  434. e.target.style.height = Math.min(e.target.scrollHeight, 200) + 'px';
  435. }}
  436. on:paste={(e) => {
  437. const clipboardData = e.clipboardData || window.clipboardData;
  438. if (clipboardData && clipboardData.items) {
  439. for (const item of clipboardData.items) {
  440. if (item.type.indexOf('image') !== -1) {
  441. const blob = item.getAsFile();
  442. const reader = new FileReader();
  443. reader.onload = function (e) {
  444. files = [
  445. ...files,
  446. {
  447. type: 'image',
  448. url: `${e.target.result}`
  449. }
  450. ];
  451. };
  452. reader.readAsDataURL(blob);
  453. }
  454. }
  455. }
  456. }}
  457. />
  458. <div class="self-end mb-2 flex space-x-0.5 mr-2">
  459. {#if messages.length == 0 || messages.at(-1).done == true}
  460. {#if speechRecognitionEnabled}
  461. <button
  462. class=" text-gray-600 dark:text-gray-300 transition rounded-lg p-1.5 mr-0.5 self-center"
  463. type="button"
  464. on:click={() => {
  465. speechRecognitionHandler();
  466. }}
  467. >
  468. {#if speechRecognitionListening}
  469. <svg
  470. class=" w-5 h-5 translate-y-[0.5px]"
  471. fill="currentColor"
  472. viewBox="0 0 24 24"
  473. xmlns="http://www.w3.org/2000/svg"
  474. ><style>
  475. .spinner_qM83 {
  476. animation: spinner_8HQG 1.05s infinite;
  477. }
  478. .spinner_oXPr {
  479. animation-delay: 0.1s;
  480. }
  481. .spinner_ZTLf {
  482. animation-delay: 0.2s;
  483. }
  484. @keyframes spinner_8HQG {
  485. 0%,
  486. 57.14% {
  487. animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1);
  488. transform: translate(0);
  489. }
  490. 28.57% {
  491. animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33);
  492. transform: translateY(-6px);
  493. }
  494. 100% {
  495. transform: translate(0);
  496. }
  497. }
  498. </style><circle class="spinner_qM83" cx="4" cy="12" r="2.5" /><circle
  499. class="spinner_qM83 spinner_oXPr"
  500. cx="12"
  501. cy="12"
  502. r="2.5"
  503. /><circle class="spinner_qM83 spinner_ZTLf" cx="20" cy="12" r="2.5" /></svg
  504. >
  505. {:else}
  506. <svg
  507. xmlns="http://www.w3.org/2000/svg"
  508. viewBox="0 0 20 20"
  509. fill="currentColor"
  510. class="w-5 h-5 translate-y-[0.5px]"
  511. >
  512. <path d="M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z" />
  513. <path
  514. 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"
  515. />
  516. </svg>
  517. {/if}
  518. </button>
  519. {/if}
  520. <button
  521. class="{prompt !== ''
  522. ? 'bg-black text-white hover:bg-gray-900 dark:bg-white dark:text-black dark:hover:bg-gray-100 '
  523. : '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"
  524. type="submit"
  525. disabled={prompt === ''}
  526. >
  527. <svg
  528. xmlns="http://www.w3.org/2000/svg"
  529. viewBox="0 0 20 20"
  530. fill="currentColor"
  531. class="w-5 h-5"
  532. >
  533. <path
  534. fill-rule="evenodd"
  535. 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"
  536. clip-rule="evenodd"
  537. />
  538. </svg>
  539. </button>
  540. {:else}
  541. <button
  542. 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"
  543. on:click={stopResponse}
  544. >
  545. <svg
  546. xmlns="http://www.w3.org/2000/svg"
  547. viewBox="0 0 24 24"
  548. fill="currentColor"
  549. class="w-5 h-5"
  550. >
  551. <path
  552. fill-rule="evenodd"
  553. 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"
  554. clip-rule="evenodd"
  555. />
  556. </svg>
  557. </button>
  558. {/if}
  559. </div>
  560. </div>
  561. </form>
  562. <div class="mt-1.5 text-xs text-gray-500 text-center">
  563. LLMs can make mistakes. Verify important information.
  564. </div>
  565. </div>
  566. </div>
  567. </div>
  568. </div>