"docker/git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "1895f67161010f77b847ca537e446f614f4bc5ba"
Commit a31feccd authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

feat: editable rag template frontend

parent 082d1d15
<script lang="ts">
import { getDocs } from '$lib/apis/documents';
import { getChunkParams, scanDocs, updateChunkParams } from '$lib/apis/rag';
import {
getChunkParams,
getRAGTemplate,
scanDocs,
updateChunkParams,
updateRAGTemplate
} from '$lib/apis/rag';
import { documents } from '$lib/stores';
import { onMount } from 'svelte';
import toast from 'svelte-french-toast';
......@@ -12,6 +18,8 @@
let chunkSize = 0;
let chunkOverlap = 0;
let template = '';
const scanHandler = async () => {
loading = true;
const res = await scanDocs(localStorage.token);
......@@ -25,6 +33,7 @@
const submitHandler = async () => {
const res = await updateChunkParams(localStorage.token, chunkSize, chunkOverlap);
await updateRAGTemplate(localStorage.token, template);
};
onMount(async () => {
......@@ -34,6 +43,8 @@
chunkSize = res.chunk_size;
chunkOverlap = res.chunk_overlap;
}
template = await getRAGTemplate(localStorage.token);
});
</script>
......@@ -144,6 +155,15 @@
</div>
</div>
</div>
<div>
<div class=" mb-2.5 text-sm font-medium">RAG Template</div>
<textarea
bind:value={template}
class="w-full rounded p-4 text-sm dark:text-gray-300 dark:bg-gray-800 outline-none resize-none"
rows="4"
/>
</div>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment