diff --git a/backend/files/system/openai/import-page.post.hl b/backend/files/system/openai/import-page.post.hl index 7a5a73ed90..5a9a7623e5 100644 --- a/backend/files/system/openai/import-page.post.hl +++ b/backend/files/system/openai/import-page.post.hl @@ -60,6 +60,11 @@ fork args message:Done creating OpenAI training data from page type:success + sockets.signal:magic.backend.chatbot + roles:root + args + message:Done creating OpenAI training data from page + type:success // Basic logging. log.info:OpenAI training data successfully created from page diff --git a/frontend/src/app/_protected/pages/manage/machine-learning/components/machine-learning-import-feedback/machine-learning-import-feedback.component.ts b/frontend/src/app/_protected/pages/manage/machine-learning/components/machine-learning-import-feedback/machine-learning-import-feedback.component.ts index 694d7aa398..9531e608fc 100644 --- a/frontend/src/app/_protected/pages/manage/machine-learning/components/machine-learning-import-feedback/machine-learning-import-feedback.component.ts +++ b/frontend/src/app/_protected/pages/manage/machine-learning/components/machine-learning-import-feedback/machine-learning-import-feedback.component.ts @@ -70,24 +70,38 @@ export class MachineLearningImportFeedbackComponent implements OnInit, OnDestroy this.hubConnection.start().then(() => { this.generalService.showLoading(); - this.openAIService.importUrl( - this.data.url, - this.data.type, - this.data.delay, - this.data.max, - this.data.threshold, - this.data.summarize).subscribe({ - next: () => { - - this.generalService.hideLoading(); - this.generalService.showFeedback('Crawling started, you will be notified when it is finished', 'successMessage'); - }, - error: () => { - - this.generalService.hideLoading(); - this.generalService.showFeedback('Something went wrong as we tried to start import', 'errorMessage'); - } - }); + if (this.data.site === true) { + this.openAIService.importUrl( + this.data.url, + this.data.type, + this.data.delay, + this.data.max, + this.data.threshold, + this.data.summarize).subscribe({ + next: () => { + + this.generalService.hideLoading(); + this.generalService.showFeedback('Crawling started, you will be notified when it is finished', 'successMessage'); + }, + error: () => { + + this.generalService.hideLoading(); + this.generalService.showFeedback('Something went wrong as we tried to start import', 'errorMessage'); + } + }); + } else { + this.openAIService.importPage(this.data.url, this.data.type, 50).subscribe({ + next: () => { + + this.generalService.hideLoading(); + }, + error: () => { + + this.generalService.hideLoading(); + this.generalService.showFeedback('Something went wrong as we tried to spice your model', 'errorMessage'); + } + }); + } }); } } diff --git a/frontend/src/app/_protected/pages/manage/machine-learning/machine-learning-models/machine-learning-models.component.ts b/frontend/src/app/_protected/pages/manage/machine-learning/machine-learning-models/machine-learning-models.component.ts index eddcf3609f..36c35b5eb5 100644 --- a/frontend/src/app/_protected/pages/manage/machine-learning/machine-learning-models/machine-learning-models.component.ts +++ b/frontend/src/app/_protected/pages/manage/machine-learning/machine-learning-models/machine-learning-models.component.ts @@ -168,6 +168,7 @@ export class MachineLearningModelsComponent implements OnInit { max: result.max, threshold: result.threshold, summarize: result.summarize, + site: true, } }); } diff --git a/frontend/src/app/_protected/pages/manage/machine-learning/machine-learning-training-data/machine-learning-training-data.component.ts b/frontend/src/app/_protected/pages/manage/machine-learning/machine-learning-training-data/machine-learning-training-data.component.ts index f1821d549d..63c2115e80 100644 --- a/frontend/src/app/_protected/pages/manage/machine-learning/machine-learning-training-data/machine-learning-training-data.component.ts +++ b/frontend/src/app/_protected/pages/manage/machine-learning/machine-learning-training-data/machine-learning-training-data.component.ts @@ -13,6 +13,7 @@ import { MachineLearningTrainingService } from 'src/app/_general/services/machin import { OpenAIService } from 'src/app/_general/services/openai.service'; import { MachineLearningEditTrainingSnippetComponent } from '../components/machine-learning-edit-training-snippet/machine-learning-edit-training-snippet.component'; import { MachineLearningSpiceComponent } from '../components/machine-learning-spice/machine-learning-spice.component'; +import { MachineLearningImportFeedbackComponent } from '../components/machine-learning-import-feedback/machine-learning-import-feedback.component'; /** * Helper component to administrate training data for OpenAI integration @@ -115,17 +116,20 @@ export class MachineLearningTrainingDataComponent implements OnInit { if (result) { - this.openAiService.importPage(result, this.type, 50).subscribe({ - next: () => { - - this.generalService.hideLoading(); - }, - error: () => { - - this.generalService.hideLoading(); - this.generalService.showFeedback('Something went wrong as we tried to spice your model', 'errorMessage'); - } - }); + this.dialog + .open(MachineLearningImportFeedbackComponent, { + width: '80vw', + maxWidth: '1280px', + data: { + url: result, + type: this.type, + delay: result.delay, + max: result.max, + threshold: result.threshold, + summarize: result.summarize, + site: false, + } + }); } }); }