add single choice

This commit is contained in:
bridge
2025-11-26 16:01:27 +08:00
parent bd0903edfc
commit 75ab17f568
2 changed files with 8 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
from typing import Any, Dict, List, Optional
from src.utils.llm import call_llm_with_template
from src.classes.avatar import Avatar
from src.utils.config import CONFIG
import json
async def make_decision(
@@ -29,10 +30,13 @@ async def make_decision(
full_choices_str = f"【当前情境】:{context_desc}\n\n{choices_str}"
# 3. 调用 AI
template_path = CONFIG.paths.templates / "single_choice.txt"
result = await call_llm_with_template(
"single_choice",
avatar_infos=avatar_infos,
choices=full_choices_str
template_path,
infos={
"avatar_infos": avatar_infos,
"choices": full_choices_str
}
)
# 4. 解析结果

View File

@@ -21,7 +21,7 @@ game:
init_npc_num: 12
sect_num: 3 # init_npc_num大于sect_num时会随机选择sect_num个宗门
npc_birth_rate_per_month: 0.01
fortune_probability: 0.005
fortune_probability: 0.1
df:
ids_separator: ";"