2024-06-09 09:28:52 +00:00
|
|
|
<script lang="ts">
|
2024-09-27 23:36:35 +00:00
|
|
|
import { getRAGConfig, updateRAGConfig } from '$lib/apis/retrieval';
|
2024-06-09 09:28:52 +00:00
|
|
|
import Switch from '$lib/components/common/Switch.svelte';
|
|
|
|
|
|
2024-10-02 04:32:59 +00:00
|
|
|
import { models } from '$lib/stores';
|
2024-06-09 09:28:52 +00:00
|
|
|
import { onMount, getContext } from 'svelte';
|
|
|
|
|
import { toast } from 'svelte-sonner';
|
2024-06-25 12:15:29 +00:00
|
|
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
2025-02-18 02:14:26 +00:00
|
|
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
2024-06-09 09:28:52 +00:00
|
|
|
|
|
|
|
|
const i18n = getContext('i18n');
|
|
|
|
|
|
|
|
|
|
export let saveHandler: Function;
|
|
|
|
|
|
2024-06-11 22:44:36 +00:00
|
|
|
let webSearchEngines = [
|
2025-09-24 20:19:05 +00:00
|
|
|
'ollama_cloud',
|
2025-09-25 19:02:46 +00:00
|
|
|
'perplexity_search',
|
2024-06-11 22:44:36 +00:00
|
|
|
'searxng',
|
2025-04-26 18:07:13 +00:00
|
|
|
'yacy',
|
2024-06-11 22:44:36 +00:00
|
|
|
'google_pse',
|
|
|
|
|
'brave',
|
2024-12-08 05:21:10 +00:00
|
|
|
'kagi',
|
2024-10-29 14:45:38 +00:00
|
|
|
'mojeek',
|
2025-02-10 08:44:47 +00:00
|
|
|
'bocha',
|
2024-06-11 22:44:36 +00:00
|
|
|
'serpstack',
|
|
|
|
|
'serper',
|
|
|
|
|
'serply',
|
2024-08-27 07:45:17 +00:00
|
|
|
'searchapi',
|
2025-02-14 04:24:58 +00:00
|
|
|
'serpapi',
|
2024-06-14 15:14:11 +00:00
|
|
|
'duckduckgo',
|
2024-06-22 14:36:15 +00:00
|
|
|
'tavily',
|
2024-10-28 09:33:52 +00:00
|
|
|
'jina',
|
2025-02-04 18:13:05 +00:00
|
|
|
'bing',
|
2025-02-27 08:12:41 +00:00
|
|
|
'exa',
|
2025-04-10 06:51:44 +00:00
|
|
|
'perplexity',
|
2025-04-14 10:19:26 +00:00
|
|
|
'sougou',
|
2025-04-24 06:57:28 +00:00
|
|
|
'firecrawl',
|
2025-04-14 10:19:26 +00:00
|
|
|
'external'
|
2024-06-11 22:44:36 +00:00
|
|
|
];
|
2025-04-14 10:19:26 +00:00
|
|
|
let webLoaderEngines = ['playwright', 'firecrawl', 'tavily', 'external'];
|
2025-04-12 23:33:36 +00:00
|
|
|
|
|
|
|
|
let webConfig = null;
|
2024-06-09 09:28:52 +00:00
|
|
|
|
|
|
|
|
const submitHandler = async () => {
|
2025-02-05 16:14:40 +00:00
|
|
|
// Convert domain filter string to array before sending
|
2025-04-12 23:33:36 +00:00
|
|
|
if (webConfig.WEB_SEARCH_DOMAIN_FILTER_LIST) {
|
|
|
|
|
webConfig.WEB_SEARCH_DOMAIN_FILTER_LIST = webConfig.WEB_SEARCH_DOMAIN_FILTER_LIST.split(',')
|
2025-02-09 21:18:26 +00:00
|
|
|
.map((domain) => domain.trim())
|
|
|
|
|
.filter((domain) => domain.length > 0);
|
|
|
|
|
} else {
|
2025-04-12 23:33:36 +00:00
|
|
|
webConfig.WEB_SEARCH_DOMAIN_FILTER_LIST = [];
|
2025-02-09 21:18:26 +00:00
|
|
|
}
|
2025-02-05 16:14:40 +00:00
|
|
|
|
2025-04-13 04:55:50 +00:00
|
|
|
// Convert Youtube loader language string to array before sending
|
|
|
|
|
if (webConfig.YOUTUBE_LOADER_LANGUAGE) {
|
|
|
|
|
webConfig.YOUTUBE_LOADER_LANGUAGE = webConfig.YOUTUBE_LOADER_LANGUAGE.split(',')
|
|
|
|
|
.map((lang) => lang.trim())
|
|
|
|
|
.filter((lang) => lang.length > 0);
|
|
|
|
|
} else {
|
|
|
|
|
webConfig.YOUTUBE_LOADER_LANGUAGE = [];
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-09 09:28:52 +00:00
|
|
|
const res = await updateRAGConfig(localStorage.token, {
|
2025-04-12 09:13:30 +00:00
|
|
|
web: webConfig
|
2024-06-09 09:28:52 +00:00
|
|
|
});
|
2025-02-10 21:44:25 +00:00
|
|
|
|
2025-04-13 04:55:50 +00:00
|
|
|
webConfig.WEB_SEARCH_DOMAIN_FILTER_LIST = webConfig.WEB_SEARCH_DOMAIN_FILTER_LIST.join(',');
|
|
|
|
|
webConfig.YOUTUBE_LOADER_LANGUAGE = webConfig.YOUTUBE_LOADER_LANGUAGE.join(',');
|
2024-06-09 09:28:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMount(async () => {
|
|
|
|
|
const res = await getRAGConfig(localStorage.token);
|
|
|
|
|
|
|
|
|
|
if (res) {
|
|
|
|
|
webConfig = res.web;
|
2025-04-12 23:33:36 +00:00
|
|
|
|
2025-02-05 16:14:40 +00:00
|
|
|
// Convert array back to comma-separated string for display
|
2025-04-12 23:33:36 +00:00
|
|
|
if (webConfig?.WEB_SEARCH_DOMAIN_FILTER_LIST) {
|
2025-04-13 05:10:39 +00:00
|
|
|
webConfig.WEB_SEARCH_DOMAIN_FILTER_LIST = webConfig.WEB_SEARCH_DOMAIN_FILTER_LIST.join(',');
|
2025-02-05 16:14:40 +00:00
|
|
|
}
|
2025-04-12 23:33:36 +00:00
|
|
|
|
|
|
|
|
webConfig.YOUTUBE_LOADER_LANGUAGE = webConfig.YOUTUBE_LOADER_LANGUAGE.join(',');
|
2024-06-09 09:28:52 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<form
|
|
|
|
|
class="flex flex-col h-full justify-between space-y-3 text-sm"
|
|
|
|
|
on:submit|preventDefault={async () => {
|
|
|
|
|
await submitHandler();
|
|
|
|
|
saveHandler();
|
|
|
|
|
}}
|
|
|
|
|
>
|
2024-06-09 09:41:52 +00:00
|
|
|
<div class=" space-y-3 overflow-y-scroll scrollbar-hidden h-full">
|
2024-06-09 09:28:52 +00:00
|
|
|
{#if webConfig}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="">
|
|
|
|
|
<div class="mb-3">
|
2025-11-05 05:54:25 +00:00
|
|
|
<div class=" mt-0.5 mb-2.5 text-base font-medium">{$i18n.t('General')}</div>
|
2025-02-26 23:56:45 +00:00
|
|
|
|
2025-11-30 08:56:12 +00:00
|
|
|
<hr class=" border-gray-100/30 dark:border-gray-850/30 my-2" />
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class=" mb-2.5 flex w-full justify-between">
|
2024-06-09 09:28:52 +00:00
|
|
|
<div class=" self-center text-xs font-medium">
|
2025-04-12 23:33:36 +00:00
|
|
|
{$i18n.t('Web Search')}
|
2025-02-26 23:56:45 +00:00
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center relative">
|
2025-04-12 23:33:36 +00:00
|
|
|
<Switch bind:state={webConfig.ENABLE_WEB_SEARCH} />
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
2025-02-18 02:14:26 +00:00
|
|
|
</div>
|
|
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class=" mb-2.5 flex w-full justify-between">
|
|
|
|
|
<div class=" self-center text-xs font-medium">
|
|
|
|
|
{$i18n.t('Web Search Engine')}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center relative">
|
|
|
|
|
<select
|
|
|
|
|
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.WEB_SEARCH_ENGINE}
|
2025-02-26 23:56:45 +00:00
|
|
|
placeholder={$i18n.t('Select a engine')}
|
|
|
|
|
required
|
|
|
|
|
>
|
|
|
|
|
<option disabled selected value="">{$i18n.t('Select a engine')}</option>
|
|
|
|
|
{#each webSearchEngines as engine}
|
2025-08-11 18:43:29 +00:00
|
|
|
{#if engine === 'duckduckgo' || engine === 'ddgs'}
|
|
|
|
|
<option value={engine}>DDGS</option>
|
|
|
|
|
{:else}
|
|
|
|
|
<option value={engine}>{engine}</option>
|
|
|
|
|
{/if}
|
2025-02-26 23:56:45 +00:00
|
|
|
{/each}
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2025-02-21 21:40:11 +00:00
|
|
|
</div>
|
|
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
{#if webConfig.WEB_SEARCH_ENGINE !== ''}
|
2025-09-24 20:38:09 +00:00
|
|
|
{#if webConfig.WEB_SEARCH_ENGINE === 'ollama_cloud'}
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Ollama Cloud API Key')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Ollama Cloud API Key')}
|
|
|
|
|
bind:value={webConfig.OLLAMA_CLOUD_WEB_SEARCH_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-09-25 19:02:46 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'perplexity_search'}
|
2025-11-13 03:53:54 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Perplexity Search API URL')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter Perplexity Search API URL')}
|
|
|
|
|
bind:value={webConfig.PERPLEXITY_SEARCH_API_URL}
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-09-25 19:02:46 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Perplexity API Key')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Perplexity API Key')}
|
|
|
|
|
bind:value={webConfig.PERPLEXITY_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-09-24 20:38:09 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'searxng'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Searxng Query URL')}
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter Searxng Query URL')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SEARXNG_QUERY_URL}
|
2025-02-26 23:56:45 +00:00
|
|
|
autocomplete="off"
|
2025-07-01 05:08:01 +00:00
|
|
|
required
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-26 18:07:13 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'yacy'}
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
2025-04-27 01:27:55 +00:00
|
|
|
{$i18n.t('Yacy Instance URL')}
|
2025-04-26 18:07:13 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
2025-04-27 01:27:55 +00:00
|
|
|
placeholder={$i18n.t('Enter Yacy URL (e.g. http://yacy.example.com:8090)')}
|
2025-04-26 18:07:13 +00:00
|
|
|
bind:value={webConfig.YACY_QUERY_URL}
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-27 01:27:55 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div class="flex gap-2">
|
|
|
|
|
<div class="w-full">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Yacy Username')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
placeholder={$i18n.t('Enter Yacy Username')}
|
|
|
|
|
bind:value={webConfig.YACY_USERNAME}
|
|
|
|
|
required
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="w-full">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Yacy Password')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Yacy Password')}
|
|
|
|
|
bind:value={webConfig.YACY_PASSWORD}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'google_pse'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Google PSE API Key')}
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Google PSE API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.GOOGLE_PSE_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mt-1.5">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Google PSE Engine Id')}
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter Google PSE Engine Id')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.GOOGLE_PSE_ENGINE_ID}
|
2025-02-26 23:56:45 +00:00
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'brave'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Brave Search API Key')}
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Brave Search API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.BRAVE_SEARCH_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'kagi'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Kagi Search API Key')}
|
|
|
|
|
</div>
|
2024-12-08 05:21:10 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Kagi Search API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.KAGI_SEARCH_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-12-08 05:21:10 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'mojeek'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Mojeek Search API Key')}
|
|
|
|
|
</div>
|
2024-10-29 14:45:38 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Mojeek Search API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.MOJEEK_SEARCH_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-10-29 14:45:38 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'bocha'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Bocha Search API Key')}
|
|
|
|
|
</div>
|
2025-02-10 08:44:47 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Bocha Search API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.BOCHA_SEARCH_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2025-02-10 08:44:47 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'serpstack'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Serpstack API Key')}
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Serpstack API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SERPSTACK_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'serper'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Serper API Key')}
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Serper API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SERPER_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'serply'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Serply API Key')}
|
|
|
|
|
</div>
|
2024-06-10 01:52:08 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Serply API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SERPLY_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-10 01:52:08 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'tavily'}
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Tavily API Key')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Tavily API Key')}
|
|
|
|
|
bind:value={webConfig.TAVILY_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'searchapi'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('SearchApi API Key')}
|
|
|
|
|
</div>
|
2024-08-27 07:45:17 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter SearchApi API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SEARCHAPI_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
2024-08-27 07:45:17 +00:00
|
|
|
</div>
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mt-1.5">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('SearchApi Engine')}
|
|
|
|
|
</div>
|
2024-08-27 07:45:17 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter SearchApi Engine')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SEARCHAPI_ENGINE}
|
2025-02-26 23:56:45 +00:00
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2024-08-27 07:45:17 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'serpapi'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('SerpApi API Key')}
|
|
|
|
|
</div>
|
2025-02-14 04:24:58 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter SerpApi API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SERPAPI_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
2025-02-14 04:24:58 +00:00
|
|
|
</div>
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mt-1.5">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('SerpApi Engine')}
|
|
|
|
|
</div>
|
2025-02-14 04:24:58 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter SerpApi Engine')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SERPAPI_ENGINE}
|
2025-02-26 23:56:45 +00:00
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2025-02-14 04:24:58 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'jina'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Jina API Key')}
|
|
|
|
|
</div>
|
2024-11-04 01:07:24 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Jina API Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.JINA_API_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2025-02-04 18:13:05 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'bing'}
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Bing Search V7 Endpoint')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter Bing Search V7 Endpoint')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.BING_SEARCH_V7_ENDPOINT}
|
2025-02-26 23:56:45 +00:00
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-04 01:07:24 +00:00
|
|
|
</div>
|
|
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="mt-2">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Bing Search V7 Subscription Key')}
|
2024-11-04 01:07:24 +00:00
|
|
|
</div>
|
2025-02-26 23:56:45 +00:00
|
|
|
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Bing Search V7 Subscription Key')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.BING_SEARCH_V7_SUBSCRIPTION_KEY}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
2024-11-04 01:07:24 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'exa'}
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Exa API Key')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Exa API Key')}
|
|
|
|
|
bind:value={webConfig.EXA_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'perplexity'}
|
2025-06-04 20:32:48 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Perplexity API Key')}
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
|
2025-06-04 20:32:48 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Perplexity API Key')}
|
|
|
|
|
bind:value={webConfig.PERPLEXITY_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
</div>
|
2025-06-02 22:19:08 +00:00
|
|
|
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
2025-06-04 20:32:48 +00:00
|
|
|
<div>
|
|
|
|
|
<div class="self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Perplexity Model')}
|
|
|
|
|
</div>
|
|
|
|
|
<input
|
|
|
|
|
list="perplexity-model-list"
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
bind:value={webConfig.PERPLEXITY_MODEL}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<datalist id="perplexity-model-list">
|
2025-08-14 00:15:16 +00:00
|
|
|
<option value="sonar">{$i18n.t('Sonar')}</option>
|
|
|
|
|
<option value="sonar-pro">{$i18n.t('Sonar Pro')}</option>
|
|
|
|
|
<option value="sonar-reasoning">{$i18n.t('Sonar Reasoning')}</option>
|
|
|
|
|
<option value="sonar-reasoning-pro">{$i18n.t('Sonar Reasoning Pro')}</option>
|
|
|
|
|
<option value="sonar-deep-research">{$i18n.t('Sonar Deep Research')}</option>
|
2025-06-04 20:32:48 +00:00
|
|
|
</datalist>
|
2025-06-02 22:19:08 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
2025-06-04 20:32:48 +00:00
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Perplexity Search Context Usage')}
|
|
|
|
|
</div>
|
|
|
|
|
<select
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
bind:value={webConfig.PERPLEXITY_SEARCH_CONTEXT_USAGE}
|
|
|
|
|
>
|
2025-08-14 00:15:16 +00:00
|
|
|
<option value="low">{$i18n.t('Low')}</option>
|
|
|
|
|
<option value="medium">{$i18n.t('Medium')}</option>
|
|
|
|
|
<option value="high">{$i18n.t('High')}</option>
|
2025-06-04 20:32:48 +00:00
|
|
|
</select>
|
2025-06-02 22:19:08 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'sougou'}
|
2025-04-12 09:13:30 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
2025-04-12 09:13:30 +00:00
|
|
|
{$i18n.t('Sougou Search API sID')}
|
2025-02-26 23:56:45 +00:00
|
|
|
</div>
|
2024-11-04 01:07:24 +00:00
|
|
|
|
2025-04-12 09:13:30 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Sougou Search API sID')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SOUGOU_API_SID}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
2024-11-04 01:07:24 +00:00
|
|
|
</div>
|
2025-04-12 09:13:30 +00:00
|
|
|
</div>
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
2025-04-12 09:13:30 +00:00
|
|
|
{$i18n.t('Sougou Search API SK')}
|
2025-02-26 23:56:45 +00:00
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-04-12 09:13:30 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Sougou Search API SK')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.SOUGOU_API_SK}
|
2025-02-26 23:56:45 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
2025-04-24 06:57:28 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'firecrawl'}
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Firecrawl API Base URL')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter Firecrawl API Base URL')}
|
|
|
|
|
bind:value={webConfig.FIRECRAWL_API_BASE_URL}
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mt-2">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Firecrawl API Key')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Firecrawl API Key')}
|
|
|
|
|
bind:value={webConfig.FIRECRAWL_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-08-18 16:06:36 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'ddgs' || webConfig.WEB_SEARCH_ENGINE === 'duckduckgo'}
|
|
|
|
|
<div class="w-full mb-2.5">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Concurrent Requests')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
placeholder={$i18n.t('Concurrent Requests')}
|
|
|
|
|
bind:value={webConfig.WEB_SEARCH_CONCURRENT_REQUESTS}
|
|
|
|
|
required
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2025-04-14 10:19:26 +00:00
|
|
|
{:else if webConfig.WEB_SEARCH_ENGINE === 'external'}
|
2025-04-14 10:56:47 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('External Web Search URL')}
|
|
|
|
|
</div>
|
2025-04-14 10:19:26 +00:00
|
|
|
|
2025-04-14 10:56:47 +00:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter External Web Search URL')}
|
|
|
|
|
bind:value={webConfig.EXTERNAL_WEB_SEARCH_URL}
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2025-04-14 10:19:26 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-14 10:56:47 +00:00
|
|
|
|
|
|
|
|
<div class="mt-2">
|
2025-04-14 10:19:26 +00:00
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('External Web Search API Key')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter External Web Search API Key')}
|
|
|
|
|
bind:value={webConfig.EXTERNAL_WEB_SEARCH_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 09:13:30 +00:00
|
|
|
{/if}
|
|
|
|
|
{/if}
|
|
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
{#if webConfig.ENABLE_WEB_SEARCH}
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div class="flex gap-2">
|
|
|
|
|
<div class="w-full">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Search Result Count')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
placeholder={$i18n.t('Search Result Count')}
|
|
|
|
|
bind:value={webConfig.WEB_SEARCH_RESULT_COUNT}
|
|
|
|
|
required
|
|
|
|
|
/>
|
2025-04-12 09:13:30 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-02-05 16:14:40 +00:00
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div class=" text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Domain Filter List')}
|
2025-04-12 09:13:30 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
placeholder={$i18n.t(
|
2025-11-16 18:52:45 +00:00
|
|
|
'Enter domains separated by commas (e.g., example.com,site.org,!excludedsite.com)'
|
2025-04-12 23:33:36 +00:00
|
|
|
)}
|
|
|
|
|
bind:value={webConfig.WEB_SEARCH_DOMAIN_FILTER_LIST}
|
|
|
|
|
/>
|
2025-02-05 16:14:40 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{/if}
|
2025-02-05 16:14:40 +00:00
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class=" mb-2.5 flex w-full justify-between">
|
|
|
|
|
<div class=" self-center text-xs font-medium">
|
|
|
|
|
<Tooltip content={$i18n.t('Full Context Mode')} placement="top-start">
|
|
|
|
|
{$i18n.t('Bypass Embedding and Retrieval')}
|
|
|
|
|
</Tooltip>
|
2025-02-26 23:56:45 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="flex items-center relative">
|
|
|
|
|
<Tooltip
|
|
|
|
|
content={webConfig.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL
|
|
|
|
|
? $i18n.t(
|
|
|
|
|
'Inject the entire content as context for comprehensive processing, this is recommended for complex queries.'
|
|
|
|
|
)
|
|
|
|
|
: $i18n.t(
|
|
|
|
|
'Default to segmented retrieval for focused and relevant content extraction, this is recommended for most cases.'
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<Switch bind:state={webConfig.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL} />
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 09:13:30 +00:00
|
|
|
|
2025-05-22 22:30:35 +00:00
|
|
|
<div class=" mb-2.5 flex w-full justify-between">
|
|
|
|
|
<div class=" self-center text-xs font-medium">
|
|
|
|
|
<Tooltip content={$i18n.t('Bypass Web Loader')} placement="top-start">
|
|
|
|
|
{$i18n.t('Bypass Web Loader')}
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center relative">
|
|
|
|
|
<Tooltip content={''}>
|
|
|
|
|
<Switch bind:state={webConfig.BYPASS_WEB_SEARCH_WEB_LOADER} />
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class=" mb-2.5 flex w-full justify-between">
|
|
|
|
|
<div class=" self-center text-xs font-medium">
|
|
|
|
|
{$i18n.t('Trust Proxy Environment')}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center relative">
|
|
|
|
|
<Tooltip
|
|
|
|
|
content={webConfig.WEB_SEARCH_TRUST_ENV
|
|
|
|
|
? $i18n.t(
|
|
|
|
|
'Use proxy designated by http_proxy and https_proxy environment variables to fetch page contents.'
|
|
|
|
|
)
|
|
|
|
|
: $i18n.t('Use no proxy to fetch page contents.')}
|
|
|
|
|
>
|
|
|
|
|
<Switch bind:state={webConfig.WEB_SEARCH_TRUST_ENV} />
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</div>
|
2025-02-05 16:14:40 +00:00
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="mb-3">
|
2025-11-05 05:54:25 +00:00
|
|
|
<div class=" mt-0.5 mb-2.5 text-base font-medium">{$i18n.t('Loader')}</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-11-30 08:56:12 +00:00
|
|
|
<hr class=" border-gray-100/30 dark:border-gray-850/30 my-2" />
|
2024-06-09 09:28:52 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class=" mb-2.5 flex w-full justify-between">
|
2024-06-09 09:28:52 +00:00
|
|
|
<div class=" self-center text-xs font-medium">
|
2025-04-12 09:13:30 +00:00
|
|
|
{$i18n.t('Web Loader Engine')}
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class="flex items-center relative">
|
2025-04-12 09:13:30 +00:00
|
|
|
<select
|
|
|
|
|
class="dark:bg-gray-900 w-fit pr-8 rounded-sm px-2 p-1 text-xs bg-transparent outline-hidden text-right"
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.WEB_LOADER_ENGINE}
|
2025-04-12 09:13:30 +00:00
|
|
|
placeholder={$i18n.t('Select a engine')}
|
|
|
|
|
>
|
2025-04-12 23:33:36 +00:00
|
|
|
<option value="">{$i18n.t('Default')}</option>
|
2025-04-12 09:13:30 +00:00
|
|
|
{#each webLoaderEngines as engine}
|
|
|
|
|
<option value={engine}>{engine}</option>
|
|
|
|
|
{/each}
|
|
|
|
|
</select>
|
2025-02-26 23:56:45 +00:00
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
|
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
{#if webConfig.WEB_LOADER_ENGINE === '' || webConfig.WEB_LOADER_ENGINE === 'safe_web'}
|
|
|
|
|
<div class=" mb-2.5 flex w-full justify-between">
|
|
|
|
|
<div class=" self-center text-xs font-medium">
|
|
|
|
|
{$i18n.t('Verify SSL Certificate')}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center relative">
|
|
|
|
|
<Switch bind:state={webConfig.ENABLE_WEB_LOADER_SSL_VERIFICATION} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{:else if webConfig.WEB_LOADER_ENGINE === 'playwright'}
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Playwright WebSocket URL')}
|
|
|
|
|
</div>
|
2025-04-12 09:13:30 +00:00
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter Playwright WebSocket URL')}
|
|
|
|
|
bind:value={webConfig.PLAYWRIGHT_WS_URL}
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
2025-04-12 09:13:30 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
</div>
|
2025-04-12 09:13:30 +00:00
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="mt-2">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Playwright Timeout (ms)')}
|
|
|
|
|
</div>
|
2025-04-12 09:13:30 +00:00
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
placeholder={$i18n.t('Enter Playwright Timeout')}
|
|
|
|
|
bind:value={webConfig.PLAYWRIGHT_TIMEOUT}
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
2025-04-12 09:13:30 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
</div>
|
2025-04-24 06:57:28 +00:00
|
|
|
{:else if webConfig.WEB_LOADER_ENGINE === 'firecrawl' && webConfig.WEB_SEARCH_ENGINE !== 'firecrawl'}
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Firecrawl API Base URL')}
|
2025-04-12 09:13:30 +00:00
|
|
|
</div>
|
|
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter Firecrawl API Base URL')}
|
|
|
|
|
bind:value={webConfig.FIRECRAWL_API_BASE_URL}
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
2025-04-12 09:13:30 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="mt-2">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Firecrawl API Key')}
|
2025-04-12 09:13:30 +00:00
|
|
|
</div>
|
|
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Firecrawl API Key')}
|
|
|
|
|
bind:value={webConfig.FIRECRAWL_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{:else if webConfig.WEB_LOADER_ENGINE === 'tavily'}
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Tavily Extract Depth')}
|
|
|
|
|
</div>
|
2025-04-12 09:13:30 +00:00
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter Tavily Extract Depth')}
|
|
|
|
|
bind:value={webConfig.TAVILY_EXTRACT_DEPTH}
|
|
|
|
|
autocomplete="off"
|
2025-04-12 09:13:30 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
</div>
|
2025-04-12 09:13:30 +00:00
|
|
|
</div>
|
|
|
|
|
|
2025-04-12 23:33:36 +00:00
|
|
|
{#if webConfig.WEB_SEARCH_ENGINE !== 'tavily'}
|
|
|
|
|
<div class="mt-2">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Tavily API Key')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter Tavily API Key')}
|
|
|
|
|
bind:value={webConfig.TAVILY_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
2025-04-14 10:19:26 +00:00
|
|
|
{:else if webConfig.WEB_LOADER_ENGINE === 'external'}
|
|
|
|
|
<div class="mb-2.5 flex w-full flex-col">
|
|
|
|
|
<div>
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('External Web Loader URL')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex w-full">
|
|
|
|
|
<div class="flex-1">
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter External Web Loader URL')}
|
|
|
|
|
bind:value={webConfig.EXTERNAL_WEB_LOADER_URL}
|
|
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mt-2">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('External Web Loader API Key')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<SensitiveInput
|
|
|
|
|
placeholder={$i18n.t('Enter External Web Loader API Key')}
|
|
|
|
|
bind:value={webConfig.EXTERNAL_WEB_LOADER_API_KEY}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-04-12 23:33:36 +00:00
|
|
|
{/if}
|
2025-04-12 09:13:30 +00:00
|
|
|
|
2025-08-18 16:06:36 +00:00
|
|
|
<div class="mb-2.5 w-full">
|
|
|
|
|
<div class=" self-center text-xs font-medium mb-1">
|
|
|
|
|
{$i18n.t('Concurrent Requests')}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
|
|
|
|
|
placeholder={$i18n.t('Concurrent Requests')}
|
|
|
|
|
bind:value={webConfig.WEB_LOADER_CONCURRENT_REQUESTS}
|
|
|
|
|
required
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class=" mb-2.5 flex w-full justify-between">
|
|
|
|
|
<div class=" self-center text-xs font-medium">
|
|
|
|
|
{$i18n.t('Youtube Language')}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center relative">
|
2024-06-09 09:28:52 +00:00
|
|
|
<input
|
2025-02-26 23:56:45 +00:00
|
|
|
class="flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"
|
2024-06-09 09:28:52 +00:00
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter language codes')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.YOUTUBE_LOADER_LANGUAGE}
|
2024-06-09 09:28:52 +00:00
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-27 14:09:33 +00:00
|
|
|
|
2025-02-26 23:56:45 +00:00
|
|
|
<div class=" mb-2.5 flex flex-col w-full justify-between">
|
|
|
|
|
<div class=" mb-1 text-xs font-medium">
|
|
|
|
|
{$i18n.t('Youtube Proxy URL')}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex items-center relative">
|
2024-11-27 14:09:33 +00:00
|
|
|
<input
|
2025-04-12 23:33:36 +00:00
|
|
|
class="flex-1 w-full rounded-lg text-sm bg-transparent outline-hidden"
|
2024-11-27 14:09:33 +00:00
|
|
|
type="text"
|
|
|
|
|
placeholder={$i18n.t('Enter proxy URL (e.g. https://user:password@host:port)')}
|
2025-04-12 23:33:36 +00:00
|
|
|
bind:value={webConfig.YOUTUBE_LOADER_PROXY_URL}
|
2024-11-27 14:09:33 +00:00
|
|
|
autocomplete="off"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-06-09 09:28:52 +00:00
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="flex justify-end pt-3 text-sm font-medium">
|
|
|
|
|
<button
|
2024-10-21 07:05:27 +00:00
|
|
|
class="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full"
|
2024-06-09 09:28:52 +00:00
|
|
|
type="submit"
|
|
|
|
|
>
|
|
|
|
|
{$i18n.t('Save')}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|