in frontend/src/app/contact-center-analyst/home/home.component.ts [370:397]
async clickGenrateInsightConversation(conversations: any, isCustomer: boolean = true) {
this.clearInsights(isCustomer);
if (isCustomer) {
this.insightsLoading = true;
} else {
this.searchInsightsLoading = true;
}
if (conversations.length == 1) {
if (isCustomer) {
this.selectedConversationHTML = String(marked.parse(conversations[0].conversation));
} else {
this.selectedConversationSearchHTML = String(marked.parse(conversations[0].conversation));
}
}
else {
if (isCustomer) {
this.selectedConversationHTML = null;
} else {
this.selectedConversationSearchHTML = null;
}
}
const generatedInsights: GeneratedInsights = await firstValueFrom(
this.contactCenterAnalystService.generateConversationsInsights(
conversations.map((conversation: any) => conversation)
) as Observable<GeneratedInsights>
);
this.updateInsights(generatedInsights, isCustomer);
}