diff --git a/src/app/wlo-search/template/template.component.ts b/src/app/wlo-search/template/template.component.ts index e385f24c..070f96bb 100644 --- a/src/app/wlo-search/template/template.component.ts +++ b/src/app/wlo-search/template/template.component.ts @@ -203,29 +203,41 @@ export class TemplateComponent implements OnInit { /** calls the Z-API to invoke ChatGPT */ private generateFromPrompt() { - // TODO: Implement job widgets - this.jobsWidgetReady = true; - // this.aiTextPromptsService - // .publicPrompt({ - // widgetNodeId: 'c937cabf-5ffd-47f0-a5e8-ef0ed370baf0', - // contextNodeId: this.topicCollectionID(), - // }) - // .subscribe((result: any) => { - // const response = result.responses[0]; - // console.log('RESPONSE: ', response); - // this.generatedHeader.set(response); - // }); - // this.aiTextPromptsService - // .publicPrompt({ - // widgetNodeId: 'a625a9d6-383d-4835-84f2-a8e2792ea13f', - // contextNodeId: this.topicCollectionID(), - // }) - // .subscribe((result: any) => { - // const response = result.responses[0]; - // console.log('RESPONSE 2: ', response); - // this.generatedJobText.set(response); - // this.jobsWidgetReady = true; - // }); + this.aiTextPromptsService + .publicPrompt({ + widgetNodeId: 'c937cabf-5ffd-47f0-a5e8-ef0ed370baf0', + contextNodeId: this.topicCollectionID(), + body: {}, + }) + .subscribe( + (result: any) => { + const response = result.responses[0]; + console.log('RESPONSE: ', response); + this.generatedHeader.set(response); + }, + (error: any) => { + console.log('An error occurred: ', error); + this.jobsWidgetReady = true; + }, + ); + this.aiTextPromptsService + .publicPrompt({ + widgetNodeId: 'a625a9d6-383d-4835-84f2-a8e2792ea13f', + contextNodeId: this.topicCollectionID(), + body: {}, + }) + .subscribe( + (result: any) => { + const response = result.responses[0]; + console.log('RESPONSE 2: ', response); + this.generatedJobText.set(response); + this.jobsWidgetReady = true; + }, + (error: any) => { + console.log('An error occurred: ', error); + this.jobsWidgetReady = true; + }, + ); } // https://stackoverflow.com/a/16348977