pbl_compiler/wwwroot/api/pbl_compiler_rules_preview.dspy
2026-09-19 10:00:33 +08:00

16 lines
897 B
Plaintext
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.

# -*- coding: utf-8 -*-
# pbl_compiler_rules_preview.dspy —— M3b 规则映射预览(零写入)薄包装。
# 契约实现pbl_compiler/rules_export_api.py::preview_rules_contract内部强制 dry_run=True
# 用途第12章 event→condition→response 映射逻辑的单步验收入口,返回
# rules_json / rules_hash / rules_manifest / issues不碰任何业务表。
debug(f'pbl_compiler_rules_preview.dspy: START params_kw={dict(params_kw)}')
try:
_kw = dict(params_kw or {})
_res = await pbl_compiler_rules_preview(**_kw)
return json.dumps(_res, ensure_ascii=False, default=str)
except Exception as _e:
debug('pbl_compiler_rules_preview.dspy: ERROR ' + str(_e))
return json.dumps({'status': 'error', 'code': 'E_DSPY_RULES_PREVIEW',
'message': str(_e), 'data': None},
ensure_ascii=False, default=str)