Files
geo/backend/dist/services/parser.service.d.ts
2026-02-04 00:11:19 +05:00

43 lines
1.7 KiB
TypeScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { PrismaClient } from '@prisma/client';
import { AIService } from './ai.service';
interface ParsedData {
direction?: string;
customer?: string;
objectName?: string;
executor?: string;
works?: Array<{
name: string;
volume: number;
unit: string;
priceItemId?: string;
justification?: string;
}>;
vatIncluded?: boolean;
missingFields?: string[];
}
interface ProcessResult {
message: string;
extractedData?: ParsedData;
needsClarification: boolean;
clarificationQuestions?: string[];
}
export declare class ParserService {
private prisma;
private aiService;
constructor(prisma: PrismaClient, aiService: AIService);
/** Режим обсуждения сметы: свободный диалог о прикреплённой смете */
private processEstimateDiscussion;
/** Берём последние извлечённые данные из истории (ответ ассистента с metadata) */
private getPreviousExtractedData;
/** Значения-заполнители: не перезаписываем ими ранее указанные данные */
private static readonly PLACEHOLDER_VALUES;
private isPlaceholder;
/** Объединяем новые данные с предыдущими: не затираем поля, которые пользователь уже указал */
private mergeExtractedData;
processMessage(content: string, history: any[], estimateId?: string | null): Promise<ProcessResult>;
private matchWorksWithPriceItems;
private getRelevantPriceBookCode;
createEstimateFromParsedData(data: ParsedData): Promise<any>;
}
export {};
//# sourceMappingURL=parser.service.d.ts.map