Update app.py
Browse files142 unmodified lines143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175142 unmodified lines'"evidence":"...","recommendation":"..."}'']}')system = (f"You are a careful KPI performance analyst. Reply in {lang}. ""Use only the supplied data. Never invent figures, trends, causes, ""or facts. Return valid JSON only, matching the exact schema. ""Return exactly 3 insights in this order: improvement, alert, recommendation. ""The title is already displayed separately in the user interface. ""For Arabic, titles must be exactly: تحسين ملحوظ, تنبيه, توصية. ""For English, titles must be exactly: Notable Improvement, Alert, Recommendation. ""Do not repeat the title inside the finding. ""For each insight, write finding as a natural, concise sentence that uses ""the KPI's actual human-readable kpi_name, never its technical kpi_id. ""For example, say 'تحسين رضا المتعاملين' instead of 'KPI_01'. ""Do not include KPI IDs in finding, evidence, or recommendation unless ""absolutely necessary to distinguish indicators. ""The evidence field must begin with 'الدليل من البيانات:' in Arabic ""or 'Evidence from the data:' in English, followed by specific supplied ""values, dates, or trends. ""The recommendation field must begin with 'الإجراء المقترح:' in Arabic ""or 'Suggested action:' in English, followed by a practical action. ""Keep the labels inside evidence and recommendation because they are part ""of the desired response format. ""For the improvement insight, describe the actual improvement and its values. ""For the alert insight, describe the concern or state that data is insufficient. ""For the recommendation insight, provide a useful action grounded in the data. ""Do not add Markdown headings or extra fields. ""Keep all statements concise, readable, and actionable.")user = ("Analyze the current KPI values, targets, statuses and recent history. ""Use the human-readable kpi_name in the analysis, not kpi_id. "142 unmodified lines143144145146147148149150151152153154155156157158159160161162163164165166167168169142 unmodified lines'"evidence":"...","recommendation":"..."}'']}')system = (f"You are a careful KPI performance analyst. Reply entirely in {lang}. ""Use only supplied data. Never invent figures, trends, causes, or facts. ""Return valid JSON only using the requested schema. ""Return exactly 3 insights in this order: improvement, alert, recommendation. ""For Arabic, titles must be exactly: تحسين ملحوظ, تنبيه, توصية. ""For English, titles must be exactly: Notable Improvement, Alert, Recommendation. ""The title is displayed separately by the UI. Do not repeat it in the finding. ""Use the human-readable kpi_name, never technical IDs such as KPI_01. ""Write finding as one natural, concise sentence in the requested language. ""Write evidence as the evidence text ONLY. ""Write recommendation as the suggested action ONLY. ""NEVER include the labels 'الدليل من البيانات:', 'الإجراء المقترح:', ""'Evidence from the data:', or 'Suggested action:' inside any JSON field. ""The UI adds those labels automatically. ""Do not mix Arabic and English. Use the language specified above for every field. ""If evidence is insufficient, state that clearly instead of guessing. ""Keep each field concise, factual, and actionable.")user = ("Analyze the current KPI values, targets, statuses and recent history. ""Use the human-readable kpi_name in the analysis, not kpi_id. "
app.py+16-22