From 22dc482b9ee43672ad99138833929de1e5c9aa33 Mon Sep 17 00:00:00 2001 From: ArtemDzhereleiko Date: Tue, 30 Sep 2025 09:47:30 +0300 Subject: [PATCH 1/2] UI: Add baseUrl for openAI provider --- .../ai-model/ai-model-dialog.component.html | 24 +++++++++--------- .../ai-model/ai-model-dialog.component.ts | 25 ++++++++++++++++++- .../src/app/shared/models/ai-model.models.ts | 2 +- .../assets/locale/locale.constant-en_US.json | 1 + 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.html b/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.html index abfe8500b4..5aa323fe7d 100644 --- a/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.html @@ -116,14 +116,24 @@ } + @if (providerFieldsList.includes('baseUrl')) { + + ai-models.baseurl + + + {{ 'ai-models.baseurl-required' | translate }} + + + } @if (providerFieldsList.includes('apiKey')) { ai-models.api-key - + - {{ 'ai-models.api-key-required' | translate }} + {{ ( provider === aiProvider.OPENAI ? 'ai-models.api-key-open-ai-required' : 'ai-models.api-key-required') | translate }} } @@ -158,16 +168,6 @@ } - @if (providerFieldsList.includes('baseUrl')) { - - ai-models.baseurl - - - {{ 'ai-models.baseurl-required' | translate }} - - - } @if (provider === aiProvider.OLLAMA) {
diff --git a/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.ts b/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.ts index 9d0d28e627..935f35ab5f 100644 --- a/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.ts @@ -74,6 +74,8 @@ export class AIModelDialogComponent extends DialogComponent, protected router: Router, protected dialogRef: MatDialogRef, @@ -107,7 +109,7 @@ export class AIModelDialogComponent extends DialogComponent { + if (this.provider === AiProvider.OPENAI) { + this.updateApiKeyValidatorForOpenAIProvider(url); + } }); this.aiModelForms.get('configuration.providerConfig.auth.type').valueChanges.pipe( @@ -161,6 +175,15 @@ export class AIModelDialogComponent extends DialogComponent Date: Tue, 30 Sep 2025 10:34:37 +0300 Subject: [PATCH 2/2] UI: Add for apiKey required value --- .../home/components/ai-model/ai-model-dialog.component.html | 2 +- .../home/components/ai-model/ai-model-dialog.component.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.html b/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.html index 5aa323fe7d..44fe9dcda7 100644 --- a/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.html @@ -129,7 +129,7 @@ @if (providerFieldsList.includes('apiKey')) { ai-models.api-key - + diff --git a/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.ts b/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.ts index 935f35ab5f..02f18e60b5 100644 --- a/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai-model/ai-model-dialog.component.ts @@ -74,6 +74,7 @@ export class AIModelDialogComponent extends DialogComponent, @@ -178,8 +179,10 @@ export class AIModelDialogComponent extends DialogComponent