import { Observable } from 'rxjs'; import { LoanSummaryResponse, Proposal, ProposalDocument, SummaryService, GoNoGoDecision, LoanSummaryDetails } from '../models/loan-summary.model'; import { AIInferenceResponse, MultiModelInferenceResponse } from '../models/api-response.model'; import * as i0 from "@angular/core"; /** * Service for managing loan summary data, AI inference, and proposals. * * @example * ```typescript * export class MyComponent { * private loanSummaryService = inject(LoanSummaryService); * * ngOnInit() { * this.loanSummaryService.getLoanSummary('APP-001').subscribe(summary => { * console.log(summary); * }); * } * } * ``` */ export declare class LoanSummaryService { private readonly http; private readonly config; /** Whether to use AI/RAG mode */ isAI: boolean; /** Whether to use RAG (Retrieval-Augmented Generation) */ isRag: boolean; /** Number of top results for RAG retrieval */ top_k: number; /** Chunk size for document splitting */ chunk_size: number; /** Overlap between chunks */ chunk_overlap: number; /** Embedding model to use */ embedding_model: string; /** Search type for retrieval */ search_type: string; /** Vector storage type */ storage_type: string; /** Selected AI model for inference */ selectedModel: string; /** Document type selections */ selectedGst: boolean; selectedBureau: boolean; selectedFinancial: boolean; /** Prompt templates for each document type */ gstPromptTemplate: string; bureauPromptTemplate: string; financialPromptTemplate: string; /** Selected data type for analysis */ selectedDataType: 'gst' | 'bureau'; /** Uploaded JSON files */ uploadedGstJsonFile: File | null; uploadedGstJsonFileName: string; uploadedBureauJsonFile: File | null; uploadedBureauJsonFileName: string; /** Get uploaded file based on selected data type */ get uploadedJsonFile(): File | null; set uploadedJsonFile(file: File | null); get uploadedJsonFileName(): string; set uploadedJsonFileName(name: string); /** Get AI inference endpoint URL */ private get aiInferenceEndpoint(); /** Get multi-model inference endpoint URL */ private get multiModelInferenceEndpoint(); constructor(); /** * Get loan summary details by proposal number * @param proposalNo - The proposal number to fetch * @returns Observable of LoanSummaryResponse */ getLoanSummary(proposalNo: string): Observable; /** * Get list of proposals for inbox * @returns Observable of Proposal array */ getProposals(): Observable; /** * Get available summary services * @returns Observable of SummaryService array */ getAvailableServices(): Observable; /** * Call AI inference API with prompt and model * @param prompt - The prompt to send * @param modelName - The model to use * @returns Observable of AIInferenceResponse */ callAIInference(prompt: string, modelName: string): Observable; /** * Call multi-model inference API * @param prompts - Prompts for each document type * @param modelName - The model to use * @param proposalNo - Optional proposal number * @param documents - Optional documents array from proposal * @returns Observable of MultiModelInferenceResponse */ callMultiModelInference(prompts: { gst?: string; bureau?: string; financial?: string; }, modelName: string, proposalNo?: string, documents?: ProposalDocument[]): Observable; /** * Call single document inference API * @param prompt - The prompt to send * @param documentType - Type of document * @param modelName - The model to use * @param proposalNo - Optional proposal number * @param documents - Optional documents array from proposal * @returns Observable of MultiModelInferenceResponse */ callSingleModelInference(prompt: string, documentType: 'gst' | 'bureau' | 'financial', modelName: string, proposalNo?: string, documents?: ProposalDocument[]): Observable; /** * Calculate Go/No-Go decision based on loan summary * @param summary - The loan summary details * @returns GoNoGoDecision */ calculateGoNoGoDecision(summary: LoanSummaryDetails): GoNoGoDecision; /** * Format currency in Indian format * @param amount - The amount to format * @returns Formatted currency string */ formatCurrency(amount: number): string; /** * Format number in Indian format * @param num - The number to format * @returns Formatted number string */ formatNumber(num: number): string; /** * Get random loading tip * @returns A loading tip string */ getLoadingTip(): string; /** * Check if a bureau data value is available * @param value - The value to check * @returns Boolean indicating availability */ isBureauValueAvailable(value: string | number): boolean; /** * Get numeric value from bureau data * @param value - The value to convert * @returns Numeric value (0 if unavailable) */ getBureauNumericValue(value: string | number): number; /** * Parses a value that may be a plain number OR a backend-formatted currency * string (e.g. "₹30.02 Lakh", "₹1.20 Cr", "-₹0.75 Lakh") into a raw number. * Returns 0 for missing/unavailable values ('-', null, undefined, unparsable). */ parseAmountToNumber(value: string | number | null | undefined): number; /** * Get string value from bureau data * @param value - The value to convert * @returns String value ('N/A' if unavailable) */ getBureauStringValue(value: string | number): string; private processJsonFileAndSendRequest; private sendApiRequest; /** * Normalize document names for API consistency * Maps: 'fin'/'financial' → 'financial', 'cibil'/'bureau' → 'cibil', 'gst' → 'gst' * Supports partial matches (e.g., 'CIBIL Commercial Report' → 'cibil') * @param documents - The documents array from proposal * @returns Normalized documents array */ private normalizeDocuments; private getMockLoanSummary; private getMockProposals; private getDefaultServices; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }