{editingItem ? $i18n.t('Edit Knowledge Connection') : $i18n.t('Add Knowledge Connection')}

{#if sourceForm.provider !== 'pgvector'}
{/if}
{#if sourceForm.provider === 'milvus'}
{/if}
{#if sourceForm.provider === 'pgvector'}
{/if}
{$i18n.t( 'External vectors must be generated with the same embedding model configured in Open WebUI.' )}

{ if (editingItem) { const item = editingItem; creating = true; try { await updateKnowledgeAccessGrants(localStorage.token, item.id, grants); item.access_grants = structuredClone(grants); if (editingItem === item) accessGrants = item.access_grants; toast.success($i18n.t('Saved')); } catch (error) { if (editingItem === item) accessGrants = structuredClone(item.access_grants ?? []); toast.error(`${error}`); } finally { creating = false; } } }} />
{$i18n.t('settings.admin.integrations.externalKnowledge.title')}
{#each items as item} {@const connection = connectionForItem(item)}
{' '} {item?.meta?.external?.provider ?? connection?.provider} {item?.meta?.external?.source?.name ? `ยท ${item.meta.external.source.name}` : ''}
{ toggleSource(item); }} />
{/each}
{#if loading}
{:else if items.length === 0}
{$i18n.t('No external knowledge sources configured.')}
{/if} {#if items.length === 0}
{$i18n.t('Test must pass before a source is created.')}
{/if}