添加对话场景的prompt配置

This commit is contained in:
997146918 2025-06-26 11:03:24 +08:00
parent 333176a13d
commit 1cb89e167c
2 changed files with 9 additions and 2 deletions

7
AIGC/AIGC.code-workspace Normal file
View File

@ -0,0 +1,7 @@
{
"folders": [
{
"path": "."
}
]
}

View File

@ -90,7 +90,7 @@ def process_prompt(promptFromUE: str) -> Tuple[bool, str]:
prompt = f""" prompt = f"""
你是一个游戏NPC对话生成器请严格按以下要求生成两个路人NPC{persons[0]["name"]}{persons[1]["name"]}的日常对话 你是一个游戏NPC对话生成器请严格按以下要求生成两个路人NPC{persons[0]["name"]}{persons[1]["name"]}的日常对话
1. 生成2轮完整对话每轮包含双方各一次发言共4句 1. 生成2轮完整对话每轮包含双方各一次发言共4句
2. 对话场景中世纪奇幻小镇的日常场景如市场/酒馆/街道 2. 对话场景{dialog_scene}
3. 角色设定 3. 角色设定
{persons[0]["name"]}{persons[0]["job"]} {persons[0]["name"]}{persons[0]["job"]}
{persons[1]["name"]}{persons[1]["job"]} {persons[1]["name"]}{persons[1]["job"]}
@ -169,7 +169,7 @@ async def generateAIChat(prompt: str, websocket: WebSocket):
await senddata(websocket, -1, messages={"ai生成格式不正确"}) await senddata(websocket, -1, messages={"ai生成格式不正确"})
else: else:
core_dialog = match.group(1).strip() core_dialog = match.group(1).strip()
logger.log(logging.INFO, "AI内容处理" + core_dialog) logger.log(logging.INFO, "AI内容处理\n" + core_dialog)
await senddata(websocket, 1, core_dialog.split('\n')) await senddata(websocket, 1, core_dialog.split('\n'))