diff --git a/src/lib/components/AddConnectionModal.svelte b/src/lib/components/AddConnectionModal.svelte index 629f19f1b..628adf263 100644 --- a/src/lib/components/AddConnectionModal.svelte +++ b/src/lib/components/AddConnectionModal.svelte @@ -32,9 +32,13 @@ let connectionType = 'external'; let azure = false; + $: azure = + url.includes('openai.azure.com') || url.includes('cognitive.microsoft.com') ? true : false; let prefixId = ''; let enable = true; + let apiVersion = ''; + let tags = []; let modelId = ''; @@ -100,7 +104,7 @@ prefix_id: prefixId, model_ids: modelIds, connection_type: connectionType, - ...(!ollama && azure ? { azure: true } : {}) + ...(!ollama && azure ? { azure: true, api_version: apiVersion } : {}) } }; @@ -286,6 +290,27 @@ + {#if azure} +
+
+
{$i18n.t('API Version')}
+ +
+ + + +
+
+
+ {/if} +
{$i18n.t('Tags')}
@@ -342,6 +367,13 @@ {$i18n.t('Leave empty to include all models from "{{url}}/api/tags" endpoint', { url: url })} + {:else if azure} + {$i18n.t( + 'Leave empty to include all models from "{{url}}/openai/deployments" endpoint', + { + url: url + } + )} {:else} {$i18n.t('Leave empty to include all models from "{{url}}/models" endpoint', { url: url