UI: Add forceAck to rule node
This commit is contained in:
		
							parent
							
								
									64f0da3365
								
							
						
					
					
						commit
						f330e56aa0
					
				@ -794,7 +794,6 @@ const defaultUserMenuMap = new Map<Authority, MenuReference[]>([
 | 
				
			|||||||
      {id: MenuId.home},
 | 
					      {id: MenuId.home},
 | 
				
			||||||
      {id: MenuId.alarms},
 | 
					      {id: MenuId.alarms},
 | 
				
			||||||
      {id: MenuId.dashboards},
 | 
					      {id: MenuId.dashboards},
 | 
				
			||||||
      {id: MenuId.ai_models},
 | 
					 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        id: MenuId.entities,
 | 
					        id: MenuId.entities,
 | 
				
			||||||
        pages: [
 | 
					        pages: [
 | 
				
			||||||
@ -853,6 +852,7 @@ const defaultUserMenuMap = new Map<Authority, MenuReference[]>([
 | 
				
			|||||||
          {id: MenuId.notification_rules}
 | 
					          {id: MenuId.notification_rules}
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
 | 
					      {id: MenuId.ai_models},
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        id: MenuId.mobile_center,
 | 
					        id: MenuId.mobile_center,
 | 
				
			||||||
        pages: [
 | 
					        pages: [
 | 
				
			||||||
 | 
				
			|||||||
@ -38,14 +38,18 @@
 | 
				
			|||||||
  <div class="tb-form-panel stroked no-padding no-gap">
 | 
					  <div class="tb-form-panel stroked no-padding no-gap">
 | 
				
			||||||
    <mat-expansion-panel class="tb-settings" expanded>
 | 
					    <mat-expansion-panel class="tb-settings" expanded>
 | 
				
			||||||
      <mat-expansion-panel-header style="padding: 16px">
 | 
					      <mat-expansion-panel-header style="padding: 16px">
 | 
				
			||||||
        <mat-panel-title tb-hint-tooltip-icon="{{ 'rule-node-config.ai.prompt-settings-hint' | translate }}">
 | 
					        <mat-panel-title>
 | 
				
			||||||
          {{'rule-node-config.ai.prompt-settings' | translate}}
 | 
					          {{'rule-node-config.ai.prompt-settings' | translate}}
 | 
				
			||||||
        </mat-panel-title>
 | 
					        </mat-panel-title>
 | 
				
			||||||
      </mat-expansion-panel-header>
 | 
					      </mat-expansion-panel-header>
 | 
				
			||||||
    <div class="tb-form-panel no-border no-padding-bottom no-gap" style="margin-top: 0">
 | 
					      <div class="tb-form-panel no-border no-padding-top" style="margin-top: 0">
 | 
				
			||||||
      <mat-form-field class="flex" appearance="outline">
 | 
					        <tb-example-hint
 | 
				
			||||||
 | 
					          [hintText]="'rule-node-config.ai.prompt-settings-hint'"
 | 
				
			||||||
 | 
					          [popupHelpLink]="'rulenode/ai_node_prompt_settings'">
 | 
				
			||||||
 | 
					        </tb-example-hint>
 | 
				
			||||||
 | 
					        <mat-form-field class="flex" appearance="outline" subscriptSizing="dynamic">
 | 
				
			||||||
          <mat-label translate>rule-node-config.ai.system-prompt</mat-label>
 | 
					          <mat-label translate>rule-node-config.ai.system-prompt</mat-label>
 | 
				
			||||||
        <textarea matInput rows="2" formControlName="systemPrompt"></textarea>
 | 
					          <textarea matInput rows="4" formControlName="systemPrompt"></textarea>
 | 
				
			||||||
          <mat-error *ngIf="aiConfigForm.get('systemPrompt').hasError('maxlength')">
 | 
					          <mat-error *ngIf="aiConfigForm.get('systemPrompt').hasError('maxlength')">
 | 
				
			||||||
            {{ 'rule-node-config.ai.system-prompt-max-length' | translate }}
 | 
					            {{ 'rule-node-config.ai.system-prompt-max-length' | translate }}
 | 
				
			||||||
          </mat-error>
 | 
					          </mat-error>
 | 
				
			||||||
@ -53,9 +57,9 @@
 | 
				
			|||||||
            {{ 'rule-node-config.ai.system-prompt-blank' | translate }}
 | 
					            {{ 'rule-node-config.ai.system-prompt-blank' | translate }}
 | 
				
			||||||
          </mat-error>
 | 
					          </mat-error>
 | 
				
			||||||
        </mat-form-field>
 | 
					        </mat-form-field>
 | 
				
			||||||
      <mat-form-field class="flex" appearance="outline">
 | 
					        <mat-form-field class="flex" appearance="outline" subscriptSizing="dynamic">
 | 
				
			||||||
          <mat-label translate>rule-node-config.ai.user-prompt</mat-label>
 | 
					          <mat-label translate>rule-node-config.ai.user-prompt</mat-label>
 | 
				
			||||||
        <textarea required matInput rows="2" formControlName="userPrompt"></textarea>
 | 
					          <textarea required matInput rows="4" formControlName="userPrompt"></textarea>
 | 
				
			||||||
          <mat-error *ngIf="aiConfigForm.get('userPrompt').hasError('required')">
 | 
					          <mat-error *ngIf="aiConfigForm.get('userPrompt').hasError('required')">
 | 
				
			||||||
            {{ 'rule-node-config.ai.user-prompt-required' | translate }}
 | 
					            {{ 'rule-node-config.ai.user-prompt-required' | translate }}
 | 
				
			||||||
          </mat-error>
 | 
					          </mat-error>
 | 
				
			||||||
@ -96,7 +100,7 @@
 | 
				
			|||||||
      <mat-expansion-panel-header style="padding: 16px">
 | 
					      <mat-expansion-panel-header style="padding: 16px">
 | 
				
			||||||
        <mat-panel-title translate>rule-node-config.ai.advanced-settings</mat-panel-title>
 | 
					        <mat-panel-title translate>rule-node-config.ai.advanced-settings</mat-panel-title>
 | 
				
			||||||
      </mat-expansion-panel-header>
 | 
					      </mat-expansion-panel-header>
 | 
				
			||||||
      <div class="tb-form-panel no-border" style="margin-top: 0">
 | 
					      <div class="tb-form-panel no-border no-padding-top" style="margin-top: 0">
 | 
				
			||||||
        <div class="tb-form-row space-between flex-1 columns-xs">
 | 
					        <div class="tb-form-row space-between flex-1 columns-xs">
 | 
				
			||||||
          <div translate tb-hint-tooltip-icon="{{'rule-node-config.ai.timeout-hint' | translate}}">{{ 'rule-node-config.ai.timeout' | translate }}</div>
 | 
					          <div translate tb-hint-tooltip-icon="{{'rule-node-config.ai.timeout-hint' | translate}}">{{ 'rule-node-config.ai.timeout' | translate }}</div>
 | 
				
			||||||
          <div class="flex flex-row items-center justify-start gap-2">
 | 
					          <div class="flex flex-row items-center justify-start gap-2">
 | 
				
			||||||
@ -112,6 +116,12 @@
 | 
				
			|||||||
            </tb-time-unit-input>
 | 
					            </tb-time-unit-input>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					        <div tb-hint-tooltip-icon="{{ 'rule-node-config.ai.force-acknowledgement-hint' | translate }}"
 | 
				
			||||||
 | 
					             class="tb-form-row same-padding">
 | 
				
			||||||
 | 
					          <mat-slide-toggle class="mat-slide margin" formControlName="forceAck">
 | 
				
			||||||
 | 
					            {{ 'rule-node-config.ai.force-acknowledgement' | translate }}
 | 
				
			||||||
 | 
					          </mat-slide-toggle>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
    </mat-expansion-panel>
 | 
					    </mat-expansion-panel>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 | 
				
			|||||||
@ -54,7 +54,8 @@ export class AiConfigComponent extends RuleNodeConfigurationComponent {
 | 
				
			|||||||
        type: [configuration?.responseFormat?.type ?? ResponseFormat.JSON, []],
 | 
					        type: [configuration?.responseFormat?.type ?? ResponseFormat.JSON, []],
 | 
				
			||||||
        schema: [configuration?.responseFormat?.schema ?? null, [Validators.required]],
 | 
					        schema: [configuration?.responseFormat?.schema ?? null, [Validators.required]],
 | 
				
			||||||
      }),
 | 
					      }),
 | 
				
			||||||
      timeoutSeconds: [configuration?.timeoutSeconds ?? 60, []]
 | 
					      timeoutSeconds: [configuration?.timeoutSeconds ?? 60, []],
 | 
				
			||||||
 | 
					      forceAck: [configuration?.forceAck ?? true, []]
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					### Prompt settings
 | 
				
			||||||
@ -5453,7 +5453,9 @@
 | 
				
			|||||||
            "timeout": "Timeout",
 | 
					            "timeout": "Timeout",
 | 
				
			||||||
            "timeout-hint": "Maximum time to wait for a response \nfrom the AI model before the request is terminated.",
 | 
					            "timeout-hint": "Maximum time to wait for a response \nfrom the AI model before the request is terminated.",
 | 
				
			||||||
            "timeout-required": "Timeout is required",
 | 
					            "timeout-required": "Timeout is required",
 | 
				
			||||||
            "timeout-validation": "Must be from 1 second to 10 minutes."
 | 
					            "timeout-validation": "Must be from 1 second to 10 minutes.",
 | 
				
			||||||
 | 
					            "force-acknowledgement": "Force acknowledgement",
 | 
				
			||||||
 | 
					            "force-acknowledgement-hint": "Force acknowledgement"
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "timezone": {
 | 
					    "timezone": {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user