UI: Remove schema from repsonse and fixed initial form status
This commit is contained in:
		
							parent
							
								
									d4b3b17619
								
							
						
					
					
						commit
						1a0332e697
					
				@ -79,6 +79,9 @@ export class AiConfigComponent extends RuleNodeConfigurationComponent {
 | 
				
			|||||||
    if (!this.aiConfigForm.get('systemPrompt').value) {
 | 
					    if (!this.aiConfigForm.get('systemPrompt').value) {
 | 
				
			||||||
      delete config.systemPrompt;
 | 
					      delete config.systemPrompt;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    if (this.aiConfigForm.get('responseFormat.type').value !== ResponseFormat.JSON_SCHEMA) {
 | 
				
			||||||
 | 
					      delete config.responseFormat.schema;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    return deepTrim(config);
 | 
					    return deepTrim(config);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -88,10 +91,10 @@ export class AiConfigComponent extends RuleNodeConfigurationComponent {
 | 
				
			|||||||
        if (this.aiConfigForm.get('responseFormat.type').value !== ResponseFormat.TEXT) {
 | 
					        if (this.aiConfigForm.get('responseFormat.type').value !== ResponseFormat.TEXT) {
 | 
				
			||||||
          this.aiConfigForm.get('responseFormat.type').patchValue(ResponseFormat.TEXT, {emitEvent: true});
 | 
					          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 {
 | 
					    } else {
 | 
				
			||||||
      this.aiConfigForm.get('responseFormat.type').enable();
 | 
					      this.aiConfigForm.get('responseFormat.type').enable({emitEvent: false});
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user