@dataclouder/ngx-agent-cards 0.1.72 → 0.1.75
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/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ImgStorageData, BasicStorage, AudioStorage, IAssetable, StorageImageSettings, FileStorageData } from '@dataclouder/ngx-cloud-storage';
|
|
2
2
|
import { AudioEffectType, TTSRequest } from '@dataclouder/ngx-ai-services';
|
|
3
3
|
import * as _dataclouder_ngx_core from '@dataclouder/ngx-core';
|
|
4
|
-
import { ChatUserSettings, EModelQuality, IAuditable, IAIModel, IManageable, ILearnable, EntityCommunicationService, FiltersConfig, IFilterQueryResponse, HttpCoreService, EntityBaseFormComponent,
|
|
4
|
+
import { ChatUserSettings, EModelQuality, IAuditable, IAIModel, IManageable, ILearnable, EntityCommunicationService, FiltersConfig, IFilterQueryResponse, HttpCoreService, EntityBaseFormComponent, EntityBaseListV2Component, ICustomFilter, PColumn, OnActionEvent, formatCamelCaseString } from '@dataclouder/ngx-core';
|
|
5
5
|
import * as _angular_forms from '@angular/forms';
|
|
6
6
|
import { FormGroup, FormControl, FormArray } from '@angular/forms';
|
|
7
7
|
import * as _angular_core from '@angular/core';
|
|
@@ -364,6 +364,34 @@ interface IConversationFlow {
|
|
|
364
364
|
dynamicConditions: IDynamicCondition[];
|
|
365
365
|
moodState: IMoodState;
|
|
366
366
|
}
|
|
367
|
+
interface IChallengeState {
|
|
368
|
+
id: string;
|
|
369
|
+
completed: boolean;
|
|
370
|
+
progress?: number;
|
|
371
|
+
observation?: string;
|
|
372
|
+
}
|
|
373
|
+
interface IGoalState {
|
|
374
|
+
progress: number;
|
|
375
|
+
completed: boolean;
|
|
376
|
+
observation?: string;
|
|
377
|
+
}
|
|
378
|
+
interface IMoodStateRuntime {
|
|
379
|
+
currentMood: string;
|
|
380
|
+
intensity: number;
|
|
381
|
+
observation?: string;
|
|
382
|
+
}
|
|
383
|
+
interface IConversationFlowState {
|
|
384
|
+
goal: {
|
|
385
|
+
value: any;
|
|
386
|
+
};
|
|
387
|
+
challenges: {
|
|
388
|
+
name: string;
|
|
389
|
+
value: any;
|
|
390
|
+
}[];
|
|
391
|
+
moodState: {
|
|
392
|
+
value: any;
|
|
393
|
+
};
|
|
394
|
+
}
|
|
367
395
|
declare enum EAgentType {
|
|
368
396
|
None,
|
|
369
397
|
Social = "social",
|
|
@@ -480,6 +508,9 @@ declare class ChatMessage extends MessageContent {
|
|
|
480
508
|
imgUrl?: string;
|
|
481
509
|
generatedImg?: string;
|
|
482
510
|
section?: SectionType;
|
|
511
|
+
createdAt?: Date;
|
|
512
|
+
updatedAt?: Date;
|
|
513
|
+
attachments?: any[];
|
|
483
514
|
}
|
|
484
515
|
declare class ConversationMessagesDTO {
|
|
485
516
|
messages?: ChatMessage[];
|
|
@@ -549,6 +580,7 @@ declare class DefaultAgentCardsService extends EntityCommunicationService<IAgent
|
|
|
549
580
|
partialUpdateAgentCard(agentCard: IAgentCard): Promise<IAgentCard>;
|
|
550
581
|
generateMainImage(idCard: string): Promise<any>;
|
|
551
582
|
completeAgentCard(idCard: string): Promise<any>;
|
|
583
|
+
getFixedQuery(): Record<string, any>;
|
|
552
584
|
callChatCompletion(conversation: IConversationSettingsDTO, tag?: string): Promise<IAgentResponseDTO>;
|
|
553
585
|
filterConversationCards(filters: FiltersConfig): Promise<IFilterQueryResponse<IAgentCard>>;
|
|
554
586
|
getAllConversationCards(): Promise<IAgentCard[]>;
|
|
@@ -680,10 +712,65 @@ declare class PopupService {
|
|
|
680
712
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<PopupService>;
|
|
681
713
|
}
|
|
682
714
|
|
|
715
|
+
/**
|
|
716
|
+
* @description
|
|
717
|
+
* Orchestrates the dynamic aspects of a conversation based on a predefined configuration.
|
|
718
|
+
*
|
|
719
|
+
* This service is responsible for:
|
|
720
|
+
* - Initializing the conversation's dynamic flow with a static `IConversationFlow` configuration.
|
|
721
|
+
* - Holding the static configuration for reference throughout the conversation.
|
|
722
|
+
* - Providing access to the real-time `IConversationFlowState` managed by `ConversationFlowStateService`.
|
|
723
|
+
* - Evaluating dynamic conditions (e.g., goal progress) and triggering actions.
|
|
724
|
+
* - Applying changes to the conversation, such as updating system prompts or modifying tasks.
|
|
725
|
+
*/
|
|
683
726
|
declare class DynamicFlowService {
|
|
684
727
|
private messagesStateService;
|
|
685
|
-
|
|
686
|
-
|
|
728
|
+
private conversationFlowStateService;
|
|
729
|
+
/**
|
|
730
|
+
* @description
|
|
731
|
+
* A signal holding the static configuration (`IConversationFlow`) for the current chat.
|
|
732
|
+
* This configuration defines the rules, goals, challenges, and conditions for the dynamic flow.
|
|
733
|
+
*/
|
|
734
|
+
conversationFlowConfig: _angular_core.WritableSignal<IConversationFlow>;
|
|
735
|
+
/**
|
|
736
|
+
* @description
|
|
737
|
+
* A direct reference to the reactive state signal from `ConversationFlowStateService`.
|
|
738
|
+
* This provides real-time access to the conversation's dynamic state (goal progress, challenges, mood).
|
|
739
|
+
*/
|
|
740
|
+
flowState: _angular_core.WritableSignal<IConversationFlowState>;
|
|
741
|
+
/**
|
|
742
|
+
* @description
|
|
743
|
+
* Initializes the dynamic flow for a new conversation.
|
|
744
|
+
* It sets the static configuration and resets the runtime state to match.
|
|
745
|
+
* @param conversationFlow The static `IConversationFlow` configuration object.
|
|
746
|
+
*/
|
|
747
|
+
initConversationFlow(conversationFlow: IConversationFlow): void;
|
|
748
|
+
/**
|
|
749
|
+
* @description
|
|
750
|
+
* Constructs a context object containing both the static configuration and the current runtime state.
|
|
751
|
+
* This combined context can be sent to an AI model for analysis.
|
|
752
|
+
* @returns An object with the flow definition and its current state.
|
|
753
|
+
*/
|
|
754
|
+
getFlowContextForAI(): {
|
|
755
|
+
definition: IConversationFlow;
|
|
756
|
+
currentState: IConversationFlowState;
|
|
757
|
+
};
|
|
758
|
+
/**
|
|
759
|
+
* @description
|
|
760
|
+
* Updates the runtime state of the conversation based on analysis from an AI model.
|
|
761
|
+
* @param aiResponse A partial `IConversationFlowState` object from the AI.
|
|
762
|
+
*/
|
|
763
|
+
updateStateFromAI(aiResponse: Partial<IConversationFlowState>): void;
|
|
764
|
+
syncMoodToLatestMessage(messageId?: string): void;
|
|
765
|
+
private getMoodEmoji;
|
|
766
|
+
/**
|
|
767
|
+
* @description
|
|
768
|
+
* Generates a prompt for the AI to evaluate the conversation flow and return a new state.
|
|
769
|
+
* This prompt includes the current state, enabled configuration instructions, and the context of the last messages.
|
|
770
|
+
* @param messages The full list of chat messages (used to extract context).
|
|
771
|
+
* @returns A string containing the prompt.
|
|
772
|
+
*/
|
|
773
|
+
generateSystemPromptForFlow(messages: ChatMessage[]): string;
|
|
687
774
|
changePrompt(): void;
|
|
688
775
|
applyConditionChange(condition: IDynamicCondition): void;
|
|
689
776
|
changeDynamicFlowTask(action: DoAction): void;
|
|
@@ -864,10 +951,9 @@ declare class EvaluationService {
|
|
|
864
951
|
private dialogService;
|
|
865
952
|
private loadingBarService;
|
|
866
953
|
private userService;
|
|
867
|
-
|
|
954
|
+
private conversationFlowStateService;
|
|
868
955
|
private evaluationResultSignal;
|
|
869
956
|
isGoalCompleted: _angular_core.WritableSignal<boolean>;
|
|
870
|
-
evaluateGoal(goalTask: IDynamicFlowTask): Promise<any>;
|
|
871
957
|
evaluateConversation(task: SimpleAgentTask, contextType?: ContextType, metaType?: string): Promise<IEvaluationResponse>;
|
|
872
958
|
/**
|
|
873
959
|
* Diference with evaluateConversation is task is already processed here.
|
|
@@ -878,6 +964,13 @@ declare class EvaluationService {
|
|
|
878
964
|
* @returns The JSON result of the evaluation.
|
|
879
965
|
*/
|
|
880
966
|
evaluateWithTask(agentTask: IDynamicFlowTask): Promise<any>;
|
|
967
|
+
/**
|
|
968
|
+
* Evaluates the dynamic flow state using a generated prompt.
|
|
969
|
+
* @param prompt The system/instruction prompt generated by DynamicFlowService.
|
|
970
|
+
* @param model The AI model to use for the evaluation.
|
|
971
|
+
* @returns The updated conversation flow state as a JSON object.
|
|
972
|
+
*/
|
|
973
|
+
evaluateFlowState(prompt: string, model: IAIModel): Promise<any>;
|
|
881
974
|
updateScore(additionalScore: number): void;
|
|
882
975
|
setScore(newScore: number): void;
|
|
883
976
|
private _handleScoreUpdate;
|
|
@@ -898,6 +991,7 @@ declare class DCChatComponent implements OnInit, OnDestroy {
|
|
|
898
991
|
messageStateService: MessagesStateService;
|
|
899
992
|
private chatMonitorService;
|
|
900
993
|
private conversationInfoService;
|
|
994
|
+
private conversationFlowStateService;
|
|
901
995
|
private chatFooterComponent;
|
|
902
996
|
chatUserSettings: ChatUserSettings | null;
|
|
903
997
|
conversationSettings: IConversationSettings;
|
|
@@ -1021,7 +1115,7 @@ declare class DCAgentCardFormComponent extends EntityBaseFormComponent<IAgentCar
|
|
|
1021
1115
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DCAgentCardFormComponent, "dc-agent-form", never, { "storageSettings": { "alias": "storageSettings"; "required": false; "isSignal": true; }; }, { "onSave": "onSave"; "onGoDetails": "onGoDetails"; }, never, never, true, never>;
|
|
1022
1116
|
}
|
|
1023
1117
|
|
|
1024
|
-
declare class AgentCardListComponent extends
|
|
1118
|
+
declare class AgentCardListComponent extends EntityBaseListV2Component<IAgentCard> implements OnInit {
|
|
1025
1119
|
extraFilters: ICustomFilter[];
|
|
1026
1120
|
readonly showOptions: _angular_core.InputSignal<boolean>;
|
|
1027
1121
|
readonly gridLayout: _angular_core.InputSignal<boolean>;
|
|
@@ -1036,7 +1130,6 @@ declare class AgentCardListComponent extends EntityBaseListComponent<IAgentCard>
|
|
|
1036
1130
|
ngOnInit(): Promise<void>;
|
|
1037
1131
|
handleTableAction(actionEvent: OnActionEvent): void;
|
|
1038
1132
|
handleAction(actionEvent: OnActionEvent): void;
|
|
1039
|
-
applyFilterBarEvent(filterEvent: OnActionEvent): void;
|
|
1040
1133
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AgentCardListComponent, never>;
|
|
1041
1134
|
static ɵcmp: _angular_core.ɵɵ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>;
|
|
1042
1135
|
}
|
|
@@ -1398,4 +1491,4 @@ declare class ChatEngineTestComponent {
|
|
|
1398
1491
|
declare const AGENT_CARDS_STATE_SERVICE: InjectionToken<MasterStateService<IAgentCard>>;
|
|
1399
1492
|
|
|
1400
1493
|
export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEngineTestComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationRuleService, ConversationRulesComponent, ConversationType$1 as ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, PromptPreviewComponent, SectionType, SystemPromptType, TextEngineOptions, TextEngines, VIDEO_PLAYER_SERVICE_TOKEN, VideoPlayerService, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
|
|
1401
|
-
export type { Appearance, AudioGenerated, AudioState, BackgroundTask, CardTranslation, ChangePromptAction, CharacterCardData, ChatEvent, ConversationFlowFormGroup, ConversationSettingsFormGroup, DoAction, DoActionFormGroup, DynamicConditionFormGroup, DynamicCriteriaFormGroup, IAccounts, IAgentAssets, IAgentCard, IAgentCardMeta, IAgentMetadata, IAgentResponseDTO, IBackgroundService, ICharacterCardDC, IConversationFlow, IConversationSettings, IConversationSettingsDTO, IDynamicCondition, IDynamicCriteria, IDynamicFlowTask, IGenerateConversationCardsDto, IMoodState, IRule, ISimpleAgent, ITTS, IVideoPlayerService, IWordMetadata, ModelFormGroup, ModelName, MultiLanguage, Persona, SimpleAgentTask, SimpleAgentTaskFormGroup, SimpleEvalResult, TextHTMLTag, TranscriptionsWhisper, TriggerTasksFormGroup, VoiceCloning, VoiceTTS, WordData };
|
|
1494
|
+
export type { Appearance, AudioGenerated, AudioState, BackgroundTask, CardTranslation, ChangePromptAction, CharacterCardData, ChatEvent, ConversationFlowFormGroup, ConversationSettingsFormGroup, DoAction, DoActionFormGroup, DynamicConditionFormGroup, DynamicCriteriaFormGroup, IAccounts, IAgentAssets, IAgentCard, IAgentCardMeta, IAgentMetadata, IAgentResponseDTO, IBackgroundService, IChallengeState, ICharacterCardDC, IConversationFlow, IConversationFlowState, IConversationSettings, IConversationSettingsDTO, IDynamicCondition, IDynamicCriteria, IDynamicFlowTask, IGenerateConversationCardsDto, IGoalState, IMoodState, IMoodStateRuntime, IRule, ISimpleAgent, ITTS, IVideoPlayerService, IWordMetadata, ModelFormGroup, ModelName, MultiLanguage, Persona, SimpleAgentTask, SimpleAgentTaskFormGroup, SimpleEvalResult, TextHTMLTag, TranscriptionsWhisper, TriggerTasksFormGroup, VoiceCloning, VoiceTTS, WordData };
|