@dataclouder/ngx-agent-cards 0.1.67 → 0.1.69

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.
@@ -1,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, inject, signal, computed, RendererFactory2, ApplicationRef, Injector, EnvironmentInjector, createComponent, ChangeDetectionStrategy, Component, output, Input, input, effect, ViewChild, DestroyRef, ElementRef, Pipe, ChangeDetectorRef, EventEmitter, Output } from '@angular/core';
2
+ import { InjectionToken, Injectable, inject, signal, computed, RendererFactory2, ApplicationRef, Injector, EnvironmentInjector, createComponent, ChangeDetectionStrategy, Component, output, Input, input, effect, ViewChild, DestroyRef, HostBinding, ElementRef, Pipe, ChangeDetectorRef, EventEmitter, Output } from '@angular/core';
3
3
  import * as i1 from '@dataclouder/ngx-core';
4
4
  import { MoodStateOptions, LANGUAGES, EntityCommunicationService, TOAST_ALERTS_TOKEN, APP_CONFIG, AudioSpeed as AudioSpeed$1, LoadingBarService, EModelQuality, getLangDesc, AudioSpeedReverse, formatCamelCaseString, getSupportedLanguageOptions, AudioNotificationService, MoodState, SUPPORTED_LANGUAGES, FormUtilsService, EntityBaseFormComponent, DcManageableFormComponent, DcLearnableFormComponent, EntityBaseListComponent, DCFilterBarComponent, QuickTableComponent, EmptyStateComponent } from '@dataclouder/ngx-core';
5
5
  import { UserService } from '@dataclouder/ngx-users';
6
+ import { AiWhisperService, TtsService, NgxAiServicesService, GeneratedAssetsService, VoiceSelectorComponent } from '@dataclouder/ngx-ai-services';
6
7
  import * as i2$1 from '@angular/common';
7
8
  import { DOCUMENT, CommonModule, DecimalPipe, KeyValuePipe, DatePipe, SlicePipe, JsonPipe } from '@angular/common';
8
9
  import { nanoid } from 'nanoid';
9
- import { TtsService, NgxVertexService, GeneratedAssetsService, VoiceSelectorComponent } from '@dataclouder/ngx-vertex';
10
10
  import { DynamicDialogRef, DynamicDialogConfig, DialogService, DynamicDialogModule } from 'primeng/dynamicdialog';
11
11
  import * as i2 from 'primeng/button';
12
12
  import { ButtonModule } from 'primeng/button';
@@ -1458,6 +1458,7 @@ class DefaultAgentCardsService extends EntityCommunicationService {
1458
1458
  this.userService = inject(UserService);
1459
1459
  this.toastService = inject(TOAST_ALERTS_TOKEN);
1460
1460
  this.appConfig = inject(APP_CONFIG);
1461
+ this.whisperService = inject(AiWhisperService);
1461
1462
  this.randomSeed = Math.floor(Math.random() * 100000);
1462
1463
  }
1463
1464
  partialUpdateAgentCard(agentCard) {
@@ -1521,7 +1522,8 @@ class DefaultAgentCardsService extends EntityCommunicationService {
1521
1522
  async getAudioTranscriptions(audio, options) {
1522
1523
  // Note: Original service in agent-cards.service.ts used 'node' as host. Using 'primary'.
1523
1524
  // 'options' parameter corresponds to 'metadata' in the original service.
1524
- return this.httpService.uploadFile(`${Endpoints$2.TranscribeAudio}?provider=groq`, audio, options, this.appConfig.aiServicesUrl);
1525
+ return this.whisperService.transcribeBytes(audio, options);
1526
+ // return this.httpService.uploadFile<TranscriptionsWhisper>(`${Endpoints.TranscribeAudio}?provider=groq`, audio, options, this.appConfig.aiServicesUrl);
1525
1527
  }
1526
1528
  async callInstruction(prompt, model) {
1527
1529
  const messages = [{ content: prompt, role: ChatRole.User }];
@@ -1958,7 +1960,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
1958
1960
 
1959
1961
  class MessageProcessingService {
1960
1962
  processMessage(message, conversationSettings) {
1961
- console.log('processMessage conversation data', conversationSettings);
1962
1963
  const processedMessage = {
1963
1964
  ...message,
1964
1965
  messageId: message.messageId || nanoid(),
@@ -1972,7 +1973,6 @@ class MessageProcessingService {
1972
1973
  if (processedMessage.role === ChatRole.Assistant) {
1973
1974
  return this.processAssistantMessage(processedMessage, conversationSettings);
1974
1975
  }
1975
- console.log('processMessage processedMessage', processedMessage);
1976
1976
  return processedMessage;
1977
1977
  }
1978
1978
  processAssistantMessage(message, settings) {
@@ -2628,13 +2628,10 @@ ${task.task}
2628
2628
  });
2629
2629
  }
2630
2630
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EvaluationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2631
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EvaluationService, providedIn: 'root' }); }
2631
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EvaluationService }); }
2632
2632
  }
2633
2633
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: EvaluationService, decorators: [{
2634
- type: Injectable,
2635
- args: [{
2636
- providedIn: 'root',
2637
- }]
2634
+ type: Injectable
2638
2635
  }] });
2639
2636
 
2640
2637
  class DynamicFlowTaskService {
@@ -2690,13 +2687,10 @@ class DynamicFlowTaskService {
2690
2687
  }
2691
2688
  }
2692
2689
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DynamicFlowTaskService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2693
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DynamicFlowTaskService, providedIn: 'root' }); }
2690
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DynamicFlowTaskService }); }
2694
2691
  }
2695
2692
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DynamicFlowTaskService, decorators: [{
2696
- type: Injectable,
2697
- args: [{
2698
- providedIn: 'root',
2699
- }]
2693
+ type: Injectable
2700
2694
  }] });
2701
2695
 
2702
2696
  const DEFUALT_USER_AVATAR = 'assets/defaults/avatar_user.jpg';
