Files
group_xinghuo_jinrong/tests/test_sanitize_postprocess.py
T
zhanghongyu_0626 4b8e11c9bd feat(threshold): Implement customer loss threshold configuration and notification system
- Added `ThresholdRepository` for managing customer loss threshold configurations and notifications.
- Introduced `threshold_service` to handle loss threshold alerts based on customer portfolio performance.
- Enhanced `customer_prompts` to include new intent for querying product net values.
- Updated `customer_service` to integrate new threshold alert functionality into existing workflows.
- Implemented `sanitize_postprocess` for improved compliance handling in customer interactions.
- Enhanced course documentation to reflect updates in advisor training modules and interactive elements.

This update significantly improves the customer experience by providing proactive loss threshold notifications and enhancing the overall service framework.
2026-09-10 10:57:40 +08:00

24 lines
700 B
Python

"""sanitize_postprocess 分治(1B)单测。"""
from app.utils.compliance_guard import COMPLIANCE_REJECT
from app.utils.sanitize_postprocess import finalize_sanitized_reply
def test_data_query_falls_back_to_fact_text():
reply, transfer = finalize_sanitized_reply(
"建议您买入",
intent="holding_query",
fact_text="您当前持有 3 只产品。",
)
assert transfer is False
assert "3 只产品" in reply
def test_rag_hit_returns_compliance_without_transfer():
reply, transfer = finalize_sanitized_reply(
"建议您买入更多",
intent="product_consult",
)
assert transfer is False
assert reply == COMPLIANCE_REJECT