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

69 lines
1.8 KiB
TypeScript
Executable File

interface ChatMessage {
role: 'user' | 'assistant' | 'system';
content: string;
}
interface AIResponse {
content: string;
usage?: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
};
}
export declare class AIService {
private provider;
private iieasyUrl;
private iieasyKey;
private iieasyModel;
private lmstudioUrl;
private lmstudioModel;
constructor();
setProvider(provider: 'iieasy' | 'lmstudio'): void;
chat(messages: ChatMessage[], systemPrompt?: string): Promise<AIResponse>;
private chatIIEasy;
private chatLMStudio;
extractEstimateData(text: string, previousData?: Partial<{
direction: string;
customer: string;
objectName: string;
executor: string;
works: Array<{
name: string;
volume: number;
unit: string;
}>;
}>, estimateContext?: {
objectName: string;
customer: string;
executor?: string;
direction?: string;
items?: Array<{
workName: string;
quantity: number;
unit?: string;
}>;
}): Promise<any>;
discussEstimate(userMessage: string, history: Array<{
role: string;
content: string;
}>, estimateJson: {
objectName: string;
customer: string;
executor?: string;
direction?: string;
items?: Array<{
workName: string;
quantity: number;
unit?: string;
basePrice?: number;
totalPrice?: number;
}>;
totals?: Array<{
label: string;
resultValue: number;
}>;
}): Promise<string>;
findPriceItems(workDescription: string, priceItems: any[]): Promise<any[]>;
}
export {};
//# sourceMappingURL=ai.service.d.ts.map