@@ -2741,10 +2735,8 @@ class ConversationService {
2741
2735
  return this.wordClickedSignal;
2742
2736
  }
2743
2737
  createNewUserMessage() {
2744
- debugger;
2745
2738
  const message = { content: '...', role: ChatRole.User };
2746
2739
  const processedMessage = this.messageProcessingService.processMessage(message, this.conversationSettingsState());
2747
- console.log('processedMessage before add to state', processedMessage);
2748
2740
  this.messagesStateService.addMessage(processedMessage);
2749
2741
  return processedMessage.messageId;
2750
2742
  }
@@ -2798,7 +2790,6 @@ class ConversationService {
2798
2790
  if (!conversationSettings.avatarImages?.user) {
2799
2791
  conversationSettings.avatarImages.user = this.userService.user().urlPicture || DEFUALT_USER_AVATAR;
2800
2792
  }
2801
- console.log('initConversationWithSettings final antes de set', conversationSettings);
2802
2793
  this.conversationSettingsState.set(conversationSettings);
2803
2794
  this.dynamicFlowService.setConversationFlow(conversationFlow);
2804
2795
  await this.initConversation();
@@ -2822,7 +2813,6 @@ class ConversationService {
2822
2813
  const firstAssistantMsg = conversationSettings.messages.find((message) => message.role === ChatRole.Assistant);
2823
2814
  if (firstAssistantMsg) {
2824
2815
  // Process the first assistant message
2825
- debugger;
2826
2816
  const processedMessage = this.messageProcessingService.processMessage(firstAssistantMsg, this.conversationSettingsState());
2827
2817
  this.messagesStateService.updateMessage(firstAssistantMsg.messageId, processedMessage);
2828
2818
  // Find the index of the message with the matching ID
@@ -2959,18 +2949,15 @@ class ConversationService {
2959
2949
  return this.ttsService.getTextAudioFile(ttsRequest);
2960
2950
  }
2961
2951
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2962
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationService, providedIn: 'root' }); }
2952
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationService }); }
2963
2953
  }
2964
2954
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationService, decorators: [{
2965
- type: Injectable,
2966
- args: [{
2967
- providedIn: 'root',
2968
- }]
2955
+ type: Injectable
2969
2956
  }] });
2970
2957
 
2971
2958
  class AIGenerationService {
2972
2959
  constructor() {
2973
- this.vertexService = inject(NgxVertexService);
2960
+ this.vertexService = inject(NgxAiServicesService);
2974
2961
  this.messagesStateService = inject(MessagesStateService);
2975
2962
  this.conversationService = inject(ConversationService);
2976
2963
  }
@@ -3483,10 +3470,14 @@ function extractTags(text) {
3483
3470
  }
3484
3471
 
3485
3472
  class MessageContentDisplayer {
3473
+ get hostHighlightColor() {
3474
+ return this.highlightColor();
3475
+ }
3486
3476
  constructor() {
3487
3477
  // Inputs
3488
3478
  this.message = input.required(...(ngDevMode ? [{ debugName: "message" }] : []));
3489
3479
  this.markWord = input(...(ngDevMode ? [undefined, { debugName: "markWord" }] : []));
3480
+ this.highlightColor = input(...(ngDevMode ? [undefined, { debugName: "highlightColor" }] : []));
3490
3481
  // Outputs
3491
3482
  this.playAudio = output();
3492
3483
  this.audioCompleted = output();
@@ -3688,13 +3679,25 @@ class MessageContentDisplayer {
3688
3679
  console.log('debug', this.wordWithMeta());
3689
3680
  }
3690
3681
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: MessageContentDisplayer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3691
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: MessageContentDisplayer, isStandalone: true, selector: "message-content-displayer", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, markWord: { classPropertyName: "markWord", publicName: "markWord", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { playAudio: "playAudio", audioCompleted: "audioCompleted", wordClicked: "wordClicked" }, ngImport: i0, template: "<div class=\"audio-text-sync-container\">\n <i (click)=\"onPlayMessage()\" class=\"play-button\">\n @switch (iconState()) { @case ('loading') { <i class=\"spin-animation pi pi-spinner-dotted\"></i> } @case ('playing') { <i class=\"pi pi-volume-up\"></i> }\n @case ('paused') { <i class=\"pi pi-pause-circle\"></i> } @case ('playable') { <dc-icon name=\"play\"></dc-icon> } }\n </i>\n\n <!-- Display transcription with highlighting -->\n <p style=\"width: 100%\" [class]=\"'text-content ' + classTag()\">\n @for (word of wordWithMeta(); track trackByIndex($index, word)) {\n <span\n [class]=\"word.tag\"\n [class.highlight]=\"word.isHighlighted\"\n [class.marked]=\"word.marked\"\n (click)=\"onWordClick(word)\"\n [attr.id]=\"'word-' + message().messageId + '-' + word.index\"\n >{{ word.word }}\n </span>\n }\n </p>\n</div>\n", styles: [":host{display:block}.audio-text-sync-container{display:flex;align-items:flex-start;gap:2px;align-items:center}.play-button{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;margin-top:4px}.play-button:hover{opacity:.8}.text-content{flex:1}.highlight{background-color:#3cd8ff;border-radius:4px}::ng-deep .marked{position:relative;color:#f8bfbc}::ng-deep .marked:before{content:\"\";z-index:-2;left:-.1em;top:.1em;border-width:2px;border-style:solid;border-color:#f27068;position:absolute;border-right-color:transparent;width:100%;height:1em;transform:rotate(2deg);opacity:.7;border-radius:50%;padding:.1em .25em}::ng-deep .marked:after{content:\"\";z-index:-1;left:-.1em;top:.4em;padding:.1em .25em;border-width:2px;border-style:solid;border-color:#f27068;border-left-color:transparent;border-top-color:transparent;position:absolute;width:100%;height:1em;transform:rotate(-1deg);opacity:.7;border-radius:50%}.spin-animation{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.em{font-style:italic;color:#b8d0fc}.strong{font-weight:700;color:inherit}.italic{font-style:italic;color:#0d5cf0}.em_strong{font-weight:700;font-style:italic;color:inherit}\n"], dependencies: [{ kind: "component", type: IconsComponent, selector: "dc-icon", inputs: ["name", "size", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3682
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: MessageContentDisplayer, isStandalone: true, selector: "message-content-displayer", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, markWord: { classPropertyName: "markWord", publicName: "markWord", isSignal: true, isRequired: false, transformFunction: null }, highlightColor: { classPropertyName: "highlightColor", publicName: "highlightColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { playAudio: "playAudio", audioCompleted: "audioCompleted", wordClicked: "wordClicked" }, host: { properties: { "style.--highlight-bg-color": "this.hostHighlightColor" } }, ngImport: i0, template: "<div class=\"audio-text-sync-container\">\n <i (click)=\"onPlayMessage()\" class=\"play-button\">\n @switch (iconState()) { @case ('loading') { <i class=\"spin-animation pi pi-spinner-dotted\"></i> } @case ('playing') { <i class=\"pi pi-volume-up\"></i> }\n @case ('paused') { <i class=\"pi pi-pause-circle\"></i> } @case ('playable') { <dc-icon name=\"play\"></dc-icon> } }\n </i>\n\n <!-- Display transcription with highlighting -->\n <p style=\"width: 100%\" [class]=\"'text-content ' + classTag()\">\n @for (word of wordWithMeta(); track trackByIndex($index, word)) {\n <span\n [class]=\"word.tag\"\n [class.highlight]=\"word.isHighlighted\"\n [class.marked]=\"word.marked\"\n (click)=\"onWordClick(word)\"\n [attr.id]=\"'word-' + message().messageId + '-' + word.index\"\n >{{ word.word }}\n </span>\n }\n </p>\n</div>\n@if (message().imageUrl) {\n<div class=\"tour-image-container\" style=\"display: flex; justify-content: center\">\n <img [src]=\"message().imageUrl\" alt=\"Tour Image\" style=\"max-width: 220px; height: auto\" />\n</div>\n}\n", styles: [":host{display:block}.audio-text-sync-container{display:flex;align-items:flex-start;gap:2px;align-items:center}.play-button{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;margin-top:4px}.play-button:hover{opacity:.8}.text-content{flex:1}.highlight{background-color:var(--highlight-bg-color, rgb(60, 216, 255));border-radius:4px}::ng-deep .marked{position:relative;color:#f8bfbc}::ng-deep .marked:before{content:\"\";z-index:-2;left:-.1em;top:.1em;border-width:2px;border-style:solid;border-color:#f27068;position:absolute;border-right-color:transparent;width:100%;height:1em;transform:rotate(2deg);opacity:.7;border-radius:50%;padding:.1em .25em}::ng-deep .marked:after{content:\"\";z-index:-1;left:-.1em;top:.4em;padding:.1em .25em;border-width:2px;border-style:solid;border-color:#f27068;border-left-color:transparent;border-top-color:transparent;position:absolute;width:100%;height:1em;transform:rotate(-1deg);opacity:.7;border-radius:50%}.spin-animation{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.em{font-style:italic;color:#b8d0fc}.strong{font-weight:700;color:inherit}.italic{font-style:italic;color:#0d5cf0}.em_strong{font-weight:700;font-style:italic;color:inherit}\n"], dependencies: [{ kind: "component", type: IconsComponent, selector: "dc-icon", inputs: ["name", "size", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3692
3683
  }
3693
3684
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: MessageContentDisplayer, decorators: [{
3694
3685
  type: Component,
3695
- args: [{ selector: 'message-content-displayer', standalone: true, imports: [IconsComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"audio-text-sync-container\">\n <i (click)=\"onPlayMessage()\" class=\"play-button\">\n @switch (iconState()) { @case ('loading') { <i class=\"spin-animation pi pi-spinner-dotted\"></i> } @case ('playing') { <i class=\"pi pi-volume-up\"></i> }\n @case ('paused') { <i class=\"pi pi-pause-circle\"></i> } @case ('playable') { <dc-icon name=\"play\"></dc-icon> } }\n </i>\n\n <!-- Display transcription with highlighting -->\n <p style=\"width: 100%\" [class]=\"'text-content ' + classTag()\">\n @for (word of wordWithMeta(); track trackByIndex($index, word)) {\n <span\n [class]=\"word.tag\"\n [class.highlight]=\"word.isHighlighted\"\n [class.marked]=\"word.marked\"\n (click)=\"onWordClick(word)\"\n [attr.id]=\"'word-' + message().messageId + '-' + word.index\"\n >{{ word.word }}\n </span>\n }\n </p>\n</div>\n", styles: [":host{display:block}.audio-text-sync-container{display:flex;align-items:flex-start;gap:2px;align-items:center}.play-button{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;margin-top:4px}.play-button:hover{opacity:.8}.text-content{flex:1}.highlight{background-color:#3cd8ff;border-radius:4px}::ng-deep .marked{position:relative;color:#f8bfbc}::ng-deep .marked:before{content:\"\";z-index:-2;left:-.1em;top:.1em;border-width:2px;border-style:solid;border-color:#f27068;position:absolute;border-right-color:transparent;width:100%;height:1em;transform:rotate(2deg);opacity:.7;border-radius:50%;padding:.1em .25em}::ng-deep .marked:after{content:\"\";z-index:-1;left:-.1em;top:.4em;padding:.1em .25em;border-width:2px;border-style:solid;border-color:#f27068;border-left-color:transparent;border-top-color:transparent;position:absolute;width:100%;height:1em;transform:rotate(-1deg);opacity:.7;border-radius:50%}.spin-animation{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.em{font-style:italic;color:#b8d0fc}.strong{font-weight:700;color:inherit}.italic{font-style:italic;color:#0d5cf0}.em_strong{font-weight:700;font-style:italic;color:inherit}\n"] }]
3696
- }], ctorParameters: () => [] });
3686
+ args: [{ selector: 'message-content-displayer', standalone: true, imports: [IconsComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"audio-text-sync-container\">\n <i (click)=\"onPlayMessage()\" class=\"play-button\">\n @switch (iconState()) { @case ('loading') { <i class=\"spin-animation pi pi-spinner-dotted\"></i> } @case ('playing') { <i class=\"pi pi-volume-up\"></i> }\n @case ('paused') { <i class=\"pi pi-pause-circle\"></i> } @case ('playable') { <dc-icon name=\"play\"></dc-icon> } }\n </i>\n\n <!-- Display transcription with highlighting -->\n <p style=\"width: 100%\" [class]=\"'text-content ' + classTag()\">\n @for (word of wordWithMeta(); track trackByIndex($index, word)) {\n <span\n [class]=\"word.tag\"\n [class.highlight]=\"word.isHighlighted\"\n [class.marked]=\"word.marked\"\n (click)=\"onWordClick(word)\"\n [attr.id]=\"'word-' + message().messageId + '-' + word.index\"\n >{{ word.word }}\n </span>\n }\n </p>\n</div>\n@if (message().imageUrl) {\n<div class=\"tour-image-container\" style=\"display: flex; justify-content: center\">\n <img [src]=\"message().imageUrl\" alt=\"Tour Image\" style=\"max-width: 220px; height: auto\" />\n</div>\n}\n", styles: [":host{display:block}.audio-text-sync-container{display:flex;align-items:flex-start;gap:2px;align-items:center}.play-button{cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:24px;margin-top:4px}.play-button:hover{opacity:.8}.text-content{flex:1}.highlight{background-color:var(--highlight-bg-color, rgb(60, 216, 255));border-radius:4px}::ng-deep .marked{position:relative;color:#f8bfbc}::ng-deep .marked:before{content:\"\";z-index:-2;left:-.1em;top:.1em;border-width:2px;border-style:solid;border-color:#f27068;position:absolute;border-right-color:transparent;width:100%;height:1em;transform:rotate(2deg);opacity:.7;border-radius:50%;padding:.1em .25em}::ng-deep .marked:after{content:\"\";z-index:-1;left:-.1em;top:.4em;padding:.1em .25em;border-width:2px;border-style:solid;border-color:#f27068;border-left-color:transparent;border-top-color:transparent;position:absolute;width:100%;height:1em;transform:rotate(-1deg);opacity:.7;border-radius:50%}.spin-animation{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.em{font-style:italic;color:#b8d0fc}.strong{font-weight:700;color:inherit}.italic{font-style:italic;color:#0d5cf0}.em_strong{font-weight:700;font-style:italic;color:inherit}\n"] }]
3687
+ }], ctorParameters: () => [], propDecorators: { hostHighlightColor: [{
3688
+ type: HostBinding,
3689
+ args: ['style.--highlight-bg-color']
3690
+ }] } });
3697
3691
 
3692
+ /**
3693
+ * @Injectable
3694
+ *
3695
+ * @description
3696
+ * This service orchestrates the playback of chat messages, ensuring that they are played sequentially.
3697
+ * It manages a queue of messages and handles the generation and playback of audio for each message.
3698
+ *
3699
+ * @see ChatMessageOrchestratorComponent
3700
+ */
3698
3701
  class MessageOrchestrationService {
3699
3702
  constructor() {
3700
3703
  // Services
@@ -3715,6 +3718,13 @@ class MessageOrchestrationService {
3715
3718
  this.preGenerationInProgress = signal(false, ...(ngDevMode ? [{ debugName: "preGenerationInProgress" }] : []));
3716
3719
  console.log('MessageOrchestrationService initialized');
3717
3720
  }
3721
+ /**
3722
+ * @description
3723
+ * Starts the orchestration process for a list of messages.
3724
+ *
3725
+ * @param messages - An array of `MessageContent` objects to be orchestrated.
3726
+ * @param role - The `ChatRole` of the messages' author.
3727
+ */
3718
3728
  startOrchestration(messages, role) {
3719
3729
  this.messages.set([...messages]);
3720
3730
  this.messageRole.set(role);
@@ -3729,6 +3739,12 @@ class MessageOrchestrationService {
3729
3739
  this.changeStates(0, this.messages()[0]);
3730
3740
  }
3731
3741
  }
3742
+ /**
3743
+ * @description
3744
+ * Handles the completion of an audio playback.
3745
+ *
3746
+ * @param message - The `MessageContent` object whose audio has finished playing.
3747
+ */
3732
3748
  audioCompleted(message) {
3733
3749
  this.conversationService.currentAudioStatus.set({ message, completed: true });
3734
3750
  this.currentPlayingIndex.set(null);
@@ -3737,6 +3753,12 @@ class MessageOrchestrationService {
3737
3753
  this.processNextInQueue();
3738
3754
  }
3739
3755
  }
3756
+ /**
3757
+ * @description
3758
+ * Notifies the `ConversationService` when a word is clicked.
3759
+ *
3760
+ * @param wordData - The `WordData` object containing information about the clicked word.
3761
+ */
3740
3762
  wordClicked(wordData) {
3741
3763
  this.conversationService.notifyWordClicked(wordData);
3742
3764
  }
@@ -3829,14 +3851,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
3829
3851
  type: Injectable
3830
3852
  }], ctorParameters: () => [] });
3831
3853
 
3854
+ /**
3855
+ * @Component
3856
+ *
3857
+ * @description
3858
+ * This component orchestrates the display and audio playback of chat messages.
3859
+ * It uses the `MessageOrchestrationService` to manage the message queue and audio playback.
3860
+ *
3861
+ * @see MessageOrchestrationService
3862
+ * @see MessageContentDisplayer
3863
+ */
3832
3864
  class ChatMessageOrchestratorComponent {
3833
3865
  constructor() {
3834
3866
  // Services
3835
3867
  this.orchestrationService = inject(MessageOrchestrationService);
3836
3868
  // Inputs
3869
+ /**
3870
+ * An array of `MessageContent` objects to be displayed and orchestrated.
3871
+ */
3837
3872
  this.messages = input.required(...(ngDevMode ? [{ debugName: "messages" }] : []));
3873
+ /**
3874
+ * The `ChatRole` of the messages' author.
3875
+ */
3838
3876
  this.messageRole = input.required(...(ngDevMode ? [{ debugName: "messageRole" }] : []));
3839
3877
  // Outputs
3878
+ /**
3879
+ * Emits when the audio for a message has completed playing.
3880
+ */
3840
3881
  this.audioCompleted = output();
3841
3882
  // Signals
3842
3883
  this.messagesSignal = this.orchestrationService.messagesSignal;
@@ -3844,15 +3885,27 @@ class ChatMessageOrchestratorComponent {
3844
3885
  ngOnInit() {
3845
3886
  this.orchestrationService.startOrchestration(this.messages(), this.messageRole());
3846
3887
  }
3888
+ /**
3889
+ * @description
3890
+ * Handles the `audioCompleted` event from the `MessageContentDisplayer`.
3891
+ *
3892
+ * @param message - The `MessageContent` object whose audio has finished playing.
3893
+ */
3847
3894
  onAudioCompleted(message) {
3848
3895
  this.orchestrationService.audioCompleted(message);
3849
3896
  this.audioCompleted.emit(message);
3850
3897
  }
3898
+ /**
3899
+ * @description
3900
+ * Handles the `wordClicked` event from the `MessageContentDisplayer`.
3901
+ *
3902
+ * @param wordData - The `WordData` object containing information about the clicked word.
3903
+ */
3851
3904
  onWordClicked(wordData) {
3852
3905
  this.orchestrationService.wordClicked(wordData);
3853
3906
  }
3854
3907
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ChatMessageOrchestratorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3855
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ChatMessageOrchestratorComponent, isStandalone: true, selector: "dc-message-orchestrator", inputs: { messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: true, transformFunction: null }, messageRole: { classPropertyName: "messageRole", publicName: "messageRole", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { audioCompleted: "audioCompleted" }, providers: [MessageOrchestrationService], ngImport: i0, template: "<div class=\"message-orchestrator-container\">\n @for (message of messagesSignal(); track $index) {\n <message-content-displayer [message]=\"message\" (audioCompleted)=\"onAudioCompleted($event)\" (wordClicked)=\"onWordClicked($event)\" />\n }\n</div>\n", styles: [":host{display:block}.word-options-popup{position:absolute;border:1px solid #ccc;background:#fff;padding:5px;z-index:1000}message-content-displayer{text-shadow:1px 1px 4px rgba(255,255,255,.4)}\n"], dependencies: [{ kind: "component", type: MessageContentDisplayer, selector: "message-content-displayer", inputs: ["message", "markWord"], outputs: ["playAudio", "audioCompleted", "wordClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3908
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ChatMessageOrchestratorComponent, isStandalone: true, selector: "dc-message-orchestrator", inputs: { messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: true, transformFunction: null }, messageRole: { classPropertyName: "messageRole", publicName: "messageRole", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { audioCompleted: "audioCompleted" }, providers: [MessageOrchestrationService], ngImport: i0, template: "<div class=\"message-orchestrator-container\">\n @for (message of messagesSignal(); track $index) {\n <message-content-displayer [message]=\"message\" (audioCompleted)=\"onAudioCompleted($event)\" (wordClicked)=\"onWordClicked($event)\" />\n }\n</div>\n", styles: [":host{display:block}.word-options-popup{position:absolute;border:1px solid #ccc;background:#fff;padding:5px;z-index:1000}message-content-displayer{text-shadow:1px 1px 4px rgba(255,255,255,.4)}\n"], dependencies: [{ kind: "component", type: MessageContentDisplayer, selector: "message-content-displayer", inputs: ["message", "markWord", "highlightColor"], outputs: ["playAudio", "audioCompleted", "wordClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3856
3909
  }
3857
3910
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ChatMessageOrchestratorComponent, decorators: [{
3858
3911
  type: Component,
@@ -3916,7 +3969,6 @@ class ChatMessagesListComponent {
3916
3969
  constructor() {
3917
3970
  // Inputs
3918
3971
  this.chatUserSettings = input.required(...(ngDevMode ? [{ debugName: "chatUserSettings" }] : []));
3919
- this.inputMessages = input.required(...(ngDevMode ? [{ debugName: "inputMessages" }] : []));
3920
3972
  // Private services
3921
3973
  this.conversationService = inject(ConversationService);
3922
3974
  this.messagesStateService = inject(MessagesStateService);
@@ -3946,7 +3998,7 @@ class ChatMessagesListComponent {
3946
3998
  return `${message.role}-${index}-${message.content.substring(0, 20)}`;
3947
3999
  }
3948
4000
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ChatMessagesListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3949
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ChatMessagesListComponent, isStandalone: true, selector: "dc-chat-messages-list", inputs: { chatUserSettings: { classPropertyName: "chatUserSettings", publicName: "chatUserSettings", isSignal: true, isRequired: true, transformFunction: null }, inputMessages: { classPropertyName: "inputMessages", publicName: "inputMessages", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"messages-container\">\n @for (message of messages(); track message.messageId) {\n <dc-chat-message [chatMessage]=\"message\" [chatUserSettings]=\"chatUserSettings()\"> </dc-chat-message>\n } @if (isThinking()) {\n <div class=\"thinking-container\">\n <div class=\"thinking-message\">\n <div class=\"thinking-avatar\">\n <img [src]=\"aiIcon\" alt=\"AI thinking\" class=\"avatar-img\" />\n </div>\n <div class=\"thinking-content\">\n <p-skeleton width=\"80%\" height=\"2rem\"></p-skeleton>\n <p-skeleton width=\"60%\" height=\"2rem\"></p-skeleton>\n </div>\n </div>\n </div>\n }\n</div>\n", styles: [".messages-container{display:flex;flex-direction:column;gap:1rem;height:100%;padding:3px}@media (min-width: 992px){.messages-container{padding:2rem}}.thinking-container{padding:.5rem 0;border-radius:20px;background:#fff}.thinking-message{display:flex;gap:1rem;align-items:flex-start}.thinking-avatar{width:40px;height:40px;border-radius:50%;overflow:hidden;flex-shrink:0}.avatar-img{width:100%;height:100%;object-fit:cover}.thinking-content{flex:1;display:flex;flex-direction:column;gap:.5rem}\n"], dependencies: [{ kind: "component", type: ChatMessageComponent, selector: "dc-chat-message", inputs: ["chatMessage", "chatUserSettings"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1$2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4001
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: ChatMessagesListComponent, isStandalone: true, selector: "dc-chat-messages-list", inputs: { chatUserSettings: { classPropertyName: "chatUserSettings", publicName: "chatUserSettings", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"messages-container\">\n @for (message of messages(); track message.messageId) {\n <dc-chat-message [chatMessage]=\"message\" [chatUserSettings]=\"chatUserSettings()\"> </dc-chat-message>\n } @if (isThinking()) {\n <div class=\"thinking-container\">\n <div class=\"thinking-message\">\n <div class=\"thinking-avatar\">\n <img [src]=\"aiIcon\" alt=\"AI thinking\" class=\"avatar-img\" />\n </div>\n <div class=\"thinking-content\">\n <p-skeleton width=\"80%\" height=\"2rem\"></p-skeleton>\n <p-skeleton width=\"60%\" height=\"2rem\"></p-skeleton>\n </div>\n </div>\n </div>\n }\n</div>\n", styles: [".messages-container{display:flex;flex-direction:column;gap:1rem;height:100%;padding:3px}@media (min-width: 992px){.messages-container{padding:2rem}}.thinking-container{padding:.5rem 0;border-radius:20px;background:#fff}.thinking-message{display:flex;gap:1rem;align-items:flex-start}.thinking-avatar{width:40px;height:40px;border-radius:50%;overflow:hidden;flex-shrink:0}.avatar-img{width:100%;height:100%;object-fit:cover}.thinking-content{flex:1;display:flex;flex-direction:column;gap:.5rem}\n"], dependencies: [{ kind: "component", type: ChatMessageComponent, selector: "dc-chat-message", inputs: ["chatMessage", "chatUserSettings"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i1$2.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3950
4002
  }
3951
4003
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ChatMessagesListComponent, decorators: [{
3952
4004
  type: Component,
@@ -4282,16 +4334,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
4282
4334
 
4283
4335
  class ConversationInspector {
4284
4336
  constructor() {
4285
- this.evaluationService = inject(EvaluationService);
4286
- this.messageStateService = inject(MessagesStateService);
4287
- this.dynamicFlowService = inject(DynamicFlowService);
4288
- this.globalToolsService = inject(GlobalToolsService);
4289
4337
  this.config = inject(DynamicDialogConfig);
4290
4338
  this.completeEvent = output();
4291
4339
  this.value = 0;
4292
4340
  this.viewMode = signal('markdown', ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
4341
+ const parentInjector = this.config.data.injector;
4293
4342
  this.agentCard = this.config.data.agentCard;
4294
4343
  this.chatUserSettings = this.config.data.chatUserSettings;
4344
+ this.evaluationService = parentInjector.get(EvaluationService);
4345
+ this.messageStateService = parentInjector.get(MessagesStateService);
4346
+ this.dynamicFlowService = parentInjector.get(DynamicFlowService);
4347
+ this.globalToolsService = parentInjector.get(GlobalToolsService);
4295
4348
  console.log('ConversationInspector data assigned', this.agentCard, this.chatUserSettings);
4296
4349
  }
4297
4350
  setScore() {
@@ -4342,29 +4395,32 @@ class ConversationInfoService {
4342
4395
  modal: true,
4343
4396
  draggable: false,
4344
4397
  closable: true,
4345
- data,
4398
+ data: {
4399
+ agentCard: data.agentCard,
4400
+ chatUserSettings: data.chatUserSettings,
4401
+ injector: data.injector,
4402
+ },
4346
4403
  });
4347
4404
  }
4348
4405
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationInfoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4349
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationInfoService, providedIn: 'root' }); }
4406
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationInfoService }); }
4350
4407
  }
4351
4408
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ConversationInfoService, decorators: [{
4352
- type: Injectable,
4353
- args: [{
4354
- providedIn: 'root',
4355
- }]
4409
+ type: Injectable
4356
4410
  }] });
4357
4411
 
4358
4412
  class DCChatComponent {
4359
4413
  constructor() {
4360
4414
  // Services
4361
- this.conversationInfoService = inject(ConversationInfoService);
4415
+ this.injector = inject(Injector);
4416
+ this.userService = inject(UserService);
4417
+ this.dialogService = inject(DialogService);
4418
+ // Local Services Instances
4362
4419
  this.conversationService = inject(ConversationService);
4363
4420
  this.evaluationService = inject(EvaluationService);
4364
4421
  this.messageStateService = inject(MessagesStateService);
4365
- this.dialogService = inject(DialogService);
4366
4422
  this.chatMonitorService = inject(ChatMonitorService);
4367
- this.userService = inject(UserService);
4423
+ this.conversationInfoService = inject(ConversationInfoService);
4368
4424
  // 📥 Inputs
4369
4425
  this.chatUserSettings = this.userService.user()?.settings?.conversation; // Default to user data exchange
4370
4426
  this.conversationFlow = null;
@@ -4375,7 +4431,7 @@ class DCChatComponent {
4375
4431
  this.goalCompleted = output(); // notifies when user completes goal (score reaches 100)
4376
4432
  // readonly wordClicked = output<WordData>(); // Replaced by sendMessage with ChatEventType.WordClicked
4377
4433
  // Signals States
4378
- this.messages = signal([], ...(ngDevMode ? [{ debugName: "messages" }] : []));
4434
+ // public messages = signal<ChatMessage[]>([]);
4379
4435
  // States
4380
4436
  this.micSettings = { micMode: 'recognition', lang: 'en' };
4381
4437
  this.isAdmin = true;
@@ -4396,12 +4452,25 @@ class DCChatComponent {
4396
4452
  // this.conversationService.notifyWordClicked(null);
4397
4453
  }
4398
4454
  });
4455
+ // Effect to watch for audio playback events
4456
+ effect(() => {
4457
+ const message = this.chatMonitorService.messageAudioWillPlay$();
4458
+ if (message) {
4459
+ this.chatEvent.emit({ type: ChatEventType.AudioStarted, payload: message });
4460
+ }
4461
+ });
4462
+ // Effect to watch for mood changes
4463
+ effect(() => {
4464
+ const mood = this.chatMonitorService.currentMood();
4465
+ if (mood) {
4466
+ this.chatEvent.emit({ type: ChatEventType.MoodDetected, payload: mood });
4467
+ }
4468
+ });
4399
4469
  }
4400
4470
  async ngOnInit() {
4401
4471
  this.conversationService.setDestroyed(false);
4402
4472
  this.chatMonitorService.isConversationActive.set(true);
4403
4473
  if (this.conversationSettings) {
4404
- console.log('iniciando conversación', this.conversationSettings);
4405
4474
  await this.conversationService.initConversationWithSettings(this.conversationSettings, this.conversationFlow);
4406
4475
  }
4407
4476
  else {
@@ -4444,6 +4513,7 @@ class DCChatComponent {
4444
4513
  this.conversationInfoService.openConversationInfo({
4445
4514
  agentCard: this.agentCard,
4446
4515
  chatUserSettings: this.chatUserSettings,
4516
+ injector: this.injector,
4447
4517
  });
4448
4518
  }
4449
4519
  /**
@@ -4459,11 +4529,11 @@ class DCChatComponent {
4459
4529
  this.goalCompleted.emit();
4460
4530
  }
4461
4531
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DCChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4462
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DCChatComponent, isStandalone: true, selector: "dc-chat", inputs: { chatUserSettings: { classPropertyName: "chatUserSettings", publicName: "chatUserSettings", isSignal: false, isRequired: false, transformFunction: null }, conversationSettings: { classPropertyName: "conversationSettings", publicName: "conversationSettings", isSignal: false, isRequired: false, transformFunction: null }, conversationFlow: { classPropertyName: "conversationFlow", publicName: "conversationFlow", isSignal: false, isRequired: false, transformFunction: null }, agentCard: { classPropertyName: "agentCard", publicName: "agentCard", isSignal: false, isRequired: false, transformFunction: null }, parseDict: { classPropertyName: "parseDict", publicName: "parseDict", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { chatEvent: "chatEvent", goalCompleted: "goalCompleted" }, viewQueries: [{ propertyName: "chatFooterComponent", first: true, predicate: ChatFooterComponent, descendants: true }], ngImport: i0, template: "<div class=\"chat-container\">\n <dc-chat-header\n [agentCard]=\"agentCard\"\n (showInfoEvent)=\"showInfo()\"\n (settingsClickEvent)=\"changeUserChatSettings()\"\n (restartConversationEvent)=\"restartConversation($event)\"\n (completeEvent)=\"complete()\">\n </dc-chat-header>\n\n <dc-chat-messages-list [chatUserSettings]=\"chatUserSettings\" [inputMessages]=\"messages()\"> </dc-chat-messages-list>\n\n <dc-chat-footer [micSettings]=\"micSettings\"> </dc-chat-footer>\n</div>\n", styles: ["::ng-deep .p-drawer-content{padding:0!important}::ng-deep .p-dialog-content{display:contents}.chat-container{display:flex;flex-direction:column;height:100%;max-height:100vh;overflow:hidden;background-color:transparent}dc-chat-messages-list{flex:1;overflow-y:auto;padding:.5rem}.score-container{padding:.5rem 1rem;background-color:var(--surface-card, #ffffff);border-top:1px solid var(--surface-border, #dee2e6)}.info-content{max-height:70vh;overflow-y:auto;padding:1rem}.info-content h3{margin-top:1rem;margin-bottom:.5rem;font-size:1.2rem}.info-content pre{background-color:var(--surface-hover, #f1f1f1);padding:1rem;border-radius:4px;overflow-x:auto;font-size:.9rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ChatHeaderComponent, selector: "dc-chat-header", inputs: ["alternativeConversation", "agentCard"], outputs: ["restartConversationEvent", "showInfoEvent", "settingsClickEvent"] }, { kind: "component", type: ChatFooterComponent, selector: "dc-chat-footer", inputs: ["isAIThinking", "micSettings"], outputs: ["sendMessage", "textInputChanged"] }, { kind: "component", type: ChatMessagesListComponent, selector: "dc-chat-messages-list", inputs: ["chatUserSettings", "inputMessages"] }, { kind: "ngmodule", type: ProgressBarModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4532
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: DCChatComponent, isStandalone: true, selector: "dc-chat", inputs: { chatUserSettings: { classPropertyName: "chatUserSettings", publicName: "chatUserSettings", isSignal: false, isRequired: false, transformFunction: null }, conversationSettings: { classPropertyName: "conversationSettings", publicName: "conversationSettings", isSignal: false, isRequired: false, transformFunction: null }, conversationFlow: { classPropertyName: "conversationFlow", publicName: "conversationFlow", isSignal: false, isRequired: false, transformFunction: null }, agentCard: { classPropertyName: "agentCard", publicName: "agentCard", isSignal: false, isRequired: false, transformFunction: null }, parseDict: { classPropertyName: "parseDict", publicName: "parseDict", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { chatEvent: "chatEvent", goalCompleted: "goalCompleted" }, providers: [ConversationService, AIGenerationService, EvaluationService, DynamicFlowTaskService, ConversationInfoService, ChatMonitorService], viewQueries: [{ propertyName: "chatFooterComponent", first: true, predicate: ChatFooterComponent, descendants: true }], ngImport: i0, template: "<div class=\"chat-container\">\n <dc-chat-header\n [agentCard]=\"agentCard\"\n (showInfoEvent)=\"showInfo()\"\n (settingsClickEvent)=\"changeUserChatSettings()\"\n (restartConversationEvent)=\"restartConversation($event)\"\n (completeEvent)=\"complete()\">\n </dc-chat-header>\n\n <dc-chat-messages-list [chatUserSettings]=\"chatUserSettings\"> </dc-chat-messages-list>\n\n <dc-chat-footer [micSettings]=\"micSettings\"> </dc-chat-footer>\n</div>\n", styles: ["::ng-deep .p-drawer-content{padding:0!important}::ng-deep .p-dialog-content{display:contents}.chat-container{display:flex;flex-direction:column;height:100%;max-height:100vh;overflow:hidden;background-color:transparent}dc-chat-messages-list{flex:1;overflow-y:auto;padding:.5rem}.score-container{padding:.5rem 1rem;background-color:var(--surface-card, #ffffff);border-top:1px solid var(--surface-border, #dee2e6)}.info-content{max-height:70vh;overflow-y:auto;padding:1rem}.info-content h3{margin-top:1rem;margin-bottom:.5rem;font-size:1.2rem}.info-content pre{background-color:var(--surface-hover, #f1f1f1);padding:1rem;border-radius:4px;overflow-x:auto;font-size:.9rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ChatHeaderComponent, selector: "dc-chat-header", inputs: ["alternativeConversation", "agentCard"], outputs: ["restartConversationEvent", "showInfoEvent", "settingsClickEvent"] }, { kind: "component", type: ChatFooterComponent, selector: "dc-chat-footer", inputs: ["isAIThinking", "micSettings"], outputs: ["sendMessage", "textInputChanged"] }, { kind: "component", type: ChatMessagesListComponent, selector: "dc-chat-messages-list", inputs: ["chatUserSettings"] }, { kind: "ngmodule", type: ProgressBarModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4463
4533
  }
4464
4534
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DCChatComponent, decorators: [{
4465
4535
  type: Component,
4466
- args: [{ selector: 'dc-chat', standalone: true, imports: [CommonModule, ChatHeaderComponent, ChatFooterComponent, ChatMessagesListComponent, ProgressBarModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"chat-container\">\n <dc-chat-header\n [agentCard]=\"agentCard\"\n (showInfoEvent)=\"showInfo()\"\n (settingsClickEvent)=\"changeUserChatSettings()\"\n (restartConversationEvent)=\"restartConversation($event)\"\n (completeEvent)=\"complete()\">\n </dc-chat-header>\n\n <dc-chat-messages-list [chatUserSettings]=\"chatUserSettings\" [inputMessages]=\"messages()\"> </dc-chat-messages-list>\n\n <dc-chat-footer [micSettings]=\"micSettings\"> </dc-chat-footer>\n</div>\n", styles: ["::ng-deep .p-drawer-content{padding:0!important}::ng-deep .p-dialog-content{display:contents}.chat-container{display:flex;flex-direction:column;height:100%;max-height:100vh;overflow:hidden;background-color:transparent}dc-chat-messages-list{flex:1;overflow-y:auto;padding:.5rem}.score-container{padding:.5rem 1rem;background-color:var(--surface-card, #ffffff);border-top:1px solid var(--surface-border, #dee2e6)}.info-content{max-height:70vh;overflow-y:auto;padding:1rem}.info-content h3{margin-top:1rem;margin-bottom:.5rem;font-size:1.2rem}.info-content pre{background-color:var(--surface-hover, #f1f1f1);padding:1rem;border-radius:4px;overflow-x:auto;font-size:.9rem}\n"] }]
4536
+ args: [{ selector: 'dc-chat', standalone: true, imports: [CommonModule, ChatHeaderComponent, ChatFooterComponent, ChatMessagesListComponent, ProgressBarModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConversationService, AIGenerationService, EvaluationService, DynamicFlowTaskService, ConversationInfoService, ChatMonitorService], template: "<div class=\"chat-container\">\n <dc-chat-header\n [agentCard]=\"agentCard\"\n (showInfoEvent)=\"showInfo()\"\n (settingsClickEvent)=\"changeUserChatSettings()\"\n (restartConversationEvent)=\"restartConversation($event)\"\n (completeEvent)=\"complete()\">\n </dc-chat-header>\n\n <dc-chat-messages-list [chatUserSettings]=\"chatUserSettings\"> </dc-chat-messages-list>\n\n <dc-chat-footer [micSettings]=\"micSettings\"> </dc-chat-footer>\n</div>\n", styles: ["::ng-deep .p-drawer-content{padding:0!important}::ng-deep .p-dialog-content{display:contents}.chat-container{display:flex;flex-direction:column;height:100%;max-height:100vh;overflow:hidden;background-color:transparent}dc-chat-messages-list{flex:1;overflow-y:auto;padding:.5rem}.score-container{padding:.5rem 1rem;background-color:var(--surface-card, #ffffff);border-top:1px solid var(--surface-border, #dee2e6)}.info-content{max-height:70vh;overflow-y:auto;padding:1rem}.info-content h3{margin-top:1rem;margin-bottom:.5rem;font-size:1.2rem}.info-content pre{background-color:var(--surface-hover, #f1f1f1);padding:1rem;border-radius:4px;overflow-x:auto;font-size:.9rem}\n"] }]
4467
4537
  }], ctorParameters: () => [], propDecorators: { chatFooterComponent: [{
4468
4538
  type: ViewChild,
4469
4539
  args: [ChatFooterComponent]