{ updateOpenAIHandler(); updateOllamaUrlsHandler(); dispatch('save'); }} >
{#if ENABLE_OPENAI_API !== null && ENABLE_OLLAMA_API !== null}
{$i18n.t('OpenAI API')}
{ updateOpenAIConfig(localStorage.token, ENABLE_OPENAI_API); }} />
{#if ENABLE_OPENAI_API}
{#each OPENAI_API_BASE_URLS as url, idx}
{#if pipelineUrls[url]}
{/if}
{#if idx === 0}
{ OPENAI_API_BASE_URLS = [...OPENAI_API_BASE_URLS, '']; OPENAI_API_KEYS = [...OPENAI_API_KEYS, '']; }} type="button" >
{:else}
{ OPENAI_API_BASE_URLS = OPENAI_API_BASE_URLS.filter( (url, urlIdx) => idx !== urlIdx ); OPENAI_API_KEYS = OPENAI_API_KEYS.filter((key, keyIdx) => idx !== keyIdx); }} type="button" >
{/if}
{ verifyOpenAIHandler(idx); }} type="button" >
{$i18n.t('WebUI will make requests to')}
'{url}/models'
{/each}
{/if}
{$i18n.t('Ollama API')}
{ updateOllamaConfig(localStorage.token, ENABLE_OLLAMA_API); if (OLLAMA_BASE_URLS.length === 0) { OLLAMA_BASE_URLS = ['']; } }} />
{#if ENABLE_OLLAMA_API}
{#each OLLAMA_BASE_URLS as url, idx}
{#if idx === 0}
{ OLLAMA_BASE_URLS = [...OLLAMA_BASE_URLS, '']; }} type="button" >
{:else}
{ OLLAMA_BASE_URLS = OLLAMA_BASE_URLS.filter( (url, urlIdx) => idx !== urlIdx ); }} type="button" >
{/if}
{ verifyOllamaHandler(idx); }} type="button" >
{/each}
{$i18n.t('Trouble accessing Ollama?')}
{$i18n.t('Click here for help.')}
{/if}
{:else}
{/if}
{$i18n.t('Save')}