system-prompts-and-models-o.../dealix/auto_client_acquisition/agent_observability/saudi_tone_eval.py
Sami Assiri b13cb389cc feat(dealix): sync full Dealix package to repo
- API routers, ACA modules, integrations (draft operators)
- Docs, landing pages, scripts (launch readiness, scorecard)
- Tests and CI workflow updates for Dealix

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-01 21:01:17 +03:00

20 lines
506 B
Python

"""Lightweight Saudi-Arabic tone score — heuristic."""
from __future__ import annotations
import re
from typing import Any
def evaluate_saudi_tone(text_ar: str) -> dict[str, Any]:
t = (text_ar or "").strip()
score = 65
if re.search(r"(هل|ممكن|نقدّم|نرحب|شاكرين)", t):
score += 10
if len(t) > 600:
score -= 10
if "!!!" in t or "؟؟؟" in t:
score -= 8
score = max(0, min(100, score))
return {"tone_score": score, "demo": True}