@dataclouder/ngx-agent-cards 0.1.4 → 0.1.6
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 +515 -167
- package/fesm2022/dataclouder-ngx-agent-cards.mjs.map +1 -1
- package/lib/components/chat-container/chat-container.component.d.ts +6 -5
- package/lib/components/chat-container/chat-footer/chat-footer.component.d.ts +8 -4
- package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.component.d.ts +1 -0
- package/lib/components/chat-container/chat-messages-list/message-orchestrator/message-orchestrator.component.d.ts +2 -0
- package/lib/components/dc-agent-card-lists/agent-card-default-ui/agent-card-default-ui.component.d.ts +2 -2
- package/lib/components/dc-agent-card-lists/dc-agent-card-lists.component.d.ts +1 -0
- package/lib/components/text-highlighter/extract-tags.d.ts +4 -0
- package/lib/components/text-highlighter/text-highlighter.d.ts +19 -24
- package/lib/models/agent.models.d.ts +28 -2
- package/lib/services/agent-user-progress.service.d.ts +17 -0
- package/lib/services/conversation.service.d.ts +25 -2
- package/lib/services/evaluation.service.d.ts +11 -1
- package/lib/services/popup.service.d.ts +41 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OnInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { MicSettings } from '@dataclouder/ngx-mic';
|
|
3
|
-
import { ChatMessage, ChatUserSettings, IAgentCard, IConversationSettings,
|
|
3
|
+
import { ChatMessage, ChatUserSettings, IAgentCard, IConversationSettings, SimpleAgentTask } from '../../models/agent.models';
|
|
4
|
+
import { ChatEvent } from '../../models/agent.models';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class DCChatComponent implements OnInit, OnDestroy {
|
|
6
7
|
private dialogService;
|
|
@@ -10,12 +11,12 @@ export declare class DCChatComponent implements OnInit, OnDestroy {
|
|
|
10
11
|
chatUserSettings: ChatUserSettings;
|
|
11
12
|
conversationSettings: IConversationSettings;
|
|
12
13
|
agentCard: IAgentCard;
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
14
|
+
readonly taskOnUserMessage: import("@angular/core").InputSignal<SimpleAgentTask>;
|
|
15
|
+
readonly taskOnAssistantMessage: import("@angular/core").InputSignal<SimpleAgentTask>;
|
|
15
16
|
readonly parseDict: import("@angular/core").InputSignal<{
|
|
16
17
|
[key: string]: string;
|
|
17
18
|
}>;
|
|
18
|
-
readonly sendMessage: import("@angular/core").OutputEmitterRef<
|
|
19
|
+
readonly sendMessage: import("@angular/core").OutputEmitterRef<ChatEvent<any>>;
|
|
19
20
|
readonly goalCompleted: import("@angular/core").OutputEmitterRef<void>;
|
|
20
21
|
messages: import("@angular/core").WritableSignal<ChatMessage[]>;
|
|
21
22
|
micSettings: MicSettings;
|
|
@@ -37,5 +38,5 @@ export declare class DCChatComponent implements OnInit, OnDestroy {
|
|
|
37
38
|
*/
|
|
38
39
|
restartConversation(conversation?: IAgentCard | null): Promise<void>;
|
|
39
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<DCChatComponent, never>;
|
|
40
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DCChatComponent, "dc-chat", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": false; }; "conversationSettings": { "alias": "conversationSettings"; "required": false; }; "agentCard": { "alias": "agentCard"; "required": false; }; "
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DCChatComponent, "dc-chat", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": false; }; "conversationSettings": { "alias": "conversationSettings"; "required": false; }; "agentCard": { "alias": "agentCard"; "required": false; }; "taskOnUserMessage": { "alias": "taskOnUserMessage"; "required": false; "isSignal": true; }; "taskOnAssistantMessage": { "alias": "taskOnAssistantMessage"; "required": false; "isSignal": true; }; "parseDict": { "alias": "parseDict"; "required": false; "isSignal": true; }; }, { "sendMessage": "sendMessage"; "goalCompleted": "goalCompleted"; }, never, never, true, never>;
|
|
41
42
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { FormControl } from '@angular/forms';
|
|
2
2
|
import { MicSettings, AudioRecording } from '@dataclouder/ngx-mic';
|
|
3
|
-
import { ChatMessage,
|
|
3
|
+
import { ChatMessage, SimpleAgentTask } from '../../../models/agent.models';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class ChatFooterComponent {
|
|
6
6
|
private conversationService;
|
|
7
7
|
private evaluationService;
|
|
8
8
|
private agentCardService;
|
|
9
9
|
readonly isAIThinking: import("@angular/core").InputSignal<boolean>;
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
10
|
+
readonly taskOnUserMessage: import("@angular/core").InputSignal<SimpleAgentTask>;
|
|
11
|
+
readonly taskOnAssistantMessage: import("@angular/core").InputSignal<SimpleAgentTask>;
|
|
12
12
|
readonly micSettings: import("@angular/core").InputSignal<MicSettings>;
|
|
13
13
|
readonly sendMessage: import("@angular/core").OutputEmitterRef<ChatMessage>;
|
|
14
14
|
readonly textInputChanged: import("@angular/core").OutputEmitterRef<string>;
|
|
@@ -40,6 +40,10 @@ export declare class ChatFooterComponent {
|
|
|
40
40
|
/**
|
|
41
41
|
* Evaluate conversation using evaluator agent
|
|
42
42
|
*/
|
|
43
|
+
/**
|
|
44
|
+
* Evaluate a specific message using the evaluator agent task.
|
|
45
|
+
* @param messageToEvaluate The ChatMessage (typically the user's last message) to evaluate.
|
|
46
|
+
*/
|
|
43
47
|
private evaluateConversation;
|
|
44
48
|
handleAudioRecorded(event: AudioRecording): void;
|
|
45
49
|
/**
|
|
@@ -53,5 +57,5 @@ export declare class ChatFooterComponent {
|
|
|
53
57
|
onMicFinished(eventBlob: Blob | any): Promise<void>;
|
|
54
58
|
setScore(score: number): void;
|
|
55
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatFooterComponent, never>;
|
|
56
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ChatFooterComponent, "dc-chat-footer", never, { "isAIThinking": { "alias": "isAIThinking"; "required": false; "isSignal": true; }; "
|
|
60
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatFooterComponent, "dc-chat-footer", never, { "isAIThinking": { "alias": "isAIThinking"; "required": false; "isSignal": true; }; "taskOnUserMessage": { "alias": "taskOnUserMessage"; "required": false; "isSignal": true; }; "taskOnAssistantMessage": { "alias": "taskOnAssistantMessage"; "required": false; "isSignal": true; }; "micSettings": { "alias": "micSettings"; "required": false; "isSignal": true; }; }, { "sendMessage": "sendMessage"; "textInputChanged": "textInputChanged"; }, never, never, true, never>;
|
|
57
61
|
}
|
package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.component.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare class ChatMessageComponent {
|
|
|
11
11
|
evaluationEmoji: import("@angular/core").Signal<string>;
|
|
12
12
|
private messageEffect;
|
|
13
13
|
showEvaluation(): void;
|
|
14
|
+
printData(): void;
|
|
14
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatMessageComponent, never>;
|
|
15
16
|
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>;
|
|
16
17
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { ChatRole, MessageAudio } from '../../../../models/agent.models';
|
|
3
|
+
import { WordData } from '../../../../services/popup.service';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class MessageOrchestratorComponent implements OnInit {
|
|
5
6
|
private conversationService;
|
|
@@ -21,6 +22,7 @@ export declare class MessageOrchestratorComponent implements OnInit {
|
|
|
21
22
|
onAudioCompleted(message: MessageAudio): void;
|
|
22
23
|
changeStates(index: number, messageAudio: MessageAudio): void;
|
|
23
24
|
generateAudio(message: MessageAudio, overwriteText?: string | null): Promise<MessageAudio>;
|
|
25
|
+
onWordClicked(wordData: WordData): void;
|
|
24
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageOrchestratorComponent, never>;
|
|
25
27
|
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
28
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type OnInit } from '@angular/core';
|
|
2
|
-
import { IAgentCard } from '../../../models/agent.models';
|
|
2
|
+
import { IAgentCard, IAgentCardMeta } from '../../../models/agent.models';
|
|
3
3
|
import { MenuItem } from 'primeng/api';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class DCConversationCardUIComponent implements OnInit {
|
|
6
6
|
speedDialModel: MenuItem[];
|
|
7
7
|
ngOnInit(): void;
|
|
8
|
-
readonly card: import("@angular/core").InputSignal<
|
|
8
|
+
readonly card: import("@angular/core").InputSignal<IAgentCardMeta>;
|
|
9
9
|
readonly showOptions: import("@angular/core").InputSignal<boolean>;
|
|
10
10
|
readonly onCardAction: import("@angular/core").OutputEmitterRef<{
|
|
11
11
|
event: string;
|
|
@@ -36,6 +36,7 @@ export declare class AgentCardListComponent extends PaginationBase implements On
|
|
|
36
36
|
deleteCard(id: string): Promise<void>;
|
|
37
37
|
protected loadData(): Promise<void>;
|
|
38
38
|
doFilterBarAction({ action, item }: OnActionEvent): void;
|
|
39
|
+
newAgentCard(): void;
|
|
39
40
|
search(text: string): Promise<void>;
|
|
40
41
|
filterChange(filters: FiltersConfig): Promise<void>;
|
|
41
42
|
onCardAction(actionEvent: OnActionEvent): void;
|
|
@@ -1,48 +1,38 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
2
|
import { MessageAudio } from '../../models/agent.models';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
|
|
5
|
-
* Interface for highlighted word state
|
|
6
|
-
*/
|
|
7
|
-
export interface HighlightedWord {
|
|
4
|
+
export interface IWordMetadata {
|
|
8
5
|
word: string;
|
|
9
6
|
index: number;
|
|
10
|
-
isHighlighted
|
|
7
|
+
isHighlighted?: boolean;
|
|
8
|
+
tag?: string;
|
|
11
9
|
}
|
|
12
10
|
export declare class TextHighlighterComponent implements OnDestroy {
|
|
13
11
|
message: import("@angular/core").InputSignal<MessageAudio>;
|
|
14
|
-
|
|
12
|
+
readonly playAudio: import("@angular/core").OutputEmitterRef<MessageAudio>;
|
|
13
|
+
readonly audioCompleted: import("@angular/core").OutputEmitterRef<MessageAudio>;
|
|
14
|
+
readonly wordClicked: import("@angular/core").OutputEmitterRef<{
|
|
15
|
+
word: string;
|
|
16
|
+
index: number;
|
|
17
|
+
messageId: string;
|
|
18
|
+
}>;
|
|
19
|
+
wordWithMeta: import("@angular/core").WritableSignal<IWordMetadata[]>;
|
|
15
20
|
isPlaying: import("@angular/core").WritableSignal<boolean>;
|
|
21
|
+
wordsWithMetaState: IWordMetadata[];
|
|
16
22
|
iconState: import("@angular/core").Signal<"isLoading" | "isPlaying" | "playable" | "idle">;
|
|
17
23
|
isLoading: import("@angular/core").Signal<boolean>;
|
|
18
24
|
shouldPlayAudio: import("@angular/core").Signal<boolean>;
|
|
19
25
|
messageText: import("@angular/core").Signal<string>;
|
|
20
26
|
classTag: import("@angular/core").Signal<string>;
|
|
21
27
|
hasTranscription: import("@angular/core").Signal<boolean>;
|
|
22
|
-
readonly playAudio: import("@angular/core").OutputEmitterRef<MessageAudio>;
|
|
23
|
-
readonly audioCompleted: import("@angular/core").OutputEmitterRef<MessageAudio>;
|
|
24
28
|
private audioElement;
|
|
25
29
|
private destroy$;
|
|
26
|
-
private cdr;
|
|
27
30
|
private destroyRef;
|
|
28
31
|
constructor();
|
|
29
|
-
/**
|
|
30
|
-
* Track function for ngFor to improve performance
|
|
31
|
-
*/
|
|
32
32
|
trackByIndex(index: number, item: any): number;
|
|
33
33
|
ngOnDestroy(): void;
|
|
34
34
|
private initializeBasedOnMessage;
|
|
35
|
-
/**
|
|
36
|
-
* Initialize the audio element and set up event listeners
|
|
37
|
-
*/
|
|
38
35
|
private initializeAudio;
|
|
39
|
-
/**
|
|
40
|
-
* Initialize highlighted words from transcription timestamps
|
|
41
|
-
*/
|
|
42
|
-
private initializeHighlightedWords;
|
|
43
|
-
/**
|
|
44
|
-
* Set up audio synchronization with text
|
|
45
|
-
*/
|
|
46
36
|
private subcribeToAudioSync;
|
|
47
37
|
private subscribeToEndAudio;
|
|
48
38
|
/**
|
|
@@ -54,9 +44,14 @@ export declare class TextHighlighterComponent implements OnDestroy {
|
|
|
54
44
|
*/
|
|
55
45
|
onPlayMessage(): void;
|
|
56
46
|
/**
|
|
57
|
-
*
|
|
47
|
+
* Initialize plain text words by splitting the message text
|
|
58
48
|
*/
|
|
49
|
+
private initializePlainTextWords;
|
|
50
|
+
onWordClick(wordData: {
|
|
51
|
+
word: string;
|
|
52
|
+
index: number;
|
|
53
|
+
} | IWordMetadata): void;
|
|
59
54
|
private startAudioPlayback;
|
|
60
55
|
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>;
|
|
56
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextHighlighterComponent, "dc-text-highlighter", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; }, { "playAudio": "playAudio"; "audioCompleted": "audioCompleted"; "wordClicked": "wordClicked"; }, never, never, true, never>;
|
|
62
57
|
}
|
|
@@ -75,16 +75,26 @@ export interface IAgentCard {
|
|
|
75
75
|
lang?: string;
|
|
76
76
|
model?: IAIModel;
|
|
77
77
|
assets?: IAgentAssets;
|
|
78
|
+
image?: CloudStorageData;
|
|
78
79
|
characterCard?: ICharacterCardDC;
|
|
79
80
|
conversationSettings?: IConversationSettings;
|
|
80
81
|
metaApp?: IAgentMetadata;
|
|
81
82
|
accounts?: Array<IAccounts>;
|
|
82
83
|
}
|
|
84
|
+
export interface IAgentCardMeta extends IAgentCard {
|
|
85
|
+
taken: any;
|
|
86
|
+
}
|
|
83
87
|
export declare const EvalResultStringDefinition = "\ninterface SimpleEvalResult {\n score: number; // Score of the user's response 0 to 3\n feedback: string; // Feedback of the user's understanding of the conversation\n}";
|
|
84
88
|
export interface SimpleEvalResult {
|
|
85
89
|
score: number;
|
|
86
90
|
feedback: string;
|
|
87
91
|
}
|
|
92
|
+
export interface LanguageEvaluation {
|
|
93
|
+
score: number;
|
|
94
|
+
grammarFix: string;
|
|
95
|
+
lexicalFix: string;
|
|
96
|
+
sentenceFix: string;
|
|
97
|
+
}
|
|
88
98
|
export interface ISimpleAgent {
|
|
89
99
|
systemPrompt: string;
|
|
90
100
|
model: IAIModel;
|
|
@@ -127,8 +137,9 @@ export type TranscriptionsWhisper = {
|
|
|
127
137
|
text: string;
|
|
128
138
|
task: string;
|
|
129
139
|
language: string;
|
|
130
|
-
words
|
|
140
|
+
words?: any[];
|
|
131
141
|
duration: number;
|
|
142
|
+
segments?: any[];
|
|
132
143
|
};
|
|
133
144
|
export declare class WordTimestamps {
|
|
134
145
|
word: string;
|
|
@@ -164,7 +175,7 @@ export declare class ChatMessage extends MessageAudio {
|
|
|
164
175
|
promisePlay?: any;
|
|
165
176
|
stats?: any;
|
|
166
177
|
multiMessages?: MessageAudio[];
|
|
167
|
-
evaluation?:
|
|
178
|
+
evaluation?: Record<string, any>;
|
|
168
179
|
}
|
|
169
180
|
export declare class ChatUserSettings {
|
|
170
181
|
realTime: boolean;
|
|
@@ -212,3 +223,18 @@ export type TTSRequest = {
|
|
|
212
223
|
speed?: string;
|
|
213
224
|
ssml?: string;
|
|
214
225
|
};
|
|
226
|
+
export declare enum ChatEventType {
|
|
227
|
+
WordClicked = "wordClicked"
|
|
228
|
+
}
|
|
229
|
+
export interface ChatEvent<T = any> {
|
|
230
|
+
type: ChatEventType;
|
|
231
|
+
payload: T;
|
|
232
|
+
}
|
|
233
|
+
export declare enum ContextType {
|
|
234
|
+
CurrentMessageContent = "MessageContent",
|
|
235
|
+
LastAssistantMessage = "LastAssistantMessage",
|
|
236
|
+
LastUserMessage = "LastUserMessage",
|
|
237
|
+
LastDialog = "LastDialog",// Last User + Last Assistant
|
|
238
|
+
Last2Dialogs = "Last2Dialogs",// Last 2 User + Last 2 Assistant
|
|
239
|
+
AllConversation = "AllConversation"
|
|
240
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare enum AgentCardProgressStatus {
|
|
3
|
+
NotStarted = "not_started",
|
|
4
|
+
Started = "started",
|
|
5
|
+
Completed = "completed"
|
|
6
|
+
}
|
|
7
|
+
export interface AgentCardUserProgress {
|
|
8
|
+
agentCardId: string;
|
|
9
|
+
status: AgentCardProgressStatus;
|
|
10
|
+
}
|
|
11
|
+
export declare class AgentUserProgressService {
|
|
12
|
+
private httpService;
|
|
13
|
+
getProgress(): Promise<any>;
|
|
14
|
+
saveProgress(progress: AgentCardUserProgress): Promise<any>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AgentUserProgressService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AgentUserProgressService>;
|
|
17
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Signal } from '@angular/core';
|
|
2
|
+
import { WordData } from '../services/popup.service';
|
|
2
3
|
import { AudioGenerated, ChatMessage, ChatUserSettings, IAgentCard, IConversationSettings, MessageAudio } from '../models/agent.models';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class ConversationService {
|
|
@@ -15,9 +16,20 @@ export declare class ConversationService {
|
|
|
15
16
|
message: MessageAudio;
|
|
16
17
|
completed: boolean;
|
|
17
18
|
}>;
|
|
19
|
+
private wordClickedSignal;
|
|
18
20
|
private avatarImages;
|
|
19
21
|
getMessagesSignal(): Signal<ChatMessage[]>;
|
|
20
22
|
getUserSettings(): ChatUserSettings;
|
|
23
|
+
/**
|
|
24
|
+
* Notifies subscribers that a word has been clicked in a message.
|
|
25
|
+
* @param wordData The data associated with the clicked word.
|
|
26
|
+
*/
|
|
27
|
+
notifyWordClicked(wordData: WordData): void;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the signal that emits when a word is clicked.
|
|
30
|
+
* @returns A signal emitting WordData or null.
|
|
31
|
+
*/
|
|
32
|
+
getWordClickedSignal(): Signal<WordData | null>;
|
|
21
33
|
addMessage(message: ChatMessage): string;
|
|
22
34
|
updateMessage(messageId: string, updatedMessage: Partial<ChatMessage>): boolean;
|
|
23
35
|
isThinking(): Signal<boolean>;
|
|
@@ -30,8 +42,19 @@ export declare class ConversationService {
|
|
|
30
42
|
initConversationWithAgentCard(agentCard: IAgentCard, parseDict?: {
|
|
31
43
|
[key: string]: string;
|
|
32
44
|
}): Promise<void>;
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Sends a user message, processes it, adds it to the conversation,
|
|
47
|
+
* and triggers the AI response flow.
|
|
48
|
+
* @param message The initial ChatMessage object from the user.
|
|
49
|
+
* @param updateId Optional ID if this message should update an existing one (e.g., transcription added).
|
|
50
|
+
* @param updateId Optional ID if this message should update an existing one (e.g., transcription added).
|
|
51
|
+
* @returns A promise resolving to an object containing the user message ID and the assistant message ID (or null if an error occurred).
|
|
52
|
+
*/
|
|
53
|
+
sendUserMessage(message: ChatMessage, updateId?: string | null): Promise<{
|
|
54
|
+
userMessageId: string;
|
|
55
|
+
assistantMessageId: string | null;
|
|
56
|
+
} | null>;
|
|
57
|
+
sendCurrentConversation(): Promise<string | null>;
|
|
35
58
|
resetConversation(agentCard?: IAgentCard): Promise<void>;
|
|
36
59
|
getTTSFile(message: MessageAudio): Promise<AudioGenerated>;
|
|
37
60
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConversationService, never>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Signal } from '@angular/core';
|
|
2
2
|
import { ChatMessage, IMiniAgentCard, SimpleAgentTask } from '../models/agent.models';
|
|
3
|
+
import { ContextType } from '../models/agent.models';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class EvaluationService {
|
|
5
6
|
private agentCardService;
|
|
@@ -11,7 +12,16 @@ export declare class EvaluationService {
|
|
|
11
12
|
setScore(score: number): void;
|
|
12
13
|
getEvaluationResult(): Signal<any>;
|
|
13
14
|
evaluateConversation(messages: ChatMessage[], evaluator: IMiniAgentCard): Promise<any>;
|
|
14
|
-
|
|
15
|
+
private getContextMessages;
|
|
16
|
+
/**
|
|
17
|
+
* Evaluates a conversation context based on a specific task and attaches the result to a designated message.
|
|
18
|
+
* @param agentTask The task definition for the evaluation.
|
|
19
|
+
* @param messageToUpdate The specific ChatMessage object (user or assistant) to attach the evaluation results to.
|
|
20
|
+
* @param contextType Determines which part of the conversation history to send as context (default: AllConversation).
|
|
21
|
+
* @returns The JSON result of the evaluation.
|
|
22
|
+
*/
|
|
23
|
+
evaluateWithTask(agentTask: SimpleAgentTask, messageToUpdate: ChatMessage, // Message to attach the evaluation to
|
|
24
|
+
contextType?: ContextType): Promise<any>;
|
|
15
25
|
private updateScore;
|
|
16
26
|
resetScore(): void;
|
|
17
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<EvaluationService, never>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Injector, Type, WritableSignal } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export interface WordData {
|
|
4
|
+
word: string;
|
|
5
|
+
index: number;
|
|
6
|
+
messageId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class PopupService {
|
|
9
|
+
private renderer;
|
|
10
|
+
private document;
|
|
11
|
+
private rendererFactory;
|
|
12
|
+
private appRef;
|
|
13
|
+
private injector;
|
|
14
|
+
private environmentInjector;
|
|
15
|
+
private currentPopupContainer;
|
|
16
|
+
private currentComponentRef;
|
|
17
|
+
readonly selectedWord: WritableSignal<WordData>;
|
|
18
|
+
private clickListenerUnlisten;
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Shows a popup containing a dynamically created component.
|
|
22
|
+
* @param top Position from the top of the viewport.
|
|
23
|
+
* @param left Position from the left of the viewport.
|
|
24
|
+
* @param componentType The type of component to render inside the popup.
|
|
25
|
+
* @param injector The injector to use for the dynamic component.
|
|
26
|
+
* @param wordData The WordData to pass to the component's input signal.
|
|
27
|
+
*/
|
|
28
|
+
showPopup<T extends {
|
|
29
|
+
wordData: WritableSignal<WordData | null>;
|
|
30
|
+
}>(// Constrain T
|
|
31
|
+
top: number, left: number, componentType: Type<T>, injector: Injector, wordData: WordData): void;
|
|
32
|
+
/**
|
|
33
|
+
* Hides the currently displayed popup and destroys the dynamic component.
|
|
34
|
+
*/
|
|
35
|
+
hidePopup(): void;
|
|
36
|
+
private addOutsideClickListener;
|
|
37
|
+
private removeOutsideClickListener;
|
|
38
|
+
ngOnDestroy(): void;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PopupService, never>;
|
|
40
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PopupService>;
|
|
41
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './lib/models/conversation-ai.class';
|
|
|
3
3
|
export * from './lib/models/conversation-enums';
|
|
4
4
|
export * from './lib/services/audio.service';
|
|
5
5
|
export * from './lib/services/dc-conversation-builder.service';
|
|
6
|
+
export * from './lib/services/popup.service';
|
|
7
|
+
export * from './lib/services/agent-user-progress.service';
|
|
6
8
|
export * from './lib/components/chat-container/chat-container.component';
|
|
7
9
|
export * from './lib/components/dc-agent-form/dc-agent-card-form.component';
|
|
8
10
|
export * from './lib/components/dc-agent-card-lists/dc-agent-card-lists.component';
|