world/wwwroot/api/set_world_mode.dspy

11 lines
445 B
Plaintext

"""世界模式切换:严格流转规则校验。
draft→active⇄paused、active/paused→archived、archived→active。
"""
try:
result = await set_world_mode(dict(params_kw))
return json.dumps(result, ensure_ascii=False)
except Exception as e:
exception('set_world_mode.dspy: %s' % e)
return json.dumps({'code': 'INTERNAL_ERROR', 'message': '模式切换失败', 'field': '', 'detail': format_exc()}, ensure_ascii=False)