From 1a0332e6979dd1d1ed0886357605201a184dd208 Mon Sep 17 00:00:00 2001 From: ArtemDzhereleiko Date: Thu, 21 Aug 2025 18:54:28 +0300 Subject: [PATCH] UI: Remove schema from repsonse and fixed initial form status --- .../components/rule-node/external/ai-config.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/rule-node/external/ai-config.component.ts b/ui-ngx/src/app/modules/home/components/rule-node/external/ai-config.component.ts index 4989325801..bfba25afa1 100644 --- a/ui-ngx/src/app/modules/home/components/rule-node/external/ai-config.component.ts +++ b/ui-ngx/src/app/modules/home/components/rule-node/external/ai-config.component.ts @@ -79,6 +79,9 @@ export class AiConfigComponent extends RuleNodeConfigurationComponent { if (!this.aiConfigForm.get('systemPrompt').value) { delete config.systemPrompt; } + if (this.aiConfigForm.get('responseFormat.type').value !== ResponseFormat.JSON_SCHEMA) { + delete config.responseFormat.schema; + } return deepTrim(config); } @@ -88,10 +91,10 @@ export class AiConfigComponent extends RuleNodeConfigurationComponent { if (this.aiConfigForm.get('responseFormat.type').value !== ResponseFormat.TEXT) { this.aiConfigForm.get('responseFormat.type').patchValue(ResponseFormat.TEXT, {emitEvent: true}); } - this.aiConfigForm.get('responseFormat.type').disable(); + this.aiConfigForm.get('responseFormat.type').disable({emitEvent: false}); } } else { - this.aiConfigForm.get('responseFormat.type').enable(); + this.aiConfigForm.get('responseFormat.type').enable({emitEvent: false}); } }