From 24c2e4e63b5ce963b222875ea99d742cc42a58a9 Mon Sep 17 00:00:00 2001 From: Anna Soares Date: Wed, 20 Dec 2023 17:21:39 -0300 Subject: [PATCH] feat(ai-hub): create a new property in analisisInf --- .../analysisInfo/analysisInfo.component.ts | 4 ++++ src/components/analysisInfo/analysisInfo.scss | 5 +++++ src/components/analysisInfo/analysisInfoView.html | 15 ++++++++++++++- src/typings/ArtificialIntelligence.d.ts | 14 +++++++++++++- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/components/analysisInfo/analysisInfo.component.ts b/src/components/analysisInfo/analysisInfo.component.ts index ae79ac95..af53e9bf 100644 --- a/src/components/analysisInfo/analysisInfo.component.ts +++ b/src/components/analysisInfo/analysisInfo.component.ts @@ -8,6 +8,7 @@ const HIGHLIGHT_START = ''; const HIGHLIGHT_END = ''; const DEFAULT_INTENTS_LABEL = 'Intents'; const DEFAULT_ENTITIES_LABEL = 'Entities'; +const DEFAULT_CONTENTS_LABEL = 'Contents'; const DEFAULT_INTENT_NAME = 'None'; class AnalysisInfoController extends ComponentController { @@ -16,8 +17,10 @@ class AnalysisInfoController extends ComponentController { public intentsLabel: string; public entitiesLabel: string; + public contentsLabel: string; public entities: Entity[]; public intents: Intent[]; + public contents: Content[]; public analysis: { id: string, content: string, promise: Promise }; public selectedIntention: string; public structuredEntities: { [id: string]: string[] } = {}; @@ -37,6 +40,7 @@ class AnalysisInfoController extends ComponentController { super(); this.intentsLabel = this.intentsLabel || DEFAULT_INTENTS_LABEL; this.entitiesLabel = this.entitiesLabel || DEFAULT_ENTITIES_LABEL; + this.contentsLabel = this.contentsLabel || DEFAULT_CONTENTS_LABEL; } async $onInit() { diff --git a/src/components/analysisInfo/analysisInfo.scss b/src/components/analysisInfo/analysisInfo.scss index b785758c..843d3d68 100644 --- a/src/components/analysisInfo/analysisInfo.scss +++ b/src/components/analysisInfo/analysisInfo.scss @@ -59,3 +59,8 @@ } } } + +.divisor { + padding-top: 10px !important; + margin-top: 12px; +} \ No newline at end of file diff --git a/src/components/analysisInfo/analysisInfoView.html b/src/components/analysisInfo/analysisInfoView.html index 34b30c98..c5c92bb4 100644 --- a/src/components/analysisInfo/analysisInfoView.html +++ b/src/components/analysisInfo/analysisInfoView.html @@ -15,7 +15,7 @@
-
{{ $ctrl.entitiesLabel }}
+ {{ $ctrl.entitiesLabel }}
{{ name }} @@ -25,6 +25,19 @@
+
+ + {{ $ctrl.contentsLabel }} + +
+
+ {{ content.name }} +
+
+ {{ content.result.content }} +
+
+
diff --git a/src/typings/ArtificialIntelligence.d.ts b/src/typings/ArtificialIntelligence.d.ts index 0e9244bb..c35838d1 100644 --- a/src/typings/ArtificialIntelligence.d.ts +++ b/src/typings/ArtificialIntelligence.d.ts @@ -3,6 +3,7 @@ interface Analysis { text: string; intentions: AnalysisIntent[]; entities: AnalysisEntity[]; + contents: Content[]; provider: string; modelId: string; } @@ -30,6 +31,17 @@ interface Entity { values: EntityValue[]; } +interface Content { + id: string + name: string + result: Result +} + +interface Result { + type: string + content: string +} + interface Intent { id?: string; storageDate?: Date; @@ -39,4 +51,4 @@ interface Intent { countQuestions?: number; tooltip?: any; healthScore?: any; -} +} \ No newline at end of file