research: compare Jev intent state with the previous turn
Independent Staging Quality Gate / validate (push) Successful in 12m0s
Independent Staging Quality Gate / publish (push) Successful in 3m35s

V0 on the existing 157 real rows matches the 09-19 cache. The staging extract has no case linkage, so V1/V2 are unmeasured and the verdict stays 缺数据.
This commit is contained in:
jesse-ux
2026-09-27 11:41:53 +08:00
parent 710c848b30
commit e3bd3930e3
13 changed files with 100475 additions and 26 deletions
+4 -4
View File
@@ -74,7 +74,7 @@ def _parse_content(text: str) -> dict[str, Any]:
return payload
def call_current(sample: Mapping[str, Any], *, timeout: float = 60.0) -> dict[str, Any]:
def call_current(sample: Mapping[str, Any], *, timeout: float = 60.0, variant: str = "v0") -> dict[str, Any]:
api_key = os.environ.get("DEEPSEEK_API_KEY") or ""
if not api_key:
raise RuntimeError("DEEPSEEK_API_KEY missing")
@@ -84,7 +84,7 @@ def call_current(sample: Mapping[str, Any], *, timeout: float = 60.0) -> dict[st
"model": model,
"messages": [
{"role": "system", "content": _instructions(sample) + "\n" + JSON_SCHEMA_HINT},
{"role": "user", "content": json.dumps(build_state(sample), ensure_ascii=False)},
{"role": "user", "content": json.dumps(build_state(sample, variant=variant if variant == "v1" else "v0"), ensure_ascii=False)},
],
"temperature": 0,
"max_tokens": 256,
@@ -128,12 +128,12 @@ def call_current(sample: Mapping[str, Any], *, timeout: float = 60.0) -> dict[st
}
def call_current_retry(sample: Mapping[str, Any], *, retries: int = 4) -> dict[str, Any]:
def call_current_retry(sample: Mapping[str, Any], *, retries: int = 4, variant: str = "v0") -> dict[str, Any]:
last_error = ""
delay = 1.0
for _attempt in range(retries):
try:
return call_current(sample)
return call_current(sample, variant=variant)
except urllib.error.HTTPError as exc:
last_error = f"HTTP{exc.code}"
if exc.code in {429, 500, 502, 503, 529}: