fixes to make quest tracking work better, also quest rejection in via the converation with the NPC

This commit is contained in:
2025-11-29 17:51:53 -06:00
parent df26abd207
commit 72cf92021e
11 changed files with 885 additions and 22 deletions

View File

@@ -448,7 +448,9 @@ class NarrativeGenerator:
npc_relationship: str | None = None,
previous_dialogue: list[dict[str, Any]] | None = None,
npc_knowledge: list[str] | None = None,
quest_offering_context: dict[str, Any] | None = None
quest_offering_context: dict[str, Any] | None = None,
quest_ineligibility_context: dict[str, Any] | None = None,
player_asking_for_quests: bool = False
) -> NarrativeResponse:
"""
Generate NPC dialogue in response to player conversation.
@@ -463,6 +465,8 @@ class NarrativeGenerator:
previous_dialogue: Optional list of previous exchanges.
npc_knowledge: Optional list of things this NPC knows about.
quest_offering_context: Optional quest offer context from QuestEligibilityService.
quest_ineligibility_context: Optional context explaining why player can't take a quest.
player_asking_for_quests: Whether the player is explicitly asking for quests/work.
Returns:
NarrativeResponse with NPC dialogue.
@@ -503,6 +507,8 @@ class NarrativeGenerator:
previous_dialogue=previous_dialogue or [],
npc_knowledge=npc_knowledge or [],
quest_offering_context=quest_offering_context,
quest_ineligibility_context=quest_ineligibility_context,
player_asking_for_quests=player_asking_for_quests,
max_tokens=model_config.max_tokens
)
except PromptTemplateError as e: