@dataclouder/ngx-agent-cards 0.0.88 → 0.0.90
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.
- package/fesm2022/dataclouder-ngx-agent-cards.mjs +463 -671
- package/fesm2022/dataclouder-ngx-agent-cards.mjs.map +1 -1
- package/lib/components/chat-container/chat-container.component.d.ts +5 -19
- package/lib/components/chat-container/chat-footer/chat-footer.component.d.ts +7 -2
- package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.component.d.ts +5 -28
- package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.utils.d.ts +1 -1
- package/lib/components/chat-container/chat-messages-list/chat-messages-list.component.d.ts +8 -5
- package/lib/components/chat-container/chat-messages-list/message-orchestrator/message-orchestrator.component.d.ts +26 -0
- package/lib/components/chat-settings/dc-conversation-userchat-settings.component.d.ts +2 -3
- package/lib/components/icons/icons.component.d.ts +1 -1
- package/lib/components/{standalone-audio-text-sync/standalone-audio-text-sync.component.d.ts → text-highlighter/text-highlighter.d.ts} +10 -10
- package/lib/models/agent.models.d.ts +4 -7
- package/lib/models/conversation-ai.class.d.ts +3 -3
- package/lib/models/user-data-exchange.d.ts +2 -0
- package/lib/pipes/safe-json.pipe.d.ts +15 -0
- package/lib/services/conversation.service.d.ts +10 -13
- package/lib/services/dc-conversation-builder.service.d.ts +0 -2
- package/lib/services/message-processing.service.d.ts +2 -2
- package/package.json +1 -1
- package/public-api.d.ts +3 -1
- package/lib/components/chat-container/chat-messages-list/chat-message/multi-message-content/multi-message-content.d.ts +0 -33
- package/lib/services/audio-text-sync.service.d.ts +0 -57
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { MicSettings } from '@dataclouder/ngx-mic';
|
|
3
|
-
import { ChatUserSettings, IAgentCard,
|
|
3
|
+
import { ChatMessage, ChatUserSettings, IAgentCard, IConversationSettings, IMiniAgentCard } from '../../models/agent.models';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class DCChatComponent implements OnInit, OnDestroy {
|
|
6
|
-
private agentCardService;
|
|
7
6
|
private conversationBuilder;
|
|
8
7
|
private dialogService;
|
|
9
8
|
private conversationService;
|
|
10
|
-
private
|
|
9
|
+
private userDataExchange;
|
|
11
10
|
chatUserSettings: ChatUserSettings;
|
|
11
|
+
conversationSettings: IConversationSettings;
|
|
12
12
|
agentCard: IAgentCard;
|
|
13
13
|
readonly evaluatorAgentCard: import("@angular/core").InputSignal<IMiniAgentCard>;
|
|
14
14
|
readonly parseDict: import("@angular/core").InputSignal<{
|
|
@@ -16,25 +16,11 @@ export declare class DCChatComponent implements OnInit, OnDestroy {
|
|
|
16
16
|
}>;
|
|
17
17
|
readonly sendMessage: import("@angular/core").OutputEmitterRef<string>;
|
|
18
18
|
micSettings: MicSettings;
|
|
19
|
-
imageUser: string;
|
|
20
|
-
thinkingImg: string;
|
|
21
|
-
aiIcon: string;
|
|
22
19
|
isInfoVisible: boolean;
|
|
23
|
-
isChatSettingsVisible: boolean;
|
|
24
|
-
isUserTalking: boolean;
|
|
25
|
-
isGettingTranscription: boolean;
|
|
26
20
|
isAdmin: boolean;
|
|
27
|
-
messages: import("@angular/core").
|
|
28
|
-
isThinking: import("@angular/core").Signal<boolean>;
|
|
29
|
-
score: import("@angular/core").Signal<number>;
|
|
30
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
31
|
-
constructor(...args: unknown[]);
|
|
21
|
+
messages: import("@angular/core").WritableSignal<ChatMessage[]>;
|
|
32
22
|
ngOnInit(): Promise<void>;
|
|
33
23
|
ngOnDestroy(): void;
|
|
34
|
-
/**
|
|
35
|
-
* Handle microphone input finished
|
|
36
|
-
*/
|
|
37
|
-
onMicFinished(eventBlob: any): Promise<void>;
|
|
38
24
|
/**
|
|
39
25
|
* Open chat settings dialog
|
|
40
26
|
*/
|
|
@@ -48,5 +34,5 @@ export declare class DCChatComponent implements OnInit, OnDestroy {
|
|
|
48
34
|
*/
|
|
49
35
|
restartConversation(conversation?: IAgentCard | null): Promise<void>;
|
|
50
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<DCChatComponent, never>;
|
|
51
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DCChatComponent, "dc-chat", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": false; }; "agentCard": { "alias": "agentCard"; "required": false; }; "evaluatorAgentCard": { "alias": "evaluatorAgentCard"; "required": false; "isSignal": true; }; "parseDict": { "alias": "parseDict"; "required": false; "isSignal": true; }; }, { "sendMessage": "sendMessage"; }, never, never, true, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DCChatComponent, "dc-chat", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": false; }; "conversationSettings": { "alias": "conversationSettings"; "required": false; }; "agentCard": { "alias": "agentCard"; "required": false; }; "evaluatorAgentCard": { "alias": "evaluatorAgentCard"; "required": false; "isSignal": true; }; "parseDict": { "alias": "parseDict"; "required": false; "isSignal": true; }; }, { "sendMessage": "sendMessage"; }, never, never, true, never>;
|
|
52
38
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { FormControl } from '@angular/forms';
|
|
2
2
|
import { MicSettings } from '@dataclouder/ngx-mic';
|
|
3
3
|
import { ChatMessage, IMiniAgentCard } from '../../../models/agent.models';
|
|
4
|
+
import { AudioRecording } from '@dataclouder/ngx-core';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class ChatFooterComponent {
|
|
6
7
|
private conversationService;
|
|
7
8
|
private evaluationService;
|
|
9
|
+
private agentCardService;
|
|
8
10
|
readonly isAIThinking: import("@angular/core").InputSignal<boolean>;
|
|
9
11
|
readonly evaluatorAgentCard: import("@angular/core").InputSignal<IMiniAgentCard>;
|
|
10
12
|
readonly micSettings: import("@angular/core").InputSignal<MicSettings>;
|
|
11
13
|
readonly sendMessage: import("@angular/core").OutputEmitterRef<ChatMessage>;
|
|
12
14
|
readonly textInputChanged: import("@angular/core").OutputEmitterRef<string>;
|
|
13
|
-
|
|
15
|
+
isGettingTranscription: boolean;
|
|
16
|
+
isUserTalking: boolean;
|
|
14
17
|
chatInputControl: FormControl;
|
|
15
18
|
score: import("@angular/core").Signal<number>;
|
|
16
19
|
/**
|
|
@@ -31,6 +34,8 @@ export declare class ChatFooterComponent {
|
|
|
31
34
|
* Evaluate conversation using evaluator agent
|
|
32
35
|
*/
|
|
33
36
|
private evaluateConversation;
|
|
37
|
+
handleAudioRecorded(event: AudioRecording): void;
|
|
38
|
+
onMicFinished(eventBlob: Blob | any): Promise<void>;
|
|
34
39
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatFooterComponent, never>;
|
|
35
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ChatFooterComponent, "dc-chat-footer", never, { "isAIThinking": { "alias": "isAIThinking"; "required": false; "isSignal": true; }; "evaluatorAgentCard": { "alias": "evaluatorAgentCard"; "required": false; "isSignal": true; }; "micSettings": { "alias": "micSettings"; "required": false; "isSignal": true; }; }, { "sendMessage": "sendMessage"; "textInputChanged": "textInputChanged";
|
|
40
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatFooterComponent, "dc-chat-footer", never, { "isAIThinking": { "alias": "isAIThinking"; "required": false; "isSignal": true; }; "evaluatorAgentCard": { "alias": "evaluatorAgentCard"; "required": false; "isSignal": true; }; "micSettings": { "alias": "micSettings"; "required": false; "isSignal": true; }; }, { "sendMessage": "sendMessage"; "textInputChanged": "textInputChanged"; }, never, never, true, never>;
|
|
36
41
|
}
|
package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.component.d.ts
CHANGED
|
@@ -1,37 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChatMessage, ChatMultiMessage, ChatRole, ChatUserSettings, MessageAudio } from '../../../../models/agent.models';
|
|
1
|
+
import { ChatMessage, ChatUserSettings, MessageAudio } from '../../../../models/agent.models';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ChatMessageComponent
|
|
5
|
-
private audioService;
|
|
6
|
-
private agentCardService;
|
|
7
|
-
private audioTextSyncService;
|
|
3
|
+
export declare class ChatMessageComponent {
|
|
8
4
|
chatMessage: import("@angular/core").InputSignal<ChatMessage>;
|
|
9
5
|
chatUserSettings: import("@angular/core").InputSignal<ChatUserSettings>;
|
|
10
|
-
audioMessage: WritableSignal<MessageAudio>;
|
|
11
|
-
private readonly destroyRef;
|
|
12
|
-
conversationChatSettings: WritableSignal<ChatUserSettings | null>;
|
|
13
|
-
isLoading: WritableSignal<boolean>;
|
|
14
|
-
private messageEffect;
|
|
15
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
16
|
-
constructor(...args: unknown[]);
|
|
17
|
-
messageRole: import("@angular/core").Signal<ChatRole>;
|
|
6
|
+
audioMessage: import("@angular/core").WritableSignal<MessageAudio>;
|
|
18
7
|
hasMultiMessages: import("@angular/core").Signal<boolean>;
|
|
19
|
-
multiMessages: import("@angular/core").Signal<
|
|
20
|
-
messageContent: import("@angular/core").Signal<string>;
|
|
8
|
+
multiMessages: import("@angular/core").Signal<MessageAudio[]>;
|
|
21
9
|
messageTranslation: import("@angular/core").Signal<string>;
|
|
22
10
|
isUserMessage: import("@angular/core").Signal<boolean>;
|
|
23
|
-
|
|
24
|
-
isAssistantHelperMessage: import("@angular/core").Signal<boolean>;
|
|
25
|
-
ngOnInit(): Promise<void>;
|
|
26
|
-
generateAndPlayAudio(message: ChatMessage, overwriteText?: string | null): Promise<void>;
|
|
27
|
-
playMessage(message: MessageAudio): HTMLAudioElement | null;
|
|
28
|
-
/**
|
|
29
|
-
* Generate a unique ID for a message
|
|
30
|
-
* Uses message content/text and a timestamp to ensure uniqueness
|
|
31
|
-
*/
|
|
32
|
-
private generateMessageId;
|
|
33
|
-
generateAndPlayAllAudios(multiMessages: ChatMultiMessage[]): void;
|
|
34
|
-
private preloadNextMessageAudio;
|
|
11
|
+
private messageEffect;
|
|
35
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatMessageComponent, never>;
|
|
36
13
|
static ɵcmp: i0.ɵɵComponentDeclaration<ChatMessageComponent, "dc-chat-message", never, { "chatMessage": { "alias": "chatMessage"; "required": true; "isSignal": true; }; "chatUserSettings": { "alias": "chatUserSettings"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
37
14
|
}
|
package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AudioGenerated, ChatUserSettings, MessageAudio, TTSRequest } from '../../../../models/agent.models';
|
|
2
2
|
export declare function matchTranscription(originalText: string, transcription: any[]): any[];
|
|
3
|
-
export declare function extractAudioAndTranscription(message: MessageAudio, audio: AudioGenerated):
|
|
3
|
+
export declare function extractAudioAndTranscription(message: MessageAudio, audio: AudioGenerated): MessageAudio;
|
|
4
4
|
export declare function buildObjectTTSRequest(message: MessageAudio, settings?: ChatUserSettings): TTSRequest;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { AfterViewInit } from '@angular/core';
|
|
1
2
|
import { ChatMessage, ChatUserSettings } from '../../../models/agent.models';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class ChatMessagesListComponent {
|
|
4
|
+
export declare class ChatMessagesListComponent implements AfterViewInit {
|
|
4
5
|
readonly chatUserSettings: import("@angular/core").InputSignal<ChatUserSettings>;
|
|
5
|
-
readonly thinkingImg: import("@angular/core").InputSignal<string>;
|
|
6
6
|
aiIcon: string;
|
|
7
7
|
private conversationService;
|
|
8
|
-
|
|
8
|
+
inputMessages: import("@angular/core").InputSignal<ChatMessage[]>;
|
|
9
|
+
private elementRef;
|
|
9
10
|
messages: import("@angular/core").Signal<ChatMessage[]>;
|
|
10
|
-
updateFilter(value: string): void;
|
|
11
11
|
isThinking: import("@angular/core").Signal<boolean>;
|
|
12
|
+
constructor();
|
|
13
|
+
ngAfterViewInit(): void;
|
|
14
|
+
scrollToBottom(): void;
|
|
12
15
|
trackByMessage(index: number, message: ChatMessage): string;
|
|
13
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatMessagesListComponent, never>;
|
|
14
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ChatMessagesListComponent, "dc-chat-messages-list", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": true; "isSignal": true; }; "
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatMessagesListComponent, "dc-chat-messages-list", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": true; "isSignal": true; }; "inputMessages": { "alias": "inputMessages"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
15
18
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { ChatRole, MessageAudio } from '../../../../models/agent.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MessageOrchestratorComponent implements OnInit {
|
|
5
|
+
private agentCardService;
|
|
6
|
+
private conversationService;
|
|
7
|
+
messages: import("@angular/core").InputSignal<MessageAudio[]>;
|
|
8
|
+
messageRole: import("@angular/core").InputSignal<ChatRole>;
|
|
9
|
+
messagesSignal: import("@angular/core").WritableSignal<MessageAudio[]>;
|
|
10
|
+
readonly playAudio: import("@angular/core").OutputEmitterRef<MessageAudio>;
|
|
11
|
+
readonly audioCompleted: import("@angular/core").OutputEmitterRef<MessageAudio>;
|
|
12
|
+
private audioQueue;
|
|
13
|
+
private isGenerating;
|
|
14
|
+
private currentPlayingIndex;
|
|
15
|
+
private preGenerationInProgress;
|
|
16
|
+
ngOnInit(): void;
|
|
17
|
+
private initializeAudioQueue;
|
|
18
|
+
private processNextInQueue;
|
|
19
|
+
private preGenerateNextIfNeeded;
|
|
20
|
+
private generateAudioForIndex;
|
|
21
|
+
onAudioCompleted(message: MessageAudio): void;
|
|
22
|
+
changeStates(index: number, messageAudio: MessageAudio): void;
|
|
23
|
+
generateAudio(message: MessageAudio, overwriteText?: string | null): Promise<MessageAudio>;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MessageOrchestratorComponent, never>;
|
|
25
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MessageOrchestratorComponent, "dc-message-orchestrator", never, { "messages": { "alias": "messages"; "required": true; "isSignal": true; }; "messageRole": { "alias": "messageRole"; "required": true; "isSignal": true; }; }, { "playAudio": "playAudio"; "audioCompleted": "audioCompleted"; }, never, never, true, never>;
|
|
26
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OnInit, TemplateRef } from '@angular/core';
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
3
2
|
import { TextEngines } from '../../models/conversation-enums';
|
|
4
3
|
import * as i0 from "@angular/core";
|
|
5
4
|
export declare class DCConversationUserChatSettingsComponent implements OnInit {
|
|
@@ -16,7 +15,7 @@ export declare class DCConversationUserChatSettingsComponent implements OnInit {
|
|
|
16
15
|
label: string;
|
|
17
16
|
}[];
|
|
18
17
|
modelnames: any[];
|
|
19
|
-
form: FormGroup<{
|
|
18
|
+
form: import("@angular/forms").FormGroup<{
|
|
20
19
|
synthVoice: import("@angular/forms").FormControl<boolean>;
|
|
21
20
|
highlightWords: import("@angular/forms").FormControl<boolean>;
|
|
22
21
|
speed: import("@angular/forms").FormControl<number>;
|
|
@@ -26,7 +25,7 @@ export declare class DCConversationUserChatSettingsComponent implements OnInit {
|
|
|
26
25
|
fixGrammar: import("@angular/forms").FormControl<boolean>;
|
|
27
26
|
autoTranslate: import("@angular/forms").FormControl<boolean>;
|
|
28
27
|
voice: import("@angular/forms").FormControl<string>;
|
|
29
|
-
model: FormGroup<{
|
|
28
|
+
model: import("@angular/forms").FormGroup<{
|
|
30
29
|
provider: import("@angular/forms").FormControl<string>;
|
|
31
30
|
modelName: import("@angular/forms").FormControl<string>;
|
|
32
31
|
id: import("@angular/forms").FormControl<string>;
|
|
@@ -3,7 +3,7 @@ import { SafeHtml } from '@angular/platform-browser';
|
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class IconsComponent implements OnChanges {
|
|
5
5
|
private sanitizer;
|
|
6
|
-
readonly name: import("@angular/core").InputSignal<"
|
|
6
|
+
readonly name: import("@angular/core").InputSignal<"chat" | "play" | "loading">;
|
|
7
7
|
readonly size: import("@angular/core").InputSignal<number>;
|
|
8
8
|
readonly color: import("@angular/core").InputSignal<string>;
|
|
9
9
|
sanitizedIcon: SafeHtml;
|
|
@@ -9,23 +9,22 @@ export interface HighlightedWord {
|
|
|
9
9
|
index: number;
|
|
10
10
|
isHighlighted: boolean;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
* Standalone component for audio-text synchronization
|
|
14
|
-
* This component can work independently from the chat component
|
|
15
|
-
*/
|
|
16
|
-
export declare class StandaloneAudioTextSyncComponent implements OnDestroy {
|
|
12
|
+
export declare class TextHighlighterComponent implements OnDestroy {
|
|
17
13
|
message: import("@angular/core").InputSignal<MessageAudio>;
|
|
18
14
|
highlightedWords: import("@angular/core").WritableSignal<HighlightedWord[]>;
|
|
15
|
+
isPlaying: import("@angular/core").WritableSignal<boolean>;
|
|
16
|
+
iconState: import("@angular/core").Signal<"isLoading" | "isPlaying" | "playable" | "idle">;
|
|
19
17
|
isLoading: import("@angular/core").Signal<boolean>;
|
|
20
18
|
shouldPlayAudio: import("@angular/core").Signal<boolean>;
|
|
19
|
+
messageText: import("@angular/core").Signal<string>;
|
|
20
|
+
classTag: import("@angular/core").Signal<string>;
|
|
21
|
+
hasTranscription: import("@angular/core").Signal<boolean>;
|
|
21
22
|
readonly playAudio: import("@angular/core").OutputEmitterRef<MessageAudio>;
|
|
22
23
|
readonly audioCompleted: import("@angular/core").OutputEmitterRef<MessageAudio>;
|
|
23
24
|
private audioElement;
|
|
24
25
|
private destroy$;
|
|
25
26
|
private cdr;
|
|
26
27
|
private destroyRef;
|
|
27
|
-
messageText: import("@angular/core").Signal<string>;
|
|
28
|
-
hasTranscription: import("@angular/core").Signal<boolean>;
|
|
29
28
|
constructor();
|
|
30
29
|
/**
|
|
31
30
|
* Track function for ngFor to improve performance
|
|
@@ -44,7 +43,8 @@ export declare class StandaloneAudioTextSyncComponent implements OnDestroy {
|
|
|
44
43
|
/**
|
|
45
44
|
* Set up audio synchronization with text
|
|
46
45
|
*/
|
|
47
|
-
private
|
|
46
|
+
private subcribeToAudioSync;
|
|
47
|
+
private subscribeToEndAudio;
|
|
48
48
|
/**
|
|
49
49
|
* Clean up audio element and event listeners
|
|
50
50
|
*/
|
|
@@ -57,6 +57,6 @@ export declare class StandaloneAudioTextSyncComponent implements OnDestroy {
|
|
|
57
57
|
* Start audio playback and handle any setup needed
|
|
58
58
|
*/
|
|
59
59
|
private startAudioPlayback;
|
|
60
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
61
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TextHighlighterComponent, never>;
|
|
61
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextHighlighterComponent, "dc-text-highlighter", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; }, { "playAudio": "playAudio"; "audioCompleted": "audioCompleted"; }, never, never, true, never>;
|
|
62
62
|
}
|
|
@@ -51,6 +51,7 @@ export interface IConversationSettings {
|
|
|
51
51
|
voice?: string;
|
|
52
52
|
secondaryVoice?: string;
|
|
53
53
|
repeatRecording?: boolean;
|
|
54
|
+
model?: IAIModel;
|
|
54
55
|
}
|
|
55
56
|
export type IConversationSettingsDTO = Pick<IConversationSettings, 'messages' | 'textEngine' | 'conversationType'> & {
|
|
56
57
|
model?: IAIModel;
|
|
@@ -114,18 +115,14 @@ export declare class MessageAudio {
|
|
|
114
115
|
audioUrl?: string;
|
|
115
116
|
audioPromise?: any;
|
|
116
117
|
isLoading?: boolean;
|
|
117
|
-
transcription?:
|
|
118
|
+
transcription?: TranscriptionsWhisper;
|
|
118
119
|
transcriptionTimestamps?: WordTimestamps[];
|
|
119
120
|
text?: string;
|
|
120
121
|
content?: string;
|
|
121
122
|
voice?: string;
|
|
122
123
|
shouldPlayAudio?: boolean;
|
|
123
124
|
messageId?: string | number;
|
|
124
|
-
|
|
125
|
-
export declare class ChatMultiMessage extends MessageAudio {
|
|
126
|
-
tag: string | string[] | Set<string> | {
|
|
127
|
-
[klass: string]: any;
|
|
128
|
-
};
|
|
125
|
+
tag?: string;
|
|
129
126
|
}
|
|
130
127
|
export declare enum ChatRole {
|
|
131
128
|
System = "system",
|
|
@@ -140,7 +137,7 @@ export declare class ChatMessage extends MessageAudio {
|
|
|
140
137
|
audioHtml?: HTMLAudioElement;
|
|
141
138
|
promisePlay?: any;
|
|
142
139
|
stats?: any;
|
|
143
|
-
multiMessages?:
|
|
140
|
+
multiMessages?: MessageAudio[];
|
|
144
141
|
}
|
|
145
142
|
export declare class ChatUserSettings {
|
|
146
143
|
realTime: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InjectionToken, Type } from '@angular/core';
|
|
2
2
|
import { Provider } from '@angular/core';
|
|
3
|
-
import { ChatUserSettings, IAgentCard, ModelName, IConversationSettingsDTO, IAgentResponseDTO, TTSRequest } from './agent.models';
|
|
3
|
+
import { ChatUserSettings, IAgentCard, ModelName, IConversationSettingsDTO, IAgentResponseDTO, TTSRequest, AudioGenerated, TranscriptionsWhisper } from './agent.models';
|
|
4
4
|
import { FiltersConfig, IFilterQueryResponse } from '@dataclouder/ngx-core';
|
|
5
5
|
export declare const CONVERSATION_AI_TOKEN: InjectionToken<AgentCardsAbstractService>;
|
|
6
6
|
export declare abstract class AgentCardsAbstractService {
|
|
@@ -16,11 +16,11 @@ export declare abstract class AgentCardsAbstractService {
|
|
|
16
16
|
abstract findAgentCardByTitle(title: string): Promise<IAgentCard>;
|
|
17
17
|
abstract saveConversationCard(conversation: IAgentCard): Promise<IAgentCard>;
|
|
18
18
|
abstract deleteConversationCard(id: string): Promise<IAgentCard>;
|
|
19
|
-
abstract getTextAudioFile(tts: TTSRequest): Promise<
|
|
19
|
+
abstract getTextAudioFile(tts: TTSRequest): Promise<AudioGenerated>;
|
|
20
20
|
abstract getConversationUserChatSettings(): Promise<ChatUserSettings>;
|
|
21
21
|
abstract getListModels(provider: string): Promise<ModelName[]>;
|
|
22
22
|
abstract translateConversation(currentLang: string, targetLang: string, id: string): Promise<ChatUserSettings>;
|
|
23
|
-
abstract getAudioTranscriptions(audio:
|
|
23
|
+
abstract getAudioTranscriptions(audio: Blob, options: unknown): Promise<TranscriptionsWhisper>;
|
|
24
24
|
abstract callInstruction(prompt: string, IAIModel: any): Promise<any>;
|
|
25
25
|
abstract saveConversationUserChatSettings(conversation: ChatUserSettings): Promise<ChatUserSettings>;
|
|
26
26
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InjectionToken, Provider, Type } from '@angular/core';
|
|
2
|
+
import { ChatUserSettings } from './agent.models';
|
|
2
3
|
export interface UserDataExchange {
|
|
3
4
|
name: string;
|
|
4
5
|
gender: string;
|
|
@@ -13,4 +14,5 @@ export declare abstract class UserDataExchangeAbstractService {
|
|
|
13
14
|
abstract getParseDict(): {
|
|
14
15
|
[key: string]: string;
|
|
15
16
|
};
|
|
17
|
+
abstract getUserChatSettings(): ChatUserSettings;
|
|
16
18
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* SafeJsonPipe - A pipe that safely stringifies objects with circular references
|
|
5
|
+
* This pipe handles circular references and DOM objects that can't be serialized
|
|
6
|
+
*/
|
|
7
|
+
export declare class SafeJsonPipe implements PipeTransform {
|
|
8
|
+
transform(value: any): string;
|
|
9
|
+
/**
|
|
10
|
+
* Safely stringify an object, handling circular references
|
|
11
|
+
*/
|
|
12
|
+
private stringifySafely;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SafeJsonPipe, never>;
|
|
14
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<SafeJsonPipe, "safeJson", true>;
|
|
15
|
+
}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import { Signal } from '@angular/core';
|
|
2
|
-
import { ChatMessage, IAgentCard,
|
|
2
|
+
import { AudioGenerated, ChatMessage, IAgentCard, IConversationSettings, MessageAudio } from '../models/agent.models';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class ConversationService {
|
|
5
5
|
private agentCardService;
|
|
6
6
|
private messageProcessingService;
|
|
7
|
+
private conversationBuilder;
|
|
8
|
+
private userDataExchange;
|
|
7
9
|
private messagesSignal;
|
|
8
10
|
private isThinkingSignal;
|
|
9
11
|
private conversationSettingsSignal;
|
|
10
|
-
private agentCardSignal;
|
|
11
12
|
private isDestroyedSignal;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
getMessages(): Signal<ChatMessage[]>;
|
|
13
|
+
getMessagesSignal(): Signal<ChatMessage[]>;
|
|
14
|
+
addMessage(message: ChatMessage): void;
|
|
15
15
|
isThinking(): Signal<boolean>;
|
|
16
|
-
getConversationSettings(): Signal<IConversationSettings | null>;
|
|
17
|
-
getAgentCard(): Signal<IAgentCard | null>;
|
|
18
16
|
setDestroyed(value: boolean): void;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
setupConversationWithAgentCard(agentCard: IAgentCard): void;
|
|
18
|
+
initConversationWithSettings(conversationSettings: IConversationSettings): Promise<void>;
|
|
19
|
+
private initConversation;
|
|
20
|
+
initConversationWithAgentCard(agentCard: IAgentCard): Promise<void>;
|
|
22
21
|
sendUserMessage(message: ChatMessage): Promise<void>;
|
|
23
|
-
addMessage(message: ChatMessage): void;
|
|
24
|
-
processAssistantMessage(message: IAgentResponseDTO | ChatMessage, mutate?: boolean): ChatMessage;
|
|
25
22
|
sendCurrentConversation(): Promise<void>;
|
|
26
|
-
private getAudioPlaybackSetting;
|
|
27
23
|
resetConversation(agentCard?: IAgentCard): Promise<void>;
|
|
24
|
+
getTTSFile(message: MessageAudio): Promise<AudioGenerated>;
|
|
28
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConversationService, never>;
|
|
29
26
|
static ɵprov: i0.ɵɵInjectableDeclaration<ConversationService>;
|
|
30
27
|
}
|
|
@@ -2,8 +2,6 @@ import { ChatMessage, IConversationSettings, IAgentCard } from '../models/agent.
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class DCConversationPromptBuilderService {
|
|
4
4
|
private userDataExchange;
|
|
5
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
6
|
-
constructor(...args: unknown[]);
|
|
7
5
|
buildConversationSettings(agentCard: IAgentCard, parseDict?: {
|
|
8
6
|
[key: string]: string;
|
|
9
7
|
}): IConversationSettings;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ChatMessage,
|
|
1
|
+
import { ChatMessage, IConversationSettings } from '../models/agent.models';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class MessageProcessingService {
|
|
4
4
|
constructor();
|
|
5
|
-
processMessage(message:
|
|
5
|
+
processMessage(message: ChatMessage, conversationSettings: IConversationSettings): ChatMessage;
|
|
6
6
|
private processMultiMessages;
|
|
7
7
|
subsItalicsByTag(text: string, voiceId?: string, tagName?: string): string;
|
|
8
8
|
getVoice(voice_value: string, targetLang?: string): string;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -14,5 +14,7 @@ export * from './lib/components/provider-selector/provider-selector.component';
|
|
|
14
14
|
export * from './lib/models/agent.utils';
|
|
15
15
|
export * from './lib/components/chat-container/chat-container.component';
|
|
16
16
|
export * from './lib/components/chat-container/chat.models';
|
|
17
|
-
export * from './lib/components/
|
|
17
|
+
export * from './lib/components/text-highlighter/text-highlighter';
|
|
18
18
|
export * from './lib/components/chat-container/chat-messages-list/chat-message/chat-message.utils';
|
|
19
|
+
export * from './lib/components/chat-container/chat-messages-list/message-orchestrator/message-orchestrator.component';
|
|
20
|
+
export * from './lib/components/extraction.regex';
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { OnInit } from '@angular/core';
|
|
2
|
-
import { ChatMultiMessage } from '../../../../../models/agent.models';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class MultiMessageContentComponent implements OnInit {
|
|
5
|
-
readonly messages: import("@angular/core").InputSignal<ChatMultiMessage[]>;
|
|
6
|
-
readonly isLoading: import("@angular/core").InputSignal<boolean>;
|
|
7
|
-
readonly playAudio: import("@angular/core").OutputEmitterRef<ChatMultiMessage>;
|
|
8
|
-
private currentPlayingIndex;
|
|
9
|
-
constructor();
|
|
10
|
-
/**
|
|
11
|
-
* Checks if a message has transcription timestamps
|
|
12
|
-
* @param message The message to check
|
|
13
|
-
*/
|
|
14
|
-
hasTranscription(message: ChatMultiMessage): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Emits the playAudio event with the selected message and starts sequential playback
|
|
17
|
-
* @param message The message to play
|
|
18
|
-
*/
|
|
19
|
-
onPlayMessage(message: ChatMultiMessage): void;
|
|
20
|
-
/**
|
|
21
|
-
* Method to start playing the sequence
|
|
22
|
-
* @param startIndex Index of the message to start playing from
|
|
23
|
-
*/
|
|
24
|
-
startSequentialPlayback(startIndex?: number): void;
|
|
25
|
-
/**
|
|
26
|
-
* Handle audio completion from child component
|
|
27
|
-
* @param message The message that completed playback
|
|
28
|
-
*/
|
|
29
|
-
onAudioCompleted(message: ChatMultiMessage): void;
|
|
30
|
-
ngOnInit(): void;
|
|
31
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MultiMessageContentComponent, never>;
|
|
32
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MultiMessageContentComponent, "dc-multi-message-content", never, { "messages": { "alias": "messages"; "required": true; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": false; "isSignal": true; }; }, { "playAudio": "playAudio"; }, never, never, true, never>;
|
|
33
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Signal } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { WordTimestamps } from '../models/agent.models';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export interface HighlightedWord {
|
|
6
|
-
word: string;
|
|
7
|
-
index: number;
|
|
8
|
-
isHighlighted: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare class AudioTextSyncService {
|
|
11
|
-
private highlightedWordsSignalMap;
|
|
12
|
-
private highlightedWords$Map;
|
|
13
|
-
private cleanup$Map;
|
|
14
|
-
private activeAudioMap;
|
|
15
|
-
private destroyRef;
|
|
16
|
-
constructor();
|
|
17
|
-
/**
|
|
18
|
-
* Synchronizes audio playback with text transcription
|
|
19
|
-
* @param audioElement The audio element to sync with
|
|
20
|
-
* @param transcriptionTimestamps Array of word timestamps
|
|
21
|
-
* @param messageId Unique identifier for the message
|
|
22
|
-
*/
|
|
23
|
-
syncAudioWithText(audioElement: HTMLAudioElement, transcriptionTimestamps: WordTimestamps[], messageId: string): void;
|
|
24
|
-
/**
|
|
25
|
-
* Stops the sync for a specific message and cleans up resources
|
|
26
|
-
* @param messageId The ID of the message to stop syncing
|
|
27
|
-
*/
|
|
28
|
-
stopSync(messageId: string): void;
|
|
29
|
-
/**
|
|
30
|
-
* Stops all syncs and cleans up all resources
|
|
31
|
-
*/
|
|
32
|
-
stopAllSyncs(): void;
|
|
33
|
-
/**
|
|
34
|
-
* Returns the highlighted words signal for a specific message
|
|
35
|
-
* @param messageId The ID of the message
|
|
36
|
-
*/
|
|
37
|
-
getHighlightedWordsSignal(messageId: string): Signal<HighlightedWord[]>;
|
|
38
|
-
/**
|
|
39
|
-
* Returns the highlighted words observable for a specific message
|
|
40
|
-
* @param messageId The ID of the message
|
|
41
|
-
*/
|
|
42
|
-
getHighlightedWords$(messageId: string): Observable<HighlightedWord[]>;
|
|
43
|
-
/**
|
|
44
|
-
* Checks if a word at a specific index is currently highlighted for a specific message
|
|
45
|
-
* @param messageId The ID of the message
|
|
46
|
-
* @param index The index of the word to check
|
|
47
|
-
*/
|
|
48
|
-
isWordHighlighted(messageId: string, index: number): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Returns an observable that emits true when a word at a specific index is highlighted for a specific message
|
|
51
|
-
* @param messageId The ID of the message
|
|
52
|
-
* @param index The index of the word to observe
|
|
53
|
-
*/
|
|
54
|
-
isWordHighlighted$(messageId: string, index: number): Observable<boolean>;
|
|
55
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AudioTextSyncService, never>;
|
|
56
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AudioTextSyncService>;
|
|
57
|
-
}
|