@progress/kendo-angular-conversational-ui
Version:
Kendo UI for Angular Conversational UI components
41 lines (40 loc) • 1.75 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import * as i0 from "@angular/core";
/**
* @hidden
*/
export class AIPromptService {
aiPrompt;
promptValue = '';
showOutputRating = false;
requestEvent = new Subject();
executeEvent = new Subject();
outputCopyEvent = new Subject();
outputRatingChangeEvent = new Subject();
promptCommands;
promptOutputs;
promptSuggestions;
getFlattenPromptCommands(commands = this.promptCommands) {
let newArr = [];
commands.forEach(c => {
if (c.hasOwnProperty('children')) {
const childrenArr = c.children;
newArr = newArr.concat(childrenArr);
if (childrenArr.length > 0) {
this.getFlattenPromptCommands(childrenArr);
}
}
});
return newArr.concat(this.promptCommands);
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptService });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: AIPromptService, decorators: [{
type: Injectable
}] });