mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-15 01:15:57 +08:00
feat: azure openai connections ui
This commit is contained in:
parent
73e64fe7fb
commit
47f8b3500b
@ -32,9 +32,13 @@
|
|||||||
|
|
||||||
let connectionType = 'external';
|
let connectionType = 'external';
|
||||||
let azure = false;
|
let azure = false;
|
||||||
|
$: azure =
|
||||||
|
url.includes('openai.azure.com') || url.includes('cognitive.microsoft.com') ? true : false;
|
||||||
|
|
||||||
let prefixId = '';
|
let prefixId = '';
|
||||||
let enable = true;
|
let enable = true;
|
||||||
|
let apiVersion = '';
|
||||||
|
|
||||||
let tags = [];
|
let tags = [];
|
||||||
|
|
||||||
let modelId = '';
|
let modelId = '';
|
||||||
@ -100,7 +104,7 @@
|
|||||||
prefix_id: prefixId,
|
prefix_id: prefixId,
|
||||||
model_ids: modelIds,
|
model_ids: modelIds,
|
||||||
connection_type: connectionType,
|
connection_type: connectionType,
|
||||||
...(!ollama && azure ? { azure: true } : {})
|
...(!ollama && azure ? { azure: true, api_version: apiVersion } : {})
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -286,6 +290,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{#if azure}
|
||||||
|
<div class="flex gap-2 mt-2">
|
||||||
|
<div class="flex flex-col w-full">
|
||||||
|
<div class=" mb-1 text-xs text-gray-500">{$i18n.t('API Version')}</div>
|
||||||
|
|
||||||
|
<div class="flex-1">
|
||||||
|
<Tooltip content={$i18n.t('Specify the API version to use')}>
|
||||||
|
<input
|
||||||
|
class="w-full text-sm bg-transparent placeholder:text-gray-300 dark:placeholder:text-gray-700 outline-hidden"
|
||||||
|
type="text"
|
||||||
|
bind:value={apiVersion}
|
||||||
|
placeholder={$i18n.t('API Version')}
|
||||||
|
autocomplete="off"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<div class="flex gap-2 mt-2">
|
<div class="flex gap-2 mt-2">
|
||||||
<div class="flex flex-col w-full">
|
<div class="flex flex-col w-full">
|
||||||
<div class=" mb-1.5 text-xs text-gray-500">{$i18n.t('Tags')}</div>
|
<div class=" mb-1.5 text-xs text-gray-500">{$i18n.t('Tags')}</div>
|
||||||
@ -342,6 +367,13 @@
|
|||||||
{$i18n.t('Leave empty to include all models from "{{url}}/api/tags" endpoint', {
|
{$i18n.t('Leave empty to include all models from "{{url}}/api/tags" endpoint', {
|
||||||
url: url
|
url: url
|
||||||
})}
|
})}
|
||||||
|
{:else if azure}
|
||||||
|
{$i18n.t(
|
||||||
|
'Leave empty to include all models from "{{url}}/openai/deployments" endpoint',
|
||||||
|
{
|
||||||
|
url: url
|
||||||
|
}
|
||||||
|
)}
|
||||||
{:else}
|
{:else}
|
||||||
{$i18n.t('Leave empty to include all models from "{{url}}/models" endpoint', {
|
{$i18n.t('Leave empty to include all models from "{{url}}/models" endpoint', {
|
||||||
url: url
|
url: url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user