Watch
1
0
Fork
You've already forked Seyyed_arc
0
forked from hesabix/arc
Seyyed_arc/hesabixAPI/tests/test_ai_eval_service.py

20 lines
663 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""تست امتیازدهی ارزیابی AI."""
from __future__ import annotations
from app.services.ai.ai_eval_service import _score_response
def test_score_response_pass():
ok, details = _score_response(
"خلاصه فروش هفتگی: مبلغ خالص ۱۰ میلیون",
expected=["فروش", "خلاصه"],
forbidden=["نمی‌دانم"],
)
assert ok is True
assert details["missing_expected"] == []
def test_score_response_fail_missing():
ok, details = _score_response("سلام", expected=["فاکتور"], forbidden=[])
assert ok is False
assert "فاکتور" in details["missing_expected"]