pbl_evidence/wwwroot/api/pbl_evidence_stats.dspy
2026-09-21 12:38:06 +08:00

18 lines
819 B
Plaintext
Raw 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.

# pbl_evidence/api/pbl_evidence_stats.dspy
# 证据类型分布统计(供 M6 评估 / 概览卡片)。dspy 无 import、无 ServerEnv()、显式 return。
debug(f'pbl_evidence_stats.dspy: START params_kw={dict(params_kw)}')
try:
tenant = params_kw.get('tenant_id') or (await get_userorgid()) or '0'
res = await pbl_evidence_stats(
tenant_id=tenant,
learner_id=params_kw.get('learner_id'),
blueprint_id=params_kw.get('blueprint_id'),
)
status = 'OK' if res.get('ok') else 'ERROR'
debug(f'pbl_evidence_stats.dspy: DONE total={res.get("total")}')
return {'status': status, 'data': res, 'message': res.get('message') or ''}
except Exception as e:
error(f'pbl_evidence_stats.dspy: FAIL {format_exc()}')
return {'status': 'ERROR', 'data': None, 'message': str(e)}