40 lines
1.2 KiB
Rust
40 lines
1.2 KiB
Rust
use serde_json::{Value, json};
|
||
|
||
/// 结果页新增可扮演角色 / 场景角色 / 场景的提示词脚本。
|
||
/// 这里只生成 LLM 可审计输入,不处理 fallback,避免提示词规则和业务兜底混在一起。
|
||
pub(crate) fn build_result_entity_system_prompt() -> &'static str {
|
||
"你是 RPG 自定义世界实体生成器。只输出一个 JSON 对象,不要输出 Markdown。"
|
||
}
|
||
|
||
pub(crate) fn build_result_entity_user_prompt(
|
||
profile: &Value,
|
||
kind: &str,
|
||
fallback: &Value,
|
||
) -> String {
|
||
json!({
|
||
"task": "generate_custom_world_entity",
|
||
"kind": kind,
|
||
"profile": profile,
|
||
"fallback": fallback,
|
||
})
|
||
.to_string()
|
||
}
|
||
|
||
pub(crate) fn build_result_scene_npc_system_prompt() -> &'static str {
|
||
"你是 RPG 自定义世界场景 NPC 生成器。只输出一个 JSON 对象,不要输出 Markdown。"
|
||
}
|
||
|
||
pub(crate) fn build_result_scene_npc_user_prompt(
|
||
profile: &Value,
|
||
landmark_id: &str,
|
||
fallback: &Value,
|
||
) -> String {
|
||
json!({
|
||
"task": "generate_custom_world_scene_npc",
|
||
"landmarkId": landmark_id,
|
||
"profile": profile,
|
||
"fallback": fallback,
|
||
})
|
||
.to_string()
|
||
}
|