用例与断言(示意)
用例与断言(示意)
from deepeval import evaluate
from deepeval.metrics import FaithfulnessMetric, AnswerRelevancyMetric
from deepeval.test_case import LLMTestCase
tc = LLMTestCase(input="如何评估召回?", actual_output=answer,
retrieval_context=chunks, expected_output=gold)
evaluate([tc], metrics=[FaithfulnessMetric(threshold=0.7),
AnswerRelevancyMetric(threshold=0.7)])CI 门禁阈值先按当前基线设定(如不下滑 5%),避免一次性拉高导致无人愿意合代码。