diff --git a/src/controllers/data-extraction/data-extraction.controller.ts b/src/controllers/data-extraction/data-extraction.controller.ts index 96156b8..fc83ca6 100644 --- a/src/controllers/data-extraction/data-extraction.controller.ts +++ b/src/controllers/data-extraction/data-extraction.controller.ts @@ -34,5 +34,6 @@ export class DataExtractionController { const questionIds = (await this.service.listQuestions()).map(question => question.id) return this.service.extractData(customer, questionIds.map(id => ({id}))) + .catch(err => console.error(err)) } } diff --git a/src/services/data-extraction/data-extraction.impl.ts b/src/services/data-extraction/data-extraction.impl.ts index c36ea02..577abb9 100644 --- a/src/services/data-extraction/data-extraction.impl.ts +++ b/src/services/data-extraction/data-extraction.impl.ts @@ -111,6 +111,8 @@ export class DataExtractionImpl extends DataExtractionCsv implem console.log('1. Text extracted from Discovery:', {naturalLanguageQuery, text}) + console.log(text) + return text; } @@ -118,15 +120,15 @@ export class DataExtractionImpl extends DataExtractionCsv implem return result.results .map(result => result.document_passages .map(passage => passage.passage_text) - .join('\n') + .join(' ') ) - .join('\n') + .join(' ') } handleDiscoveryPassages(result: DiscoveryV2.QueryResponse): string { return result.passages .map(passage => passage.passage_text) - .join('\n') + .join(' ') } async generateResponse(customer: string, config: DataExtractionConfig, text: string, backends: WatsonBackends): Promise {