|
|
|
@ -56,7 +56,7 @@ |
|
|
|
</mat-select> |
|
|
|
</mat-form-field> |
|
|
|
<div formGroupName="providerConfig" class="tb-form-panel no-border no-padding"> |
|
|
|
@if (provider === aiProvider.GITHUB_MODELS) { |
|
|
|
@if (AiModelMap.get(provider).providerFieldsList.includes('personalAccessToken')) { |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline"> |
|
|
|
<mat-label translate>ai-models.personal-access-token</mat-label> |
|
|
|
<input type="password" required matInput formControlName="personalAccessToken"> |
|
|
|
@ -65,24 +65,29 @@ |
|
|
|
{{ 'ai-models.personal-access-token-required' | translate }} |
|
|
|
</mat-error> |
|
|
|
</mat-form-field> |
|
|
|
} @else if (provider === aiProvider.GOOGLE_VERTEX_AI_GEMINI) { |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline"> |
|
|
|
} |
|
|
|
@if (AiModelMap.get(provider).providerFieldsList.includes('projectId')) { |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline" subscriptSizing="dynamic"> |
|
|
|
<mat-label translate>ai-models.project-id</mat-label> |
|
|
|
<input matInput required formControlName="projectId"> |
|
|
|
<mat-error *ngIf="aiModelForms.get('configuration').get('providerConfig').get('projectId').hasError('required')"> |
|
|
|
{{ 'ai-models.project-id-required' | translate }} |
|
|
|
</mat-error> |
|
|
|
</mat-form-field> |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline"> |
|
|
|
} |
|
|
|
@if (AiModelMap.get(provider).providerFieldsList.includes('location')) { |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline" subscriptSizing="dynamic"> |
|
|
|
<mat-label translate>ai-models.location</mat-label> |
|
|
|
<input matInput required formControlName="location"> |
|
|
|
<mat-error *ngIf="aiModelForms.get('configuration').get('providerConfig').get('location').hasError('required')"> |
|
|
|
{{ 'ai-models.location-required' | translate }} |
|
|
|
</mat-error> |
|
|
|
</mat-form-field> |
|
|
|
} |
|
|
|
@if (AiModelMap.get(provider).providerFieldsList.includes('serviceAccountKey')) { |
|
|
|
<tb-file-input formControlName="serviceAccountKey" |
|
|
|
[existingFileName]="aiModelForms.get('configuration').get('providerConfig').get('serviceAccountKeyFileName').value" |
|
|
|
(fileNameChanged)="aiModelForms.get('configuration').get('providerConfig').get('serviceAccountKeyFileName').setValue($event)" |
|
|
|
[existingFileName]="aiModelForms.get('configuration').get('providerConfig').get('fileName').value" |
|
|
|
(fileNameChanged)="aiModelForms.get('configuration').get('providerConfig').get('fileName').setValue($event)" |
|
|
|
required |
|
|
|
requiredAsError |
|
|
|
accept=".json,application/json" |
|
|
|
@ -91,20 +96,23 @@ |
|
|
|
noFileText="ai-models.no-file" |
|
|
|
dropLabel="{{'ai-models.drop-file' | translate}}"> |
|
|
|
</tb-file-input> |
|
|
|
} @else { |
|
|
|
@if (provider === aiProvider.AZURE_OPENAI) { |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline" subscriptSizing="dynamic"> |
|
|
|
<mat-label translate>ai-models.endpoint</mat-label> |
|
|
|
<input required matInput formControlName="endpoint"> |
|
|
|
<mat-error *ngIf="aiModelForms.get('configuration').get('providerConfig').get('endpoint').hasError('required')"> |
|
|
|
{{ 'ai-models.endpoint-required' | translate }} |
|
|
|
</mat-error> |
|
|
|
</mat-form-field> |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline" subscriptSizing="dynamic"> |
|
|
|
<mat-label translate>ai-models.service-version</mat-label> |
|
|
|
<input matInput formControlName="serviceVersion"> |
|
|
|
</mat-form-field> |
|
|
|
} |
|
|
|
} |
|
|
|
@if (AiModelMap.get(provider).providerFieldsList.includes('endpoint')) { |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline" subscriptSizing="dynamic"> |
|
|
|
<mat-label translate>ai-models.endpoint</mat-label> |
|
|
|
<input required matInput formControlName="endpoint"> |
|
|
|
<mat-error *ngIf="aiModelForms.get('configuration').get('providerConfig').get('endpoint').hasError('required')"> |
|
|
|
{{ 'ai-models.endpoint-required' | translate }} |
|
|
|
</mat-error> |
|
|
|
</mat-form-field> |
|
|
|
} |
|
|
|
@if (AiModelMap.get(provider).providerFieldsList.includes('serviceVersion')) { |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline" subscriptSizing="dynamic"> |
|
|
|
<mat-label translate>ai-models.service-version</mat-label> |
|
|
|
<input matInput formControlName="serviceVersion"> |
|
|
|
</mat-form-field> |
|
|
|
} |
|
|
|
@if (AiModelMap.get(provider).providerFieldsList.includes('apiKey')) { |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline"> |
|
|
|
<mat-label translate>ai-models.api-key</mat-label> |
|
|
|
<input type="password" required matInput formControlName="apiKey"> |
|
|
|
@ -128,43 +136,46 @@ |
|
|
|
[errorText]="(provider === aiProvider.AZURE_OPENAI ? 'ai-models.deployment-name-required': 'ai-models.model-id-required') | translate"> |
|
|
|
</tb-models-list-autocomplete> |
|
|
|
</section> |
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
<div tb-hint-tooltip-icon="{{ 'ai-models.temperature-hint' | translate }}"> |
|
|
|
{{ 'ai-models.temperature' | translate }} |
|
|
|
</div> |
|
|
|
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> |
|
|
|
<input matInput formControlName="temperature" |
|
|
|
type="number" min="0" step="0.1" placeholder="{{ 'ai-models.set' | translate }}"> |
|
|
|
<mat-icon matSuffix |
|
|
|
matTooltipPosition="above" |
|
|
|
matTooltipClass="tb-error-tooltip" |
|
|
|
[matTooltip]="'ai-models.temperature-min' | translate" |
|
|
|
*ngIf="aiModelForms.get('configuration').get('temperature').hasError('min')" |
|
|
|
class="tb-error"> |
|
|
|
warning |
|
|
|
</mat-icon> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
<div tb-hint-tooltip-icon="{{ 'ai-models.top-p-hint' | translate }}"> |
|
|
|
{{ 'ai-models.top-p' | translate }} |
|
|
|
@if (AiModelMap.get(provider).modelFieldsList.includes('temperature')) { |
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
<div tb-hint-tooltip-icon="{{ 'ai-models.temperature-hint' | translate }}"> |
|
|
|
{{ 'ai-models.temperature' | translate }} |
|
|
|
</div> |
|
|
|
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> |
|
|
|
<input matInput formControlName="temperature" |
|
|
|
type="number" min="0" step="0.1" placeholder="{{ 'ai-models.set' | translate }}"> |
|
|
|
<mat-icon matSuffix |
|
|
|
matTooltipPosition="above" |
|
|
|
matTooltipClass="tb-error-tooltip" |
|
|
|
[matTooltip]="'ai-models.temperature-min' | translate" |
|
|
|
*ngIf="aiModelForms.get('configuration').get('temperature').hasError('min')" |
|
|
|
class="tb-error"> |
|
|
|
warning |
|
|
|
</mat-icon> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> |
|
|
|
<input matInput formControlName="topP" |
|
|
|
type="number" min="0" step="0.1" max="1" placeholder="{{ 'ai-models.set' | translate }}"> |
|
|
|
<mat-icon matSuffix |
|
|
|
matTooltipPosition="above" |
|
|
|
matTooltipClass="tb-error-tooltip" |
|
|
|
[matTooltip]="'ai-models.top-p-min-max' | translate" |
|
|
|
*ngIf="aiModelForms.get('configuration').get('topP').hasError('min') || |
|
|
|
} |
|
|
|
@if (AiModelMap.get(provider).modelFieldsList.includes('topP')) { |
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
<div tb-hint-tooltip-icon="{{ 'ai-models.top-p-hint' | translate }}"> |
|
|
|
{{ 'ai-models.top-p' | translate }} |
|
|
|
</div> |
|
|
|
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> |
|
|
|
<input matInput formControlName="topP" |
|
|
|
type="number" min="0" step="0.1" max="1" placeholder="{{ 'ai-models.set' | translate }}"> |
|
|
|
<mat-icon matSuffix |
|
|
|
matTooltipPosition="above" |
|
|
|
matTooltipClass="tb-error-tooltip" |
|
|
|
[matTooltip]="'ai-models.top-p-min-max' | translate" |
|
|
|
*ngIf="aiModelForms.get('configuration').get('topP').hasError('min') || |
|
|
|
aiModelForms.get('configuration').get('topP').hasError('max')" |
|
|
|
class="tb-error"> |
|
|
|
warning |
|
|
|
</mat-icon> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
|
|
|
|
@if (provider === aiProvider.GOOGLE_AI_GEMINI || provider === aiProvider.GOOGLE_VERTEX_AI_GEMINI || provider === aiProvider.ANTHROPIC) { |
|
|
|
class="tb-error"> |
|
|
|
warning |
|
|
|
</mat-icon> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
@if (AiModelMap.get(provider).modelFieldsList.includes('topK')) { |
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
<div tb-hint-tooltip-icon="{{ 'ai-models.top-k-hint' | translate }}"> |
|
|
|
{{ 'ai-models.top-k' | translate }} |
|
|
|
@ -183,45 +194,48 @@ |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
|
|
|
|
@if (provider !== aiProvider.ANTHROPIC && provider !== aiProvider.AMAZON_BEDROCK) { |
|
|
|
@if (AiModelMap.get(provider).modelFieldsList.includes('presencePenalty')) { |
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
<div tb-hint-tooltip-icon="{{ 'ai-models.presence-penalty-hint' | translate }}"> |
|
|
|
{{ 'ai-models.presence-penalty' | translate }} |
|
|
|
</div> |
|
|
|
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> |
|
|
|
<input matInput formControlName="frequencyPenalty" |
|
|
|
<input matInput formControlName="presencePenalty" |
|
|
|
type="number" step="1" placeholder="{{ 'ai-models.set' | translate }}"> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
|
|
|
|
@if (AiModelMap.get(provider).modelFieldsList.includes('frequencyPenalty')) { |
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
<div tb-hint-tooltip-icon="{{ 'ai-models.frequency-penalty-hint' | translate }}"> |
|
|
|
{{ 'ai-models.frequency-penalty' | translate }} |
|
|
|
</div> |
|
|
|
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> |
|
|
|
<input matInput formControlName="presencePenalty" |
|
|
|
<input matInput formControlName="frequencyPenalty" |
|
|
|
type="number" step="1" placeholder="{{ 'ai-models.set' | translate }}"> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
|
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
<div tb-hint-tooltip-icon="{{ 'ai-models.max-output-token-hint' | translate }}"> |
|
|
|
{{ 'ai-models.max-output-token' | translate }} |
|
|
|
@if (AiModelMap.get(provider).modelFieldsList.includes('maxOutputTokens')) { |
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
<div tb-hint-tooltip-icon="{{ 'ai-models.max-output-token-hint' | translate }}"> |
|
|
|
{{ 'ai-models.max-output-token' | translate }} |
|
|
|
</div> |
|
|
|
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> |
|
|
|
<input matInput formControlName="maxOutputTokens" |
|
|
|
type="number" min="1" step="1" placeholder="{{ 'ai-models.set' | translate }}"> |
|
|
|
<mat-icon matSuffix |
|
|
|
matTooltipPosition="above" |
|
|
|
matTooltipClass="tb-error-tooltip" |
|
|
|
[matTooltip]="'ai-models.max-output-token-min' | translate" |
|
|
|
*ngIf="aiModelForms.get('configuration').get('maxOutputTokens').hasError('min')" |
|
|
|
class="tb-error"> |
|
|
|
warning |
|
|
|
</mat-icon> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
<mat-form-field appearance="outline" class="number" subscriptSizing="dynamic"> |
|
|
|
<input matInput formControlName="maxOutputTokens" |
|
|
|
type="number" min="1" step="1" placeholder="{{ 'ai-models.set' | translate }}"> |
|
|
|
<mat-icon matSuffix |
|
|
|
matTooltipPosition="above" |
|
|
|
matTooltipClass="tb-error-tooltip" |
|
|
|
[matTooltip]="'ai-models.max-output-token-min' | translate" |
|
|
|
*ngIf="aiModelForms.get('configuration').get('maxOutputTokens').hasError('min')" |
|
|
|
class="tb-error"> |
|
|
|
warning |
|
|
|
</mat-icon> |
|
|
|
</mat-form-field> |
|
|
|
</div> |
|
|
|
} |
|
|
|
</section> |
|
|
|
</section> |
|
|
|
</div> |
|
|
|
|