Initial commit MKD fixes
This commit is contained in:
55
services/geminiService.ts
Executable file
55
services/geminiService.ts
Executable file
@@ -0,0 +1,55 @@
|
||||
// Заглушки для функций AI (Gemini отключен)
|
||||
import { Building, ResidentFeedback, AIAnalysisResult, AnalyzedFeedback } from "../types";
|
||||
|
||||
export const generateBuildingAudit = async (building: Building): Promise<string> => {
|
||||
// Заглушка - функция AI отключена
|
||||
return `# Анализ дома ${building.passport.address}
|
||||
|
||||
## Общее состояние
|
||||
Дом в эксплуатации. Требуется ручной анализ данных.
|
||||
|
||||
## Финансовое состояние
|
||||
- Баланс: ${building.financials.balance.toLocaleString('ru-RU')} ₽
|
||||
- Собираемость: ${building.financials.collectionRate}%
|
||||
- Задолженность: ${building.financials.debt.toLocaleString('ru-RU')} ₽
|
||||
|
||||
*Примечание: Функция AI анализа отключена.*
|
||||
`;
|
||||
};
|
||||
|
||||
export const generateResidentFinancialSummary = async (building: Building): Promise<string> => {
|
||||
// Заглушка - функция AI отключена
|
||||
const balance = building.financials.balance;
|
||||
const collectionRate = building.financials.collectionRate;
|
||||
|
||||
return `Уважаемые жители дома ${building.passport.address}!
|
||||
|
||||
💰 Баланс дома: ${balance.toLocaleString('ru-RU')} ₽
|
||||
📊 Собираемость платежей: ${collectionRate}%
|
||||
|
||||
${collectionRate > 90 ? '✅ Благодарим за своевременную оплату!' : '⚠️ Просим своевременно оплачивать коммунальные услуги.'}
|
||||
|
||||
*Примечание: Функция AI генерации отключена. Текст сформирован автоматически.*
|
||||
`;
|
||||
};
|
||||
|
||||
export const analyzeResidentFeedback = async (feedback: ResidentFeedback[]): Promise<AIAnalysisResult | null> => {
|
||||
// Заглушка - функция AI отключена
|
||||
// Возвращаем базовый анализ без AI
|
||||
const analyzedFeedback: AnalyzedFeedback[] = feedback.map(f => ({
|
||||
...f,
|
||||
category: 'Другое',
|
||||
sentiment: f.rating >= 7 ? 'Positive' : f.rating <= 3 ? 'Negative' : 'Neutral'
|
||||
}));
|
||||
|
||||
const positiveCount = analyzedFeedback.filter(f => f.sentiment === 'Positive').length;
|
||||
const negativeCount = analyzedFeedback.filter(f => f.sentiment === 'Negative').length;
|
||||
|
||||
return {
|
||||
analyzedFeedback,
|
||||
summary: {
|
||||
positive: positiveCount > 0 ? [`Получено ${positiveCount} положительных отзывов`] : [],
|
||||
negative: negativeCount > 0 ? [`Получено ${negativeCount} отрицательных отзывов`] : []
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user