feat(fusion_accounting_followup): tone_selector service
Made-with: Cursor
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from . import overdue_aging
|
||||
from . import level_resolver
|
||||
from . import risk_scorer
|
||||
from . import tone_selector
|
||||
|
||||
18
fusion_accounting_followup/services/tone_selector.py
Normal file
18
fusion_accounting_followup/services/tone_selector.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""Tone selector: pick gentle/firm/legal based on follow-up level + risk score."""
|
||||
|
||||
TONE_BY_LEVEL = {
|
||||
1: 'gentle',
|
||||
2: 'firm',
|
||||
3: 'legal',
|
||||
4: 'legal',
|
||||
}
|
||||
|
||||
|
||||
def select_tone(*, level_sequence: int, risk_score: int = 0) -> str:
|
||||
"""Default tone follows level sequence; high risk can escalate."""
|
||||
base_tone = TONE_BY_LEVEL.get(level_sequence, 'gentle')
|
||||
if risk_score >= 80 and base_tone == 'gentle':
|
||||
return 'firm'
|
||||
if risk_score >= 90 and base_tone == 'firm':
|
||||
return 'legal'
|
||||
return base_tone
|
||||
Reference in New Issue
Block a user