Skip to content

Commit

Permalink
feat: primary agent not sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
meta-d committed Dec 13, 2024
1 parent 82aaa73 commit 6a37d8b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,20 @@
(promptChange)="onPromptChange($event)"
/>

<div class="w-full flex justify-end p-4 bg-gray-50 rounded-xl">
<mat-slide-toggle [ngModel]="isSensitive()" (ngModelChange)="updateSensitive($event)"
labelPosition="before"
ngm-density="xs"
[matTooltip]="'PAC.Xpert.SensitiveAgentTip' | translate: {Default: 'Sensitive agents require user confirmation before execution'}"
matTooltipPosition="above"
>{{'PAC.Xpert.Sensitive' | translate: {Default: 'Sensitive'} }}</mat-slide-toggle>
</div>
@if (!isPrimaryAgent()) {
<div class="w-full flex justify-between p-3 bg-gray-50 rounded-xl">
<div class="flex items-center space-x-1 shrink-0">
<div class="flex items-center justify-center w-6 h-6"><i class="ri-shield-keyhole-fill text-base text-orange-600"></i></div>
<div class="text-sm font-semibold text-gray-800">{{'PAC.Xpert.Sensitive' | translate: {Default: 'Sensitive'} }}</div>
</div>
<mat-slide-toggle [ngModel]="isSensitive()" (ngModelChange)="updateSensitive($event)"
labelPosition="before"
ngm-density="xs"
[matTooltip]="'PAC.Xpert.SensitiveAgentTip' | translate: {Default: 'Sensitive agents require user confirmation before execution'}"
matTooltipPosition="above"
></mat-slide-toggle>
</div>
}

<xpert-parameters-edit [ngModel]="parameters()" (ngModelChange)="onParameters($event)" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class XpertStudioPanelAgentComponent {
readonly agentUniqueName = computed(() => agentUniqueName(this.xpertAgent()))
readonly agentConfig = computed(() => this.xpert()?.agentConfig)
readonly isSensitive = computed(() => this.agentConfig()?.interruptBefore?.includes(this.agentUniqueName()))
readonly isPrimaryAgent = computed(() => this.key() === this.xpert()?.agent?.key)

readonly parameters = computed(() => this.xpertAgent()?.parameters)

Expand Down

0 comments on commit 6a37d8b

Please sign in to comment.