@dataclouder/ngx-agent-cards 0.1.43 → 0.1.44
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.
|
@@ -455,27 +455,6 @@ function extractJsonFromResponse(content) {
|
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
/**
|
|
459
|
-
* @deprecated use userService directly instead
|
|
460
|
-
*/
|
|
461
|
-
const USER_DATA_EXCHANGE = new InjectionToken('user.data.exchange');
|
|
462
|
-
/**
|
|
463
|
-
* @deprecated use userService directly instead
|
|
464
|
-
*/
|
|
465
|
-
function provideUserDataExchange(serviceImplementation) {
|
|
466
|
-
return [
|
|
467
|
-
{
|
|
468
|
-
provide: USER_DATA_EXCHANGE,
|
|
469
|
-
useExisting: serviceImplementation,
|
|
470
|
-
},
|
|
471
|
-
];
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* @deprecated use userService directly instead
|
|
475
|
-
*/
|
|
476
|
-
class UserDataExchangeAbstractService {
|
|
477
|
-
}
|
|
478
|
-
|
|
479
458
|
const getMoodStateLabelsAsString = () => {
|
|
480
459
|
return MoodStateOptions.map((option) => option.value).join('\n');
|
|
481
460
|
};
|
|
@@ -993,7 +972,6 @@ function getDefaultPromptByType(conversationType) {
|
|
|
993
972
|
|
|
994
973
|
class ConversationPromptBuilderService {
|
|
995
974
|
constructor() {
|
|
996
|
-
this.userDataExchange = inject(USER_DATA_EXCHANGE);
|
|
997
975
|
this.userService = inject(UserService);
|
|
998
976
|
}
|
|
999
977
|
// For chat conversation i need inital settings.
|
|
@@ -2353,11 +2331,11 @@ class DynamicFlowTaskService {
|
|
|
2353
2331
|
this.dynamicFlowService = inject(DynamicFlowService);
|
|
2354
2332
|
this.evaluationService = inject(EvaluationService);
|
|
2355
2333
|
this.messagesStateService = inject(MessagesStateService);
|
|
2356
|
-
this.
|
|
2334
|
+
this.userService = inject(UserService);
|
|
2357
2335
|
}
|
|
2358
2336
|
async evaluateAssistantTaskTrigger(message) {
|
|
2359
|
-
const userChatSettings = this.
|
|
2360
|
-
if (!userChatSettings
|
|
2337
|
+
const userChatSettings = this.userService.user().settings.conversation?.assistantMessageTask;
|
|
2338
|
+
if (!userChatSettings) {
|
|
2361
2339
|
return;
|
|
2362
2340
|
}
|
|
2363
2341
|
const conversationFlow = this.dynamicFlowService.conversationFlowState();
|
|
@@ -2385,8 +2363,8 @@ class DynamicFlowTaskService {
|
|
|
2385
2363
|
// TODO probably i need a different method for the goal.
|
|
2386
2364
|
this.evaluationService.evaluateGoal(goal);
|
|
2387
2365
|
// 2) Run User Trigger Evaluation only if user allows it
|
|
2388
|
-
const chatUserSettings = this.
|
|
2389
|
-
if (chatUserSettings
|
|
2366
|
+
const chatUserSettings = this.userService.user().settings.conversation;
|
|
2367
|
+
if (chatUserSettings?.userMessageTask) {
|
|
2390
2368
|
const userTriggerTask = conversationFlow.triggerTasks.onUserMessage;
|
|
2391
2369
|
// TODO: Siento MUY Forzado el utilizar evaluateConversation, ese es del goal, pero lo quize hacer general!
|
|
2392
2370
|
if (userTriggerTask && message.messageId) {
|
|
@@ -2418,7 +2396,7 @@ class ConversationService {
|
|
|
2418
2396
|
this.toastAlerts = inject(TOAST_ALERTS_TOKEN);
|
|
2419
2397
|
this.messageProcessingService = inject(MessageProcessingService);
|
|
2420
2398
|
this.conversationBuilder = inject(ConversationPromptBuilderService);
|
|
2421
|
-
this.
|
|
2399
|
+
this.userService = inject(UserService);
|
|
2422
2400
|
this.messagesStateService = inject(MessagesStateService);
|
|
2423
2401
|
this.dynamicFlowService = inject(DynamicFlowService);
|
|
2424
2402
|
this.dynamicCriteriaService = inject(DynamicCriteriaService);
|
|
@@ -2464,7 +2442,7 @@ class ConversationService {
|
|
|
2464
2442
|
this.isDestroyedSignal.set(value);
|
|
2465
2443
|
}
|
|
2466
2444
|
overrideSettingsByUserSettings(conversationSettings) {
|
|
2467
|
-
const userSettings = this.
|
|
2445
|
+
const userSettings = this.userService.user().settings.conversation;
|
|
2468
2446
|
if (userSettings?.model?.provider) {
|
|
2469
2447
|
conversationSettings.model = userSettings.model;
|
|
2470
2448
|
}
|
|
@@ -2519,7 +2497,7 @@ class ConversationService {
|
|
|
2519
2497
|
await this.initConversation();
|
|
2520
2498
|
}
|
|
2521
2499
|
async initConversation() {
|
|
2522
|
-
this.avatarImages.userImg = this.
|
|
2500
|
+
this.avatarImages.userImg = this.userService.user().urlPicture;
|
|
2523
2501
|
const conversationSettings = this.conversationSettingsState();
|
|
2524
2502
|
for (const i in conversationSettings.messages) {
|
|
2525
2503
|
if (!conversationSettings.messages[i].messageId) {
|
|
@@ -2655,7 +2633,7 @@ class ConversationService {
|
|
|
2655
2633
|
this.messagesStateService.clearMessages();
|
|
2656
2634
|
}
|
|
2657
2635
|
async getTTSFile(message) {
|
|
2658
|
-
const userChatSettings = await this.
|
|
2636
|
+
const userChatSettings = await this.userService.user().settings.conversation;
|
|
2659
2637
|
const ttsRequest = buildObjectTTSRequest(message, userChatSettings);
|
|
2660
2638
|
return this.ttsService.getTextAudioFile(ttsRequest);
|
|
2661
2639
|
}
|
|
@@ -3299,8 +3277,8 @@ class MessageOrchestrationService {
|
|
|
3299
3277
|
constructor() {
|
|
3300
3278
|
// Services
|
|
3301
3279
|
this.conversationService = inject(ConversationService);
|
|
3302
|
-
this.userDataExchange = inject(USER_DATA_EXCHANGE);
|
|
3303
3280
|
this.chatMonitorService = inject(ChatMonitorService);
|
|
3281
|
+
this.userService = inject(UserService);
|
|
3304
3282
|
// State Signals
|
|
3305
3283
|
this.messages = signal([], ...(ngDevMode ? [{ debugName: "messages" }] : []));
|
|
3306
3284
|
this.messageRole = signal(ChatRole.User, ...(ngDevMode ? [{ debugName: "messageRole" }] : []));
|
|
@@ -3319,7 +3297,7 @@ class MessageOrchestrationService {
|
|
|
3319
3297
|
this.messages.set([...messages]);
|
|
3320
3298
|
this.messageRole.set(role);
|
|
3321
3299
|
if (role === ChatRole.Assistant) {
|
|
3322
|
-
const chatSettings = this.
|
|
3300
|
+
const chatSettings = this.userService.user().settings.conversation;
|
|
3323
3301
|
if (chatSettings.synthVoice) {
|
|
3324
3302
|
this.initializeAudioQueue();
|
|
3325
3303
|
this.processNextInQueue();
|
|
@@ -3872,12 +3850,12 @@ class DCChatComponent {
|
|
|
3872
3850
|
this.conversationInfoService = inject(ConversationInfoService);
|
|
3873
3851
|
this.conversationService = inject(ConversationService);
|
|
3874
3852
|
this.evaluationService = inject(EvaluationService);
|
|
3875
|
-
this.userDataExchange = inject(USER_DATA_EXCHANGE);
|
|
3876
3853
|
this.messageStateService = inject(MessagesStateService);
|
|
3877
3854
|
this.dialogService = inject(DialogService);
|
|
3878
3855
|
this.chatMonitorService = inject(ChatMonitorService);
|
|
3856
|
+
this.userService = inject(UserService);
|
|
3879
3857
|
// 📥 Inputs
|
|
3880
|
-
this.chatUserSettings = this.
|
|
3858
|
+
this.chatUserSettings = this.userService.user().settings.conversation; // Default to user data exchange
|
|
3881
3859
|
this.conversationFlow = null;
|
|
3882
3860
|
// 📤 Input Signals
|
|
3883
3861
|
this.parseDict = input({}, ...(ngDevMode ? [{ debugName: "parseDict" }] : []));
|
|
@@ -5501,11 +5479,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
5501
5479
|
|
|
5502
5480
|
class ParseCardPipe {
|
|
5503
5481
|
constructor() {
|
|
5504
|
-
this.userDataExchange = inject(USER_DATA_EXCHANGE);
|
|
5505
5482
|
this.builderConversation = inject(ConversationPromptBuilderService);
|
|
5483
|
+
this.userService = inject(UserService);
|
|
5506
5484
|
}
|
|
5507
5485
|
transform(text, card = null) {
|
|
5508
|
-
let parseDict = this.
|
|
5486
|
+
let parseDict = this.userService.getFieldsForParseConversation();
|
|
5509
5487
|
if (card) {
|
|
5510
5488
|
const cardMacros = { char: card?.characterCard?.data?.name };
|
|
5511
5489
|
parseDict = { ...parseDict, ...cardMacros };
|
|
@@ -5696,5 +5674,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
5696
5674
|
* Generated bundle index. Do not edit.
|
|
5697
5675
|
*/
|
|
5698
5676
|
|
|
5699
|
-
export { AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MOOD_STATE_PROMPT, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, SystemPromptType, TextEngineOptions, TextEngines,
|
|
5677
|
+
export { AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MOOD_STATE_PROMPT, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, SystemPromptType, TextEngineOptions, TextEngines, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
|
|
5700
5678
|
//# sourceMappingURL=dataclouder-ngx-agent-cards.mjs.map
|