mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-15 00:21:58 +00:00
分析期望的两处小修:期望 SQL 只返回两期时补上的基期、本期写成文字交给分析工具的参数(期次是数的也认,算子按写出来的样子比);参数和结果对不上的原因前面写「第 n 个期望(贡献)算不出期望」,不再叠两个「的」。测试补逐题 E1 顺着下钻找到两层的查询
This commit is contained in:
@@ -448,7 +448,7 @@ async def _analysis_value(exp: Mapping[str, Any], at: int, found: _Analyses) ->
|
|||||||
try:
|
try:
|
||||||
request = judgements.request_of(exp, found.ctx.variables(), found.snapshot)
|
request = judgements.request_of(exp, found.ctx.variables(), found.snapshot)
|
||||||
except judgements.ParamsInvalid as e:
|
except judgements.ParamsInvalid as e:
|
||||||
raise _NoValue(f"{where}的{e.message}") from None
|
raise _NoValue(f"{where}算不出期望,{e.message}") from None
|
||||||
try:
|
try:
|
||||||
result = await analysis_ops.run(request, lambda name: inp if name == judgements.GOLD_REF else None,
|
result = await analysis_ops.run(request, lambda name: inp if name == judgements.GOLD_REF else None,
|
||||||
settings=settings, context=context, refuse_data_errors=True)
|
settings=settings, context=context, refuse_data_errors=True)
|
||||||
|
|||||||
@@ -189,7 +189,8 @@ def _two_periods(snapshot: Mapping[str, Any], period: str) -> tuple[Any, Any]:
|
|||||||
order = sorted(range(2), key=lambda k: items[k].ordinal)
|
order = sorted(range(2), key=lambda k: items[k].ordinal)
|
||||||
else:
|
else:
|
||||||
order = sorted(range(2), key=lambda k: str(values[k]))
|
order = sorted(range(2), key=lambda k: str(values[k]))
|
||||||
return values[order[0]], values[order[1]]
|
# 写成文字交给分析工具的参数(期次是数的也一样:算子按写出来的样子认期次列里的值)
|
||||||
|
return str(values[order[0]]), str(values[order[1]])
|
||||||
|
|
||||||
|
|
||||||
def request_of(exp: Mapping[str, Any], variables: Mapping[str, str], snapshot: Mapping[str, Any]) -> dict[str, Any]:
|
def request_of(exp: Mapping[str, Any], variables: Mapping[str, str], snapshot: Mapping[str, Any]) -> dict[str, Any]:
|
||||||
|
|||||||
@@ -315,3 +315,13 @@ def test_the_summary_counts_outcomes_by_kind():
|
|||||||
assert summary["outcomes_by_kind"] == {"contribution": {"traced": 1}, "verdict": {"wrong": 1},
|
assert summary["outcomes_by_kind"] == {"contribution": {"traced": 1}, "verdict": {"wrong": 1},
|
||||||
"scalar": {"untraced": 1}}
|
"scalar": {"untraced": 1}}
|
||||||
assert summary["outcomes"] == {"traced": 1, "wrong": 1, "untraced": 1}
|
assert summary["outcomes"] == {"traced": 1, "wrong": 1, "untraced": 1}
|
||||||
|
|
||||||
|
|
||||||
|
def test_e1_follows_the_analysis_inputs_down_the_drill():
|
||||||
|
"""逐题 E1 拿产出答案的查询:引用的是下钻那一层的分析结论时,顺着上一层的结论找到两层各自读的查询。"""
|
||||||
|
from app.eval.score import _query_inputs
|
||||||
|
|
||||||
|
found = {"a1": {"inputs": ["q1"]}, "a2": {"inputs": ["a1", "q2"]}}
|
||||||
|
assert _query_inputs(found["a2"], found, {"q1": {}, "q2": {}}) == ["q1", "q2"]
|
||||||
|
assert _query_inputs({"inputs": ["gone"]}, found, {"q1": {}}) == [], "取不回的输入不算"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user