Browse Source
Merge pull request #13904 from ArtemDzhereleiko/AD/bug-fix/ai-node/response-schema
Remove schema from response and fixed initial form status
pull/13927/head
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
5 additions and
2 deletions
-
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}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|