feat: 实现AI拒答机制和语言控制优化

- 添加 RunStatus.REFUSED 状态,AI可明确表达拒答意图
- 优化 System Prompt 使用视觉强调提高AI对拒答规则的遵守
- User Prompt 添加 SCOPE CHECK 和语言约束
- Worker Rules 添加多语言版本角色扮演规则
- Runner 传递 language 参数到 worker stage
- json_finalize 添加语言约束参数
- 更新单元测试匹配新的 prompt 结构
This commit is contained in:
ZL-Q
2026-04-29 01:38:59 +08:00
parent adb2b3bcc3
commit f497afbff2
15 changed files with 1293 additions and 117 deletions
+5 -2
View File
@@ -164,6 +164,9 @@ start() {
echo ""
echo "=== App Started ==="
echo "Web server running on: http://localhost:${WEB_PORT}"
echo "Health check: http://localhost:${WEB_PORT}/health"
echo ""
echo "Log files will be created in logs/ directory:"
echo " - web.log, web.error.log"
echo " - worker-agent.log, worker-agent.error.log"
@@ -188,8 +191,8 @@ stop() {
echo "Checking for orphaned processes..."
kill_matching_processes "uvicorn" "uv run uvicorn app:app"
kill_matching_processes "taskiq workers" "uv run taskiq worker core.taskiq.app:"
kill_matching_processes "uvicorn" "uvicorn app:app"
kill_matching_processes "taskiq workers" "taskiq worker.*core\.taskiq\.app:"
kill_listening_processes "port ${WEB_PORT} listeners" "$WEB_PORT"