Files
Genarrative/server-rs/crates/api-server/src/custom_world_result_prompts.rs
kdletters cbc27bad4a
Some checks failed
CI / verify (push) Has been cancelled
init with react+axum+spacetimedb
2026-04-26 18:06:23 +08:00

40 lines
1.2 KiB
Rust
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.
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()
}