@dataclouder/ngx-agent-cards 0.1.63 → 0.1.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1082,13 +1082,25 @@ function getDefaultPromptByType(conversationType) {
1082
1082
  return prompt;
1083
1083
  }
1084
1084
 
1085
+ const DEFAULT_AVATAR_IMAGES = {
1086
+ user: 'assets/defaults/avatar_user.png',
1087
+ assistant: 'assets/defaults/avatar_ai.webp',
1088
+ };
1085
1089
  class ConversationPromptBuilderService {
1086
1090
  constructor() {
1087
1091
  this.userService = inject(UserService);
1088
1092
  }
1089
1093
  // For chat conversation i need inital settings.
1090
- buildConversationSettings(agentCard, parseDict = null) {
1094
+ buildConversationSettingsFromAgentCard(agentCard, parseDict = null) {
1091
1095
  const converstionSettings = agentCard?.conversationSettings || {};
1096
+ converstionSettings.avatarImages = { ...DEFAULT_AVATAR_IMAGES }; // agent does not have avatar images so use default.
1097
+ if (agentCard?.assets?.image?.url) {
1098
+ converstionSettings.avatarImages.assistant = agentCard.assets.image.url;
1099
+ }
1100
+ if (this.userService.user().urlPicture) {
1101
+ converstionSettings.avatarImages.user = this.userService.user().urlPicture;
1102
+ }
1103
+ // Agregar avatas aqui.
1092
1104
  converstionSettings.messages = this.buildConversationMessages(agentCard, parseDict);
1093
1105
  converstionSettings.last_prompt = this.getJailBrakePrompt(agentCard);
1094
1106
  return converstionSettings;
@@ -1434,11 +1446,9 @@ const Endpoints$2 = {
1434
1446
  AgentCard: 'api/agent-cards', // For findById, getAll, save (POST/PUT), delete
1435
1447
  AgentCardQuery: 'api/agent-cards/query', // For filterConversationCards, findAgentCardByTitle
1436
1448
  UserCards: 'api/agent-cards/user-cards', // For findFilteredAgentCards
1437
- VertexTTS: 'api/vertex-adapter/tts/synthesize',
1438
1449
  ListModels: 'api/agent-cards/models', // For getListModels
1439
1450
  TranslateConversation: 'api/agent-cards/translate', // For translateConversation
1440
- TranscribeAudio: 'api/audio/transcribe/whisper', // For getAudioTranscriptions
1441
- // UserChatSettings: 'api/users/chat-settings', // Example for get/saveConversationUserChatSettings if not throwing error
1451
+ TranscribeAudio: 'api/ai-services/adapter/stt/transcribe-bytes', // For getAudioTranscriptions
1442
1452
  };
1443
1453
  // ♦️ Finish this will be the default so i dont need to create a new one everytime
1444
1454
  class DefaultAgentCardsService extends EntityCommunicationService {
@@ -1511,7 +1521,7 @@ class DefaultAgentCardsService extends EntityCommunicationService {
1511
1521
  async getAudioTranscriptions(audio, options) {
1512
1522
  // Note: Original service in agent-cards.service.ts used 'node' as host. Using 'primary'.
1513
1523
  // 'options' parameter corresponds to 'metadata' in the original service.
1514
- return this.httpService.uploadFile(`${Endpoints$2.TranscribeAudio}`, audio, options, 'primary');
1524
+ return this.httpService.uploadFile(`${Endpoints$2.TranscribeAudio}?provider=groq`, audio, options, this.appConfig.aiServicesUrl);
1515
1525
  }
1516
1526
  async callInstruction(prompt, model) {
1517
1527
  const messages = [{ content: prompt, role: ChatRole.User }];
@@ -1947,28 +1957,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
1947
1957
  }], ctorParameters: () => [] });
1948
1958
 
1949
1959
  class MessageProcessingService {
1950
- processMessage(message, conversationSettings, extraData = {}) {
1960
+ processMessage(message, conversationSettings) {
1951
1961
  const processedMessage = {
1952
1962
  ...message,
1953
1963
  messageId: message.messageId || nanoid(),
1954
1964
  };
1955
1965
  if (processedMessage.role === ChatRole.User) {
1956
- return this.processUserMessage(processedMessage, extraData);
1966
+ if (conversationSettings.avatarImages.user) {
1967
+ processedMessage.imgUrl = conversationSettings.avatarImages.user;
1968
+ }
1969
+ return processedMessage;
1957
1970
  }
1958
1971
  if (processedMessage.role === ChatRole.Assistant) {
1959
- return this.processAssistantMessage(processedMessage, conversationSettings, extraData);
1972
+ return this.processAssistantMessage(processedMessage, conversationSettings);
1960
1973
  }
1961
1974
  return processedMessage;
1962
1975
  }
1963
- processUserMessage(message, extraData) {
1964
- if (extraData.userImg) {
1965
- message.imgUrl = extraData.userImg;
1966
- }
1967
- return message;
1968
- }
1969
- processAssistantMessage(message, settings, extraData) {
1970
- if (extraData.assistantImg) {
1971
- message.imgUrl = extraData.assistantImg;
1976
+ processAssistantMessage(message, settings) {
1977
+ if (settings.avatarImages.assistant) {
1978
+ message.imgUrl = settings.avatarImages.assistant;
1972
1979
  }
1973
1980
  const mainVoice = settings?.mainVoice?.voice || settings?.tts?.voice;
1974
1981
  message.voice = this.getVoice(mainVoice);
@@ -2005,10 +2012,10 @@ class MessageProcessingService {
2005
2012
  });
2006
2013
  }
2007
2014
  processSSML(message, settings) {
2008
- if (!settings?.tts?.secondaryVoice) {
2015
+ if (!settings?.secondaryVoice?.voice) {
2009
2016
  throw new Error('Secondary voice is required for SSML');
2010
2017
  }
2011
- const content = this.subsItalicsByTag(message.content, settings.tts.secondaryVoice);
2018
+ const content = this.subsItalicsByTag(message.content, settings.secondaryVoice.voice);
2012
2019
  message.ssml = `<speak>${content}</speak>`;
2013
2020
  }
2014
2021
  splitContent(content, maxLength) {
@@ -2690,6 +2697,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
2690
2697
  }]
2691
2698
  }] });
2692
2699
 
2700
+ const DEFUALT_USER_AVATAR = 'assets/defaults/avatar_user.jpg';
2701
+ const DEFUALT_ASSISTANT_AVATAR = 'assets/defaults/avatar_ai.webp';
2693
2702
  class ConversationService {
2694
2703
  constructor() {
2695
2704
  this.defaultAgentCardService = inject(DefaultAgentCardsService);
@@ -2712,9 +2721,9 @@ class ConversationService {
2712
2721
  this.wordClickedSignal = signal(null, ...(ngDevMode ? [{ debugName: "wordClickedSignal" }] : [])); // Signal for clicked word
2713
2722
  this.agentCardSignal = signal(null, ...(ngDevMode ? [{ debugName: "agentCardSignal" }] : []));
2714
2723
  this.agentCard$ = this.agentCardSignal.asReadonly();
2715
- // Var State
2716
- this.avatarImages = { userImg: 'assets/defaults/avatar_user.png', assistantImg: 'assets/defaults/avatar_ai.webp' };
2717
2724
  }
2725
+ // Var State
2726
+ // private avatarImages = { userImg: 'assets/defaults/avatar_user.png', assistantImg: 'assets/defaults/avatar_ai.webp' };
2718
2727
  /**
2719
2728
  * Notifies subscribers that a word has been clicked in a message.
2720
2729
  * @param wordData The data associated with the clicked word.
@@ -2731,7 +2740,7 @@ class ConversationService {
2731
2740
  }
2732
2741
  createNewUserMessage() {
2733
2742
  const message = { content: '...', role: ChatRole.User };
2734
- const processedMessage = this.messageProcessingService.processMessage(message, this.conversationSettingsState(), this.avatarImages);
2743
+ const processedMessage = this.messageProcessingService.processMessage(message, this.conversationSettingsState());
2735
2744
  this.messagesStateService.addMessage(processedMessage);
2736
2745
  return processedMessage.messageId;
2737
2746
  }
@@ -2751,8 +2760,7 @@ class ConversationService {
2751
2760
  }
2752
2761
  setupConversationWithAgentCard(agentCard, parseDict = null, defaultAppConversationFlow = null) {
2753
2762
  this.agentCardSignal.set(agentCard);
2754
- this.avatarImages.assistantImg = agentCard?.assets?.image?.url || this.avatarImages.assistantImg;
2755
- const conversationSettings = this.conversationBuilder.buildConversationSettings(agentCard, parseDict);
2763
+ const conversationSettings = this.conversationBuilder.buildConversationSettingsFromAgentCard(agentCard, parseDict);
2756
2764
  this.overrideSettingsByUserSettings(conversationSettings);
2757
2765
  this.conversationSettingsState.set(conversationSettings);
2758
2766
  const conversationFlow = this.mergeConversationFlows(agentCard.conversationFlow, defaultAppConversationFlow);
@@ -2779,13 +2787,18 @@ class ConversationService {
2779
2787
  return mergedFlow;
2780
2788
  }
2781
2789
  async initConversationWithSettings(conversationSettings, conversationFlow) {
2790
+ // Assign images.
2782
2791
  this.overrideSettingsByUserSettings(conversationSettings);
2792
+ // Set default images.
2793
+ conversationSettings.avatarImages = conversationSettings.avatarImages || { user: DEFUALT_USER_AVATAR, assistant: DEFUALT_ASSISTANT_AVATAR };
2794
+ if (!conversationSettings.avatarImages?.user) {
2795
+ conversationSettings.avatarImages.user = this.userService.user().urlPicture || DEFUALT_USER_AVATAR;
2796
+ }
2783
2797
  this.conversationSettingsState.set(conversationSettings);
2784
2798
  this.dynamicFlowService.setConversationFlow(conversationFlow);
2785
2799
  await this.initConversation();
2786
2800
  }
2787
2801
  async initConversation() {
2788
- this.avatarImages.userImg = this.userService.user().urlPicture;
2789
2802
  const conversationSettings = this.conversationSettingsState();
2790
2803
  for (const i in conversationSettings.messages) {
2791
2804
  if (!conversationSettings.messages[i].messageId) {
@@ -2804,7 +2817,7 @@ class ConversationService {
2804
2817
  const firstAssistantMsg = conversationSettings.messages.find((message) => message.role === ChatRole.Assistant);
2805
2818
  if (firstAssistantMsg) {
2806
2819
  // Process the first assistant message
2807
- const processedMessage = this.messageProcessingService.processMessage(firstAssistantMsg, this.conversationSettingsState(), this.avatarImages);
2820
+ const processedMessage = this.messageProcessingService.processMessage(firstAssistantMsg, this.conversationSettingsState());
2808
2821
  this.messagesStateService.updateMessage(firstAssistantMsg.messageId, processedMessage);
2809
2822
  // Find the index of the message with the matching ID
2810
2823
  const messageIndex = conversationSettings.messages.findIndex((message) => message.messageId === firstAssistantMsg.messageId);
@@ -2853,7 +2866,7 @@ class ConversationService {
2853
2866
  }
2854
2867
  else {
2855
2868
  // Means is new meessage, Process and add the new message
2856
- const processedMessage = this.messageProcessingService.processMessage(message, this.conversationSettingsState(), this.avatarImages);
2869
+ const processedMessage = this.messageProcessingService.processMessage(message, this.conversationSettingsState());
2857
2870
  // Ensure ID exists (processMessage should handle this, but fallback just in case)
2858
2871
  processedMessage.messageId = processedMessage.messageId || nanoid();
2859
2872
  this.messagesStateService.addMessage(processedMessage);
@@ -2911,7 +2924,7 @@ class ConversationService {
2911
2924
  throw new Error('No message returned from AI');
2912
2925
  }
2913
2926
  // Process response
2914
- const newMessage = this.messageProcessingService.processMessage({ content: response.content, role: ChatRole.Assistant }, conversationSettings, this.avatarImages);
2927
+ const newMessage = this.messageProcessingService.processMessage({ content: response.content, role: ChatRole.Assistant }, conversationSettings);
2915
2928
  this.messagesStateService.addMessage(newMessage);
2916
2929
  this.isThinkingSignal.set(false);
2917
2930
  // Run Dynamic Flow Evaluations
@@ -6222,7 +6235,7 @@ class DCAgentCardFormComponent extends EntityBaseFormComponent {
6222
6235
  const imageSettings = {
6223
6236
  path: 'conversation-cards/' + this.entityId(),
6224
6237
  fileName: '',
6225
- cropSettings: { aspectRatio: AspectType.Vertical_9_16, resolutions: [ResolutionType.MediumLarge], resizeToWidth: 450 },
6238
+ cropSettings: { aspectRatio: AspectType.vertical_9_16, resolutions: [ResolutionType.MediumLarge], resizeToWidth: 450 },
6226
6239
  };
6227
6240
  return imageSettings;
6228
6241
  }
@@ -7075,11 +7088,11 @@ class ConversationRuleFormComponent extends EntityBaseFormComponent {
7075
7088
  alert('Relation selected');
7076
7089
  }
7077
7090
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationRuleFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
7078
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ConversationRuleFormComponent, isStandalone: true, selector: "app-source-form", usesInheritance: true, ngImport: i0, template: "<h3>ConversationRules Form</h3>\n\n<div class=\"source-form-card\">\n <p-card [header]=\"entityId() ? 'Edit Conversation Rule' : 'New Conversation Rule'\">\n <form [formGroup]=\"form\">\n <div style=\"display: flex; gap: 10px\">\n <div style=\"width: 100%\">\n <div class=\"form-field\">\n <label for=\"name\" class=\"block\">Name</label>\n <input pInputText id=\"name\" type=\"text\" formControlName=\"name\" placeholder=\"Enter source name\" />\n </div>\n\n <div class=\"form-field\">\n <label for=\"description\" class=\"block\">Description</label>\n <textarea id=\"description\" pTextarea formControlName=\"description\" rows=\"1\" class=\"w-full\" placeholder=\"Enter source content\"> </textarea>\n </div>\n\n <div class=\"form-field\">\n <label for=\"rule\" class=\"block\">Rule</label>\n <textarea id=\"rule\" pTextarea formControlName=\"rule\" rows=\"3\" class=\"w-full\" placeholder=\"Enter source content\"> </textarea>\n </div>\n </div>\n </div>\n </form>\n\n <div style=\"display: flex; justify-content: flex-end\">\n <p-button (click)=\"save()\" label=\"Save Rule\" [disabled]=\"!form.valid\" icon=\"pi pi-check\" iconPos=\"right\"> </p-button>\n </div>\n\n <p-dialog header=\"Search for relation\" [(visible)]=\"isDialogVisible\" [modal]=\"true\" [style]=\"{ width: '50vw' }\" draggable=\"false\">\n <app-conversationRule-list [onlyView]=\"true\" (onSelect)=\"handleRelationSelection($event)\"></app-conversationRule-list>\n </p-dialog>\n </p-card>\n</div>\n", styles: [":host{display:block;padding:1rem}.source-form-card{max-width:800px;margin:0 auto}.form-field{margin-bottom:1.5rem;display:flex;flex-direction:column}.form-field label{margin-bottom:.5rem;font-weight:500;color:#495057}.form-field input,.form-field textarea,.form-field ::ng-deep .p-element{margin-top:.25rem}:host ::ng-deep .p-card .p-card-content>div:last-child{margin-top:1.5rem;display:flex;justify-content:flex-end}:host ::ng-deep .p-card .p-card-header{background-color:#f8f9fa;padding:1rem;border-bottom:1px solid #dee2e6}h3{color:#495057;margin-bottom:1.5rem;text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CardModule }, { kind: "component", type: i2$7.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i3.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SelectModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i3$2.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: ChipModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i5$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: ConversationRuleListComponent, selector: "app-conversationRule-list" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7091
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ConversationRuleFormComponent, isStandalone: true, selector: "app-conversation-rule-form", usesInheritance: true, ngImport: i0, template: "<h3>ConversationRules Form</h3>\n\n<div class=\"source-form-card\">\n <p-card [header]=\"entityId() ? 'Edit Conversation Rule' : 'New Conversation Rule'\">\n <form [formGroup]=\"form\">\n <div style=\"display: flex; gap: 10px\">\n <div style=\"width: 100%\">\n <div class=\"form-field\">\n <label for=\"name\" class=\"block\">Name</label>\n <input pInputText id=\"name\" type=\"text\" formControlName=\"name\" placeholder=\"Enter source name\" />\n </div>\n\n <div class=\"form-field\">\n <label for=\"description\" class=\"block\">Description</label>\n <textarea id=\"description\" pTextarea formControlName=\"description\" rows=\"1\" class=\"w-full\" placeholder=\"Enter source content\"> </textarea>\n </div>\n\n <div class=\"form-field\">\n <label for=\"rule\" class=\"block\">Rule</label>\n <textarea id=\"rule\" pTextarea formControlName=\"rule\" rows=\"3\" class=\"w-full\" placeholder=\"Enter source content\"> </textarea>\n </div>\n </div>\n </div>\n </form>\n\n <div style=\"display: flex; justify-content: flex-end\">\n <p-button (click)=\"save()\" label=\"Save Rule\" [disabled]=\"!form.valid\" icon=\"pi pi-check\" iconPos=\"right\"> </p-button>\n </div>\n\n <p-dialog header=\"Search for relation\" [(visible)]=\"isDialogVisible\" [modal]=\"true\" [style]=\"{ width: '50vw' }\" draggable=\"false\">\n <app-conversationRule-list [onlyView]=\"true\" (onSelect)=\"handleRelationSelection($event)\"></app-conversationRule-list>\n </p-dialog>\n </p-card>\n</div>\n", styles: [":host{display:block;padding:1rem}.source-form-card{max-width:800px;margin:0 auto}.form-field{margin-bottom:1.5rem;display:flex;flex-direction:column}.form-field label{margin-bottom:.5rem;font-weight:500;color:#495057}.form-field input,.form-field textarea,.form-field ::ng-deep .p-element{margin-top:.25rem}:host ::ng-deep .p-card .p-card-content>div:last-child{margin-top:1.5rem;display:flex;justify-content:flex-end}:host ::ng-deep .p-card .p-card-header{background-color:#f8f9fa;padding:1rem;border-bottom:1px solid #dee2e6}h3{color:#495057;margin-bottom:1.5rem;text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: CardModule }, { kind: "component", type: i2$7.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "ngmodule", type: TextareaModule }, { kind: "directive", type: i3.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SelectModule }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i3$2.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: ChipModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i5$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "component", type: ConversationRuleListComponent, selector: "app-conversationRule-list" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7079
7092
  }
7080
7093
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationRuleFormComponent, decorators: [{
7081
7094
  type: Component,
7082
- args: [{ selector: 'app-source-form', imports: [
7095
+ args: [{ selector: 'app-conversation-rule-form', imports: [
7083
7096
  ReactiveFormsModule,
7084
7097
  CardModule,
7085
7098
  TextareaModule,
@@ -7129,6 +7142,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
7129
7142
  args: [{ selector: 'app-conversationRules', imports: [RouterModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<router-outlet />\n", styles: [":host{display:block;height:100%}\n"] }]
7130
7143
  }] });
7131
7144
 
7145
+ class ChatEngineTestComponent {
7146
+ constructor() {
7147
+ this.conversationSettings = {
7148
+ autoStart: false,
7149
+ messages: [
7150
+ { role: ChatRole.System, content: 'You are a Teacher english, you only now english and cant speak another language.' },
7151
+ { role: ChatRole.System, content: 'talk with the user and help him to learn english.' },
7152
+ { role: ChatRole.User, content: 'Hello' },
7153
+ { role: ChatRole.Assistant, content: 'Hello, its a wonderful day.' },
7154
+ ],
7155
+ // avatarImages: {
7156
+ // user: 'https://res.cloudinary.com/hcti/image/fetch/c_limit,f_auto,q_auto:good,w_400/https://docs.htmlcsstoimage.com/assets/images/cat.png',
7157
+ // assistant: 'https://pngimg.com/uploads/pokemon/pokemon_PNG129.png',
7158
+ // },
7159
+ };
7160
+ this.conversationFlow = {
7161
+ goal: { task: 'Have a simple conversation' },
7162
+ triggerTasks: {},
7163
+ dynamicConditions: [],
7164
+ moodState: { enabled: false, useAssetStatesOnly: false, detectableStates: [] },
7165
+ };
7166
+ this.agentCard = {
7167
+ name: 'Test Agent',
7168
+ description: 'This is a test agent card.',
7169
+ characterCard: {
7170
+ data: {
7171
+ name: 'Test Agent',
7172
+ description: 'This is a test agent card.',
7173
+ tags: ['test', 'dummy'],
7174
+ gender: 'other',
7175
+ hook: 'A friendly assistant for testing purposes.',
7176
+ },
7177
+ },
7178
+ };
7179
+ }
7180
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ChatEngineTestComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7181
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: ChatEngineTestComponent, isStandalone: true, selector: "dc-chat-engine-test", ngImport: i0, template: "<div class=\"chat-engine-test-container\">\n <dc-chat [conversationSettings]=\"conversationSettings\"></dc-chat>\n</div>\n", styles: [".chat-engine-test-container{width:100%;height:100vh;display:flex;justify-content:center;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: DCChatComponent, selector: "dc-chat", inputs: ["chatUserSettings", "conversationSettings", "conversationFlow", "agentCard", "parseDict"], outputs: ["chatEvent", "goalCompleted"] }] }); }
7182
+ }
7183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ChatEngineTestComponent, decorators: [{
7184
+ type: Component,
7185
+ args: [{ selector: 'dc-chat-engine-test', standalone: true, imports: [CommonModule, DCChatComponent], template: "<div class=\"chat-engine-test-container\">\n <dc-chat [conversationSettings]=\"conversationSettings\"></dc-chat>\n</div>\n", styles: [".chat-engine-test-container{width:100%;height:100vh;display:flex;justify-content:center;align-items:center}\n"] }]
7186
+ }] });
7187
+
7132
7188
  /*
7133
7189
  * Public API Surface of ngx-agent-cards
7134
7190
  */
@@ -7138,5 +7194,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
7138
7194
  * Generated bundle index. Do not edit.
7139
7195
  */
7140
7196
 
7141
- export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationRuleService, ConversationRulesComponent, ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, PromptPreviewComponent, SectionType, SystemPromptType, TextEngineOptions, TextEngines, VIDEO_PLAYER_SERVICE_TOKEN, VideoPlayerService, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
7197
+ export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEngineTestComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationRuleService, ConversationRulesComponent, ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, PromptPreviewComponent, SectionType, SystemPromptType, TextEngineOptions, TextEngines, VIDEO_PLAYER_SERVICE_TOKEN, VideoPlayerService, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
7142
7198
  //# sourceMappingURL=dataclouder-ngx-agent-cards.mjs.map