From 4e834ef29e17ea35f43a7e25645506a561b33715 Mon Sep 17 00:00:00 2001 From: Nicola Lanzilotto Date: Mon, 23 Sep 2024 14:40:39 +0200 Subject: [PATCH] Minor improvements --- .../modal-faqs/modal-faqs.component.scss | 4 ++-- ...odal-preview-knowledge-base.component.html | 14 ++++++++---- .../modal-preview-knowledge-base.component.ts | 13 ++++++++--- .../modal-urls-knowledge-base.component.html | 22 +++++++------------ 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/app/knowledge-bases/modals/modal-faqs/modal-faqs.component.scss b/src/app/knowledge-bases/modals/modal-faqs/modal-faqs.component.scss index 5f982c22dd9f..46c2c1914ecf 100644 --- a/src/app/knowledge-bases/modals/modal-faqs/modal-faqs.component.scss +++ b/src/app/knowledge-bases/modals/modal-faqs/modal-faqs.component.scss @@ -460,8 +460,8 @@ // margin: 100px auto; // margin: 80px auto; margin: 75.01px auto; - width: 40px; - height: 40px; + width: 41px; + height: 41px; // width: 100px; // height: 100px; position: relative; diff --git a/src/app/knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component.html b/src/app/knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component.html index e0400090fca0..11b4722c8aa2 100644 --- a/src/app/knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component.html +++ b/src/app/knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component.html @@ -41,7 +41,9 @@

{{ 'Preview' | translate }}

- {{ 'KbPage.Answer' | translate }} ({{ 'KbPage.GeneratedByModel' | translate: {ai_model_name: qa?.ai_model } }}) + {{ 'KbPage.Answer' | translate }} + + ({{ 'KbPage.GeneratedByModel' | translate: {ai_model_name: qa?.ai_model } }})

@@ -66,7 +68,7 @@

{{ 'Preview' | translate }}


{{ 'KbPage.Source' | translate }}

-
+
{{ 'KbPage.Source' | translate }}: {{ source_url }} {{ qa.source }} @@ -75,11 +77,15 @@

{{ 'Preview' | translate }}

diff --git a/src/app/knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component.ts b/src/app/knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component.ts index cc96b0203fae..4ad1115727fe 100644 --- a/src/app/knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component.ts +++ b/src/app/knowledge-bases/modals/modal-preview-knowledge-base/modal-preview-knowledge-base.component.ts @@ -256,7 +256,7 @@ export class ModalPreviewKnowledgeBaseComponent extends PricingBaseComponent imp this.prompt_token_size = response.prompt_token_size; this.logger.log("[MODAL-PREVIEW-KB] ask gpt preview prompt_token_size: ", this.prompt_token_size) const endTime = performance.now(); - this.responseTime = Math.round((endTime - startTime) / 1000); + this.responseTime = Math.round((endTime - startTime) / 1000); this.translateparam = { respTime: this.responseTime }; this.qa = response; this.logger.log("[MODAL-PREVIEW-KB] ask gpt preview qa: ", this.qa) @@ -277,14 +277,21 @@ export class ModalPreviewKnowledgeBaseComponent extends PricingBaseComponent imp this.show_answer = true; this.searching = false; }, (err) => { - // this.logger.log("ask gpt preview response error: ", err); + this.logger.log("ask gpt preview response error: ", err); // this.logger.log("ask gpt preview response error message: ", error.message); // this.logger.log("ask gpt preview response error error: ", error.error); if (err && err.error && err.error.error_code === 13001) { this.answer = this.translate.instant('KbPage.AiQuotaExceeded') this.aiQuotaExceeded = true - } else { + } else if (err && err.error && err.error.message) { this.answer = err.error.message; + } else if (err.error && err.error.error && err.error.error.answer) { + this.answer = err.error.error.answer; + // && err.headers.statusText + if (err.statusText) { + this.logger.log("ask gpt preview error h1 err.headers ", err.statusText); + this.answer = this.answer + ' (' + err.statusText + ')' + } } this.logger.error("ERROR ask gpt: ", err.message); diff --git a/src/app/knowledge-bases/modals/modal-urls-knowledge-base/modal-urls-knowledge-base.component.html b/src/app/knowledge-bases/modals/modal-urls-knowledge-base/modal-urls-knowledge-base.component.html index 548a65b1f936..a07fd63e7e8c 100644 --- a/src/app/knowledge-bases/modals/modal-urls-knowledge-base/modal-urls-knowledge-base.component.html +++ b/src/app/knowledge-bases/modals/modal-urls-knowledge-base/modal-urls-knowledge-base.component.html @@ -11,23 +11,17 @@

{{ 'KbPage.titleUrls' | t

- + +
Indexing type - + @@ -39,7 +33,7 @@

{{ 'KbPage.titleUrls' | t

- +
Extract Tags (Mandatory) @@ -52,7 +46,7 @@

{{ 'KbPage.titleUrls' | t - + cancel - -> @@ -60,7 +54,7 @@

{{ 'KbPage.titleUrls' | t

- +
Unwanted Tags @@ -78,7 +72,7 @@

{{ 'KbPage.titleUrls' | t

- +
Unwanted Classnames @@ -99,7 +93,7 @@

{{ 'KbPage.titleUrls' | t

- + -->