@dataclouder/ngx-agent-cards 0.1.32 → 0.1.34
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 +939 -720
- package/fesm2022/dataclouder-ngx-agent-cards.mjs.map +1 -1
- package/lib/components/chat-container/chat-container.component.d.ts +2 -2
- package/lib/components/chat-container/chat-header/chat-header.component.d.ts +4 -0
- package/lib/components/chat-container/chat-messages-list/chat-message/chat-message-orchestrator/message-orchestrator.component.d.ts +1 -2
- package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.component.d.ts +3 -1
- package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.utils.d.ts +2 -1
- package/lib/components/conversation-info/conversation-inspector.d.ts +1 -0
- package/lib/components/cost-details/cost-details.component.d.ts +16 -0
- package/lib/components/dc-agent-card-lists/agent-card-default-ui/agent-card-default-ui.component.d.ts +2 -0
- package/lib/components/dc-agent-card-lists/dc-agent-card-lists.component.d.ts +5 -5
- package/lib/components/dc-agent-form/dc-agent-card-form.component.d.ts +4 -4
- package/lib/components/dc-agent-form/dc-manageable-form/dc-manageable-form.component.d.ts +11 -0
- package/lib/components/dc-agent-form/{form-group.service.d.ts → form-definition.service.d.ts} +4 -1
- package/lib/models/agent.models.d.ts +20 -11
- package/lib/services/ai-generation.service.d.ts +10 -0
- package/lib/services/conversation-cost.service.d.ts +34 -0
- package/lib/services/conversation.service.d.ts +4 -1
- package/lib/services/cost-details.service.d.ts +7 -0
- package/lib/services/default-agent-service.d.ts +3 -3
- package/package.json +1 -1
- package/public-api.d.ts +5 -3
|
@@ -22,7 +22,7 @@ export declare class DCChatComponent implements OnInit, OnDestroy {
|
|
|
22
22
|
readonly parseDict: import("@angular/core").InputSignal<{
|
|
23
23
|
[key: string]: string;
|
|
24
24
|
}>;
|
|
25
|
-
readonly
|
|
25
|
+
readonly chatEvent: import("@angular/core").OutputEmitterRef<ChatEvent<any>>;
|
|
26
26
|
readonly goalCompleted: import("@angular/core").OutputEmitterRef<void>;
|
|
27
27
|
messages: import("@angular/core").WritableSignal<ChatMessage[]>;
|
|
28
28
|
micSettings: MicSettings;
|
|
@@ -44,5 +44,5 @@ export declare class DCChatComponent implements OnInit, OnDestroy {
|
|
|
44
44
|
restartConversation(conversation?: IAgentCard | null): Promise<void>;
|
|
45
45
|
complete(): void;
|
|
46
46
|
static ɵfac: i0.ɵɵFactoryDeclaration<DCChatComponent, never>;
|
|
47
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DCChatComponent, "dc-chat", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": false; }; "conversationSettings": { "alias": "conversationSettings"; "required": false; }; "conversationFlow": { "alias": "conversationFlow"; "required": false; }; "agentCard": { "alias": "agentCard"; "required": false; }; "parseDict": { "alias": "parseDict"; "required": false; "isSignal": true; }; }, { "
|
|
47
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DCChatComponent, "dc-chat", never, { "chatUserSettings": { "alias": "chatUserSettings"; "required": false; }; "conversationSettings": { "alias": "conversationSettings"; "required": false; }; "conversationFlow": { "alias": "conversationFlow"; "required": false; }; "agentCard": { "alias": "agentCard"; "required": false; }; "parseDict": { "alias": "parseDict"; "required": false; "isSignal": true; }; }, { "chatEvent": "chatEvent"; "goalCompleted": "goalCompleted"; }, never, never, true, never>;
|
|
48
48
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { IAgentCard } from '../../../models/agent.models';
|
|
2
|
+
import { ConversationCostService } from '../../../services/conversation-cost.service';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class ChatHeaderComponent {
|
|
4
5
|
readonly isAdmin: import("@angular/core").InputSignal<boolean>;
|
|
5
6
|
alternativeConversation: IAgentCard[];
|
|
6
7
|
agentCard: IAgentCard;
|
|
7
8
|
private evaluationService;
|
|
9
|
+
conversationCostService: ConversationCostService;
|
|
10
|
+
private costDetailsService;
|
|
8
11
|
readonly restartConversationEvent: import("@angular/core").OutputEmitterRef<IAgentCard>;
|
|
9
12
|
readonly showInfoEvent: import("@angular/core").OutputEmitterRef<void>;
|
|
10
13
|
readonly settingsClickEvent: import("@angular/core").OutputEmitterRef<void>;
|
|
@@ -14,6 +17,7 @@ export declare class ChatHeaderComponent {
|
|
|
14
17
|
settingsClick(): void;
|
|
15
18
|
complete(): void;
|
|
16
19
|
openFeedback(): void;
|
|
20
|
+
openCostDetails(): void;
|
|
17
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatHeaderComponent, never>;
|
|
18
22
|
static ɵcmp: i0.ɵɵComponentDeclaration<ChatHeaderComponent, "dc-chat-header", never, { "isAdmin": { "alias": "isAdmin"; "required": false; "isSignal": true; }; "alternativeConversation": { "alias": "alternativeConversation"; "required": false; }; "agentCard": { "alias": "agentCard"; "required": false; }; }, { "restartConversationEvent": "restartConversationEvent"; "showInfoEvent": "showInfoEvent"; "settingsClickEvent": "settingsClickEvent"; "completeEvent": "completeEvent"; }, never, never, true, never>;
|
|
19
23
|
}
|
|
@@ -6,11 +6,10 @@ export declare class ChatMessageOrchestratorComponent implements OnInit {
|
|
|
6
6
|
private orchestrationService;
|
|
7
7
|
messages: import("@angular/core").InputSignal<MessageContent[]>;
|
|
8
8
|
messageRole: import("@angular/core").InputSignal<ChatRole>;
|
|
9
|
-
audioCompleted: import("@angular/core").OutputEmitterRef<MessageContent>;
|
|
10
9
|
messagesSignal: import("@angular/core").Signal<MessageContent[]>;
|
|
11
10
|
ngOnInit(): void;
|
|
12
11
|
onAudioCompleted(message: MessageContent): void;
|
|
13
12
|
onWordClicked(wordData: WordData): void;
|
|
14
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatMessageOrchestratorComponent, never>;
|
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ChatMessageOrchestratorComponent, "dc-message-orchestrator", never, { "messages": { "alias": "messages"; "required": true; "isSignal": true; }; "messageRole": { "alias": "messageRole"; "required": true; "isSignal": true; }; }, {
|
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatMessageOrchestratorComponent, "dc-message-orchestrator", never, { "messages": { "alias": "messages"; "required": true; "isSignal": true; }; "messageRole": { "alias": "messageRole"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
16
15
|
}
|
package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.component.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ChatMessage, MessageContent } from '../../../../models/agent.models';
|
|
2
1
|
import { ChatUserSettings } from '@dataclouder/ngx-core';
|
|
2
|
+
import { ChatMessage, MessageContent } from '../../../../models/agent.models';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class ChatMessageComponent {
|
|
5
|
+
private aiGenerationService;
|
|
5
6
|
chatMessage: import("@angular/core").InputSignal<ChatMessage>;
|
|
6
7
|
chatUserSettings: import("@angular/core").InputSignal<ChatUserSettings>;
|
|
7
8
|
audioMessage: import("@angular/core").WritableSignal<MessageContent>;
|
|
@@ -13,6 +14,7 @@ export declare class ChatMessageComponent {
|
|
|
13
14
|
constructor();
|
|
14
15
|
showEvaluation(): void;
|
|
15
16
|
printData(): void;
|
|
17
|
+
generateImage(): Promise<void>;
|
|
16
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatMessageComponent, never>;
|
|
17
19
|
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>;
|
|
18
20
|
}
|
package/lib/components/chat-container/chat-messages-list/chat-message/chat-message.utils.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AudioGenerated, MessageContent
|
|
1
|
+
import { AudioGenerated, MessageContent } from '../../../../models/agent.models';
|
|
2
2
|
import { ChatUserSettings } from '@dataclouder/ngx-core';
|
|
3
|
+
import { TTSRequest } from '@dataclouder/ngx-vertex';
|
|
3
4
|
export declare function matchTranscription(originalText: string, transcription: any[]): any[];
|
|
4
5
|
export declare function extractAudioAndTranscription(message: MessageContent, audio: AudioGenerated): MessageContent;
|
|
5
6
|
export declare function buildObjectTTSRequest(message: MessageContent, settings?: ChatUserSettings): TTSRequest;
|
|
@@ -18,6 +18,7 @@ export declare class ConversationInspector {
|
|
|
18
18
|
constructor();
|
|
19
19
|
setScore(): void;
|
|
20
20
|
callAgent(): void;
|
|
21
|
+
exportChat(type: 'all' | 'conversation'): void;
|
|
21
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<ConversationInspector, never>;
|
|
22
23
|
static ɵcmp: i0.ɵɵComponentDeclaration<ConversationInspector, "dc-conversation-info", never, {}, {}, never, never, true, never>;
|
|
23
24
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ConversationCostService, ITagCost } from '../../services/conversation-cost.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class CostDetailsComponent {
|
|
4
|
+
conversationCostService: ConversationCostService;
|
|
5
|
+
usageByTag: import("@angular/core").Signal<Record<string, ITagCost>>;
|
|
6
|
+
get usageArray(): {
|
|
7
|
+
inputCost: number;
|
|
8
|
+
outputCost: number;
|
|
9
|
+
totalCost: number;
|
|
10
|
+
tokenUsage: import("../../services/conversation-cost.service").ITokenUsage;
|
|
11
|
+
apiCalls: number;
|
|
12
|
+
tag: string;
|
|
13
|
+
}[];
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CostDetailsComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CostDetailsComponent, "dc-cost-details", never, {}, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
@@ -2,6 +2,7 @@ import { type OnInit } from '@angular/core';
|
|
|
2
2
|
import { IAgentCard } from '../../../models/agent.models';
|
|
3
3
|
import { MenuItem } from 'primeng/api';
|
|
4
4
|
import { OnActionEvent } from '@dataclouder/ngx-core';
|
|
5
|
+
import { UserService } from '@dataclouder/ngx-users';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
declare enum EventCard {
|
|
7
8
|
Edit = "edit",
|
|
@@ -11,6 +12,7 @@ declare enum EventCard {
|
|
|
11
12
|
}
|
|
12
13
|
export declare class AgentCardUI implements OnInit {
|
|
13
14
|
eventType: typeof EventCard;
|
|
15
|
+
userService: UserService;
|
|
14
16
|
speedDialModel: MenuItem[];
|
|
15
17
|
ngOnInit(): void;
|
|
16
18
|
readonly card: import("@angular/core").InputSignal<IAgentCard>;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { OnInit
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
2
|
import { IAgentCard, IAgentCardMeta } from '../../models/agent.models';
|
|
3
3
|
import { EntityBaseListComponent, PColumn, OnActionEvent, ICustomFilter } from '@dataclouder/ngx-core';
|
|
4
4
|
import { MenuItem } from 'primeng/api';
|
|
5
5
|
import { DefaultAgentCardsService } from '../../services/default-agent-service';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class AgentCardListComponent extends EntityBaseListComponent<IAgentCard> implements OnInit
|
|
8
|
-
|
|
7
|
+
export declare class AgentCardListComponent extends EntityBaseListComponent<IAgentCard> implements OnInit {
|
|
8
|
+
extraFilters: ICustomFilter[];
|
|
9
9
|
readonly showOptions: import("@angular/core").InputSignal<boolean>;
|
|
10
10
|
readonly gridLayout: import("@angular/core").InputSignal<boolean>;
|
|
11
11
|
readonly customGetButtons: import("@angular/core").InputSignal<(card: IAgentCard) => MenuItem[]>;
|
|
12
12
|
protected entityCommunicationService: DefaultAgentCardsService;
|
|
13
13
|
private toastService;
|
|
14
14
|
columns: PColumn[];
|
|
15
|
+
customFilters: ICustomFilter[];
|
|
15
16
|
constructor();
|
|
16
17
|
getCustomButtons(item: IAgentCard): MenuItem[];
|
|
17
18
|
ngOnInit(): Promise<void>;
|
|
18
|
-
ngOnDestroy(): void;
|
|
19
19
|
handleTableAction(actionEvent: OnActionEvent): void;
|
|
20
20
|
getCardMeta(card: IAgentCard): IAgentCardMeta;
|
|
21
21
|
handleAction(actionEvent: OnActionEvent): void;
|
|
22
22
|
applyFilterBarEvent(filterEvent: OnActionEvent): void;
|
|
23
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<AgentCardListComponent, never>;
|
|
24
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AgentCardListComponent, "dc-agent-card-lists", never, { "
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AgentCardListComponent, "dc-agent-card-lists", never, { "extraFilters": { "alias": "extraFilters"; "required": false; }; "showOptions": { "alias": "showOptions"; "required": false; "isSignal": true; }; "gridLayout": { "alias": "gridLayout"; "required": false; "isSignal": true; }; "customGetButtons": { "alias": "customGetButtons"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
25
25
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FormArray, FormGroup } from '@angular/forms';
|
|
2
2
|
import { StorageImageSettings, IAssetable } from '@dataclouder/ngx-cloud-storage';
|
|
3
3
|
import { ConversationType, TextEngines } from '../../models/conversation-enums';
|
|
4
|
-
import { IAgentCard } from '../../models/agent.models';
|
|
4
|
+
import { EAgentType, IAgentCard } from '../../models/agent.models';
|
|
5
5
|
import { EntityBaseFormComponent } from '@dataclouder/ngx-core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCard> {
|
|
@@ -9,7 +9,6 @@ export declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IA
|
|
|
9
9
|
protected entityCommunicationService: import("@dataclouder/ngx-agent-cards").DefaultAgentCardsService;
|
|
10
10
|
private dialogService;
|
|
11
11
|
private promptBuilder;
|
|
12
|
-
private toastService;
|
|
13
12
|
private formGroupService;
|
|
14
13
|
conversationOptions: {
|
|
15
14
|
value: ConversationType;
|
|
@@ -24,6 +23,7 @@ export declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IA
|
|
|
24
23
|
value: string;
|
|
25
24
|
label: string;
|
|
26
25
|
}[];
|
|
26
|
+
agentTypeOptions: (string | EAgentType.None)[];
|
|
27
27
|
readonly storageSettings: import("@angular/core").InputSignal<StorageImageSettings>;
|
|
28
28
|
readonly onSave: import("@angular/core").OutputEmitterRef<any>;
|
|
29
29
|
readonly onGoDetails: import("@angular/core").OutputEmitterRef<string>;
|
|
@@ -35,6 +35,7 @@ export declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IA
|
|
|
35
35
|
title: import("@angular/forms").FormControl<string>;
|
|
36
36
|
description: import("@angular/forms").FormControl<string>;
|
|
37
37
|
lang: import("@angular/forms").FormControl<string>;
|
|
38
|
+
agentType: import("@angular/forms").FormControl<EAgentType>;
|
|
38
39
|
characterCard: FormGroup<any>;
|
|
39
40
|
conversationSettings: FormGroup<{
|
|
40
41
|
textEngine: import("@angular/forms").FormControl<TextEngines>;
|
|
@@ -58,10 +59,9 @@ export declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IA
|
|
|
58
59
|
tools: FormArray<import("@dataclouder/ngx-agent-cards").DynamicCriteriaFormGroup>;
|
|
59
60
|
dynamicConditions: FormArray<import("@dataclouder/ngx-agent-cards").DynamicConditionFormGroup>;
|
|
60
61
|
}>;
|
|
62
|
+
manageable: FormGroup<any>;
|
|
61
63
|
}>;
|
|
62
|
-
constructor();
|
|
63
64
|
protected patchForm(agentCard: IAgentCard): void;
|
|
64
|
-
get conversationSettings(): FormGroup;
|
|
65
65
|
save(): Promise<IAgentCard | undefined>;
|
|
66
66
|
onImageSelected(file: File): Promise<void>;
|
|
67
67
|
checkPrompt(): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FormGroup } from '@angular/forms';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DcManageableFormComponent {
|
|
4
|
+
form: import("@angular/core").InputSignal<FormGroup<any>>;
|
|
5
|
+
statusOptions: {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}[];
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DcManageableFormComponent, never>;
|
|
10
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DcManageableFormComponent, "dc-manageable-form", never, { "form": { "alias": "form"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
11
|
+
}
|
package/lib/components/dc-agent-form/{form-group.service.d.ts → form-definition.service.d.ts}
RENAMED
|
@@ -2,7 +2,7 @@ import { FormGroup, FormArray, FormControl, AbstractControl } from '@angular/for
|
|
|
2
2
|
import { SimpleAgentTaskFormGroup, DynamicConditionFormGroup, TriggerTasksFormGroup, ConversationFlowFormGroup, DoActionFormGroup } from './form-group.utils';
|
|
3
3
|
import { ConversationType, TextEngines } from '../../models/conversation-enums';
|
|
4
4
|
import { IAIModel, EModelQuality } from '@dataclouder/ngx-core';
|
|
5
|
-
import { DoAction, IAgentCard, IDynamicCondition, IDynamicCriteria, SimpleAgentTask, VoiceTTS } from '../../models/agent.models';
|
|
5
|
+
import { DoAction, EAgentType, IAgentCard, IDynamicCondition, IDynamicCriteria, SimpleAgentTask, VoiceTTS } from '../../models/agent.models';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare class FormGroupService {
|
|
8
8
|
private fb;
|
|
@@ -12,6 +12,7 @@ export declare class FormGroupService {
|
|
|
12
12
|
title: FormControl<string>;
|
|
13
13
|
description: FormControl<string>;
|
|
14
14
|
lang: FormControl<string>;
|
|
15
|
+
agentType: FormControl<EAgentType>;
|
|
15
16
|
characterCard: FormGroup<any>;
|
|
16
17
|
conversationSettings: FormGroup<{
|
|
17
18
|
textEngine: FormControl<TextEngines>;
|
|
@@ -35,6 +36,7 @@ export declare class FormGroupService {
|
|
|
35
36
|
tools: FormArray<import("@dataclouder/ngx-agent-cards").DynamicCriteriaFormGroup>;
|
|
36
37
|
dynamicConditions: FormArray<DynamicConditionFormGroup>;
|
|
37
38
|
}>;
|
|
39
|
+
manageable: FormGroup<any>;
|
|
38
40
|
}>;
|
|
39
41
|
patchFormWithConversationData(form: FormGroup, agentCard: IAgentCard): void;
|
|
40
42
|
handleArrayForms(form: FormGroup, agentCard: IAgentCard): void;
|
|
@@ -54,6 +56,7 @@ export declare class FormGroupService {
|
|
|
54
56
|
}>;
|
|
55
57
|
createAccountsFormGroup(): FormGroup;
|
|
56
58
|
createMetaFormGroup(): FormGroup;
|
|
59
|
+
createManageableFormGroup(): FormGroup;
|
|
57
60
|
createModelFormGroup(model?: IAIModel): FormGroup<{
|
|
58
61
|
id: FormControl<string>;
|
|
59
62
|
modelName: FormControl<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudStorageData, IAssetable, ImgStorageData } from '@dataclouder/ngx-cloud-storage';
|
|
2
2
|
import { AudioSpeed, ConversationType, TextEngines } from './conversation-enums';
|
|
3
|
-
import { IAIModel, EModelQuality } from '@dataclouder/ngx-core';
|
|
3
|
+
import { IAIModel, EModelQuality, IManageable } from '@dataclouder/ngx-core';
|
|
4
4
|
import { EDoActionType, EDynamicFlowTaskType, SystemPromptType } from '../components/dc-agent-form/form-group.utils';
|
|
5
5
|
import { AudioEffectType } from '@dataclouder/ngx-vertex';
|
|
6
6
|
export interface Appearance {
|
|
@@ -76,7 +76,16 @@ export type IConversationSettingsDTO = Partial<IConversationSettings> & {
|
|
|
76
76
|
export interface IAgentResponseDTO {
|
|
77
77
|
role: ChatRole;
|
|
78
78
|
content: string | object;
|
|
79
|
-
metadata:
|
|
79
|
+
metadata: {
|
|
80
|
+
tokens: {
|
|
81
|
+
input: number;
|
|
82
|
+
output: number;
|
|
83
|
+
total: number;
|
|
84
|
+
};
|
|
85
|
+
model: string;
|
|
86
|
+
processTime: number;
|
|
87
|
+
recovered: boolean;
|
|
88
|
+
};
|
|
80
89
|
}
|
|
81
90
|
export interface IAgentAssets {
|
|
82
91
|
image?: ImgStorageData;
|
|
@@ -134,12 +143,18 @@ export interface IConversationFlow {
|
|
|
134
143
|
challenges?: IDynamicCriteria[];
|
|
135
144
|
dynamicConditions: IDynamicCondition[];
|
|
136
145
|
}
|
|
146
|
+
export declare enum EAgentType {
|
|
147
|
+
None,
|
|
148
|
+
Social = "social",
|
|
149
|
+
Character = "character"
|
|
150
|
+
}
|
|
137
151
|
export interface IAgentCard {
|
|
138
152
|
version?: string;
|
|
139
153
|
_id?: string;
|
|
140
154
|
id?: string;
|
|
141
155
|
title?: string;
|
|
142
156
|
description?: string;
|
|
157
|
+
agentType?: EAgentType;
|
|
143
158
|
lang?: string;
|
|
144
159
|
assets?: IAssetable;
|
|
145
160
|
image?: ImgStorageData;
|
|
@@ -148,6 +163,7 @@ export interface IAgentCard {
|
|
|
148
163
|
metaApp?: IAgentMetadata;
|
|
149
164
|
accounts?: Array<IAccounts>;
|
|
150
165
|
conversationFlow?: IConversationFlow;
|
|
166
|
+
manageable?: IManageable;
|
|
151
167
|
}
|
|
152
168
|
export interface IAgentCardMeta extends IAgentCard {
|
|
153
169
|
taken: any;
|
|
@@ -208,7 +224,6 @@ export declare class MessageContent {
|
|
|
208
224
|
shouldPlayAudio?: boolean;
|
|
209
225
|
messageId?: string;
|
|
210
226
|
tag?: string;
|
|
211
|
-
imgUrl?: string;
|
|
212
227
|
ssml?: string;
|
|
213
228
|
audioEffect?: AudioEffectType;
|
|
214
229
|
}
|
|
@@ -227,6 +242,8 @@ export declare class ChatMessage extends MessageContent {
|
|
|
227
242
|
multiMessages?: MessageContent[];
|
|
228
243
|
evaluation?: Record<string, any>;
|
|
229
244
|
tags?: string[];
|
|
245
|
+
imgUrl?: string;
|
|
246
|
+
generatedImg?: string;
|
|
230
247
|
}
|
|
231
248
|
export declare class ConversationMessagesDTO {
|
|
232
249
|
messages?: ChatMessage[];
|
|
@@ -253,14 +270,6 @@ export type AudioGenerated = {
|
|
|
253
270
|
blobUrl: string;
|
|
254
271
|
transcription: any;
|
|
255
272
|
};
|
|
256
|
-
export type TTSRequest = {
|
|
257
|
-
text: string;
|
|
258
|
-
voice: string;
|
|
259
|
-
generateTranscription: boolean;
|
|
260
|
-
speedRate: number;
|
|
261
|
-
speed?: string;
|
|
262
|
-
ssml?: string;
|
|
263
|
-
};
|
|
264
273
|
export interface BackgroundTask {
|
|
265
274
|
task: SimpleAgentTask;
|
|
266
275
|
event: ConversationEvents;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ChatMessage } from '../models/agent.models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AIGenerationService {
|
|
4
|
+
private vertexService;
|
|
5
|
+
private messagesStateService;
|
|
6
|
+
private conversationService;
|
|
7
|
+
generateImage(chatMessage: ChatMessage, chatText: string): Promise<string>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AIGenerationService, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AIGenerationService>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export interface ITokenUsage {
|
|
3
|
+
input: number;
|
|
4
|
+
output: number;
|
|
5
|
+
total: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ITagCost {
|
|
8
|
+
tokenUsage: ITokenUsage;
|
|
9
|
+
apiCalls: number;
|
|
10
|
+
}
|
|
11
|
+
export declare class ConversationCostService {
|
|
12
|
+
private usageByTagSignal;
|
|
13
|
+
totalInputTokens: import("@angular/core").Signal<number>;
|
|
14
|
+
totalOutputTokens: import("@angular/core").Signal<number>;
|
|
15
|
+
totalTokens: import("@angular/core").Signal<number>;
|
|
16
|
+
totalApiCalls: import("@angular/core").Signal<number>;
|
|
17
|
+
totalInputCost: import("@angular/core").Signal<number>;
|
|
18
|
+
totalOutputCost: import("@angular/core").Signal<number>;
|
|
19
|
+
totalCost: import("@angular/core").Signal<number>;
|
|
20
|
+
usageByTag: import("@angular/core").Signal<Record<string, ITagCost>>;
|
|
21
|
+
updateTokenUsage(tokens: ITokenUsage, tag: string): void;
|
|
22
|
+
getCostForTag(tag: string): import("@angular/core").Signal<{
|
|
23
|
+
inputTokens: number;
|
|
24
|
+
outputTokens: number;
|
|
25
|
+
totalTokens: number;
|
|
26
|
+
apiCalls: number;
|
|
27
|
+
inputCost: number;
|
|
28
|
+
outputCost: number;
|
|
29
|
+
totalCost: number;
|
|
30
|
+
}>;
|
|
31
|
+
reset(): void;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConversationCostService, never>;
|
|
33
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ConversationCostService>;
|
|
34
|
+
}
|
|
@@ -4,6 +4,7 @@ import { AudioGenerated, ChatMessage, IAgentCard, IConversationFlow, IConversati
|
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class ConversationService {
|
|
6
6
|
private defaultAgentCardService;
|
|
7
|
+
private ttsService;
|
|
7
8
|
private toastAlerts;
|
|
8
9
|
private messageProcessingService;
|
|
9
10
|
private conversationBuilder;
|
|
@@ -15,12 +16,14 @@ export declare class ConversationService {
|
|
|
15
16
|
private isThinkingSignal;
|
|
16
17
|
private conversationSettingsState;
|
|
17
18
|
private isDestroyedSignal;
|
|
18
|
-
micStatusSignal: import("@angular/core").WritableSignal<"
|
|
19
|
+
micStatusSignal: import("@angular/core").WritableSignal<"ready" | "recording" | "listening" | "initializing" | "inactive" | "error" | "paused">;
|
|
19
20
|
currentAudioStatus: import("@angular/core").WritableSignal<{
|
|
20
21
|
message: MessageContent;
|
|
21
22
|
completed: boolean;
|
|
22
23
|
}>;
|
|
23
24
|
private wordClickedSignal;
|
|
25
|
+
private agentCardSignal;
|
|
26
|
+
agentCard$: Signal<IAgentCard>;
|
|
24
27
|
private avatarImages;
|
|
25
28
|
/**
|
|
26
29
|
* Notifies subscribers that a word has been clicked in a message.
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { IConversationSettingsDTO, IAgentResponseDTO, IAgentCard,
|
|
1
|
+
import { IConversationSettingsDTO, IAgentResponseDTO, IAgentCard, ModelName, TranscriptionsWhisper } from '../models/agent.models';
|
|
2
2
|
import { FiltersConfig, IFilterQueryResponse, ChatUserSettings, IAIModel, EntityCommunicationService } from '@dataclouder/ngx-core';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DefaultAgentCardsService extends EntityCommunicationService<IAgentCard> {
|
|
5
|
+
private conversationCostService;
|
|
5
6
|
constructor();
|
|
6
7
|
partialUpdateAgentCard(agentCard: IAgentCard): Promise<IAgentCard>;
|
|
7
8
|
generateMainImage(idCard: string): Promise<any>;
|
|
8
9
|
completeAgentCard(idCard: string): Promise<any>;
|
|
9
|
-
callChatCompletion(conversation: IConversationSettingsDTO): Promise<IAgentResponseDTO>;
|
|
10
|
+
callChatCompletion(conversation: IConversationSettingsDTO, tag?: string): Promise<IAgentResponseDTO>;
|
|
10
11
|
filterConversationCards(filters: FiltersConfig): Promise<IFilterQueryResponse<IAgentCard>>;
|
|
11
12
|
getAllConversationCards(): Promise<IAgentCard[]>;
|
|
12
13
|
findFilteredAgentCards(paginator: FiltersConfig): Promise<IFilterQueryResponse<IAgentCard>>;
|
|
13
14
|
findAgentCardByTitle(title: string): Promise<IAgentCard>;
|
|
14
15
|
remove(id: string): Promise<void>;
|
|
15
|
-
getTextAudioFile(tts: TTSRequest): Promise<AudioGenerated>;
|
|
16
16
|
getConversationUserChatSettings(): Promise<ChatUserSettings>;
|
|
17
17
|
getListModels(provider: string): Promise<ModelName[]>;
|
|
18
18
|
translateConversation(currentLang: string, targetLang: string, id: string): Promise<ChatUserSettings>;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -3,8 +3,11 @@ export * from './lib/models/agent-card-abstract.model';
|
|
|
3
3
|
export * from './lib/models/conversation-enums';
|
|
4
4
|
export * from './lib/models/agent-card-abstract.model';
|
|
5
5
|
export * from './lib/models/agent.utils';
|
|
6
|
+
export * from './lib/models/agent.utils';
|
|
7
|
+
export * from './lib/models/user-data-exchange';
|
|
6
8
|
export * from './lib/prompts/dynamic-criteria.prompts';
|
|
7
9
|
export * from './lib/components/dc-agent-form/form-group.utils';
|
|
10
|
+
export * from './lib/utils/icons/extraction.regex';
|
|
8
11
|
export * from './lib/services/audio.service';
|
|
9
12
|
export * from './lib/services/dc-conversation-builder.service';
|
|
10
13
|
export * from './lib/services/default-agent-service';
|
|
@@ -13,18 +16,17 @@ export * from './lib/services/dynamic-flow.service';
|
|
|
13
16
|
export * from './lib/services/global-tools.service';
|
|
14
17
|
export * from './lib/services/context-engine.service';
|
|
15
18
|
export * from './lib/services/chat-monitor.service';
|
|
19
|
+
export * from './lib/services/messages-state.service';
|
|
20
|
+
export * from './lib/services/ai-generation.service';
|
|
16
21
|
export * from './lib/components/chat-container/chat-container.component';
|
|
17
22
|
export * from './lib/components/dc-agent-form/dc-agent-card-form.component';
|
|
18
23
|
export * from './lib/components/dc-agent-card-lists/dc-agent-card-lists.component';
|
|
19
24
|
export * from './lib/components/dc-agent-card-details/dc-agent-card-details.component';
|
|
20
25
|
export * from './lib/components/dc-agent-card-lists/agent-card-default-ui/agent-card-default-ui.component';
|
|
21
|
-
export * from './lib/models/user-data-exchange';
|
|
22
26
|
export * from './lib/components/dc-agent-card-lists/dc-agent-card-lists.component';
|
|
23
27
|
export * from './lib/components/provider-selector/provider-selector.component';
|
|
24
|
-
export * from './lib/models/agent.utils';
|
|
25
28
|
export * from './lib/components/chat-container/chat-container.component';
|
|
26
29
|
export * from './lib/components/chat-container/chat-messages-list/chat-message/chat-message-orchestrator/message-content-displayer/message-content-displayer';
|
|
27
30
|
export * from './lib/components/chat-container/chat-messages-list/chat-message/chat-message.utils';
|
|
28
31
|
export * from './lib/components/chat-container/chat-messages-list/chat-message/chat-message-orchestrator/message-orchestrator.component';
|
|
29
|
-
export * from './lib/utils/icons/extraction.regex';
|
|
30
32
|
export * from './lib/components/chat-container/chat-settings/dc-conversation-userchat-settings.component';
|