Skip to content

NPC 能给 agent 派任务 #19

@yisiliu

Description

@yisiliu

依赖#5 + #7(如未实现请先做依赖 issue,或在 PR 披露段写明你 mock 了哪些行为)

NPC 可以发任务("给我送 3 个苹果到广场")。Agent 接 → 进行中 → 完成 → 拿奖励。是一个多步骤状态机:trigger → assigned → in-progress → completed/failed → reward。

要想清楚:agent 怎么"知道"自己接了任务(注入 prompt)?怎么验证完成?怎么避免老在做任务忘了自己的生活?

实现思路:

  • 新表 quests + 状态机字段
  • acceptQuest / completeQuestStep / abandonQuest input
  • NPC 用 LLM 生成任务的 action
  • prompt 注入"你接了任务 X,进度 Y/Z"

验收:

  • NPC 能(手动或 LLM 生成)发任务
  • Agent 能查看 + 接 + 进行中 + 完成 / 放弃
  • 完成后奖励正确发放(依赖 引入货币和转账 #5 agent 自带库存 #7
  • 同时持多个任务时 prompt 不混乱
  • 至少 1 个完整端到端 demo

教学价值:LLM agent 在带状态 DAG 中的推理 + 长期任务跟踪。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions