Centralize item and enemy event assets
This commit is contained in:
55
assets/dnd/enemy-events/prompts/dnd.enemy_events.yaml
Normal file
55
assets/dnd/enemy-events/prompts/dnd.enemy_events.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
id: dnd.enemy_events
|
||||
version: "v1"
|
||||
default_profile: dnd-extraction
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
content_type: application/json
|
||||
- name: players
|
||||
required: false
|
||||
content_type: text/plain
|
||||
- name: party
|
||||
required: false
|
||||
content_type: text/plain
|
||||
- name: glossary
|
||||
required: false
|
||||
content_type: text/plain
|
||||
- name: npcs
|
||||
required: true
|
||||
content_type: application/json
|
||||
- name: combat_turns
|
||||
required: true
|
||||
content_type: application/json
|
||||
- name: npc_interactions
|
||||
required: true
|
||||
content_type: application/json
|
||||
messages:
|
||||
- role: system
|
||||
content_file: ./sharedassets/common-dnd-system.md
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-identity.md
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-references.md
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-transcript.md
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-extraction-evidence.md
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-npcs.md
|
||||
- role: user
|
||||
content_file: ./grounding.md
|
||||
- role: user
|
||||
content_file: ./task.md
|
||||
- role: user
|
||||
content_file: ./instructions.md
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json_schema
|
||||
schema_path: dnd_enemy_events_llm.v1.json
|
||||
repair_attempts: 0
|
||||
12
assets/dnd/enemy-events/prompts/grounding.md
Normal file
12
assets/dnd/enemy-events/prompts/grounding.md
Normal file
@@ -0,0 +1,12 @@
|
||||
Compact combat grounding is supplied below. It can guide attention and
|
||||
disambiguation, but it is not evidence. Do not derive an event, subject,
|
||||
outcome, or source range from either list. The current transcript alone must
|
||||
directly establish every returned event.
|
||||
|
||||
Combat-turn grounding:
|
||||
|
||||
{{ input "combat_turns" }}
|
||||
|
||||
Named combat-opponent grounding:
|
||||
|
||||
{{ input "npc_interactions" }}
|
||||
14
assets/dnd/enemy-events/prompts/instructions.md
Normal file
14
assets/dnd/enemy-events/prompts/instructions.md
Normal file
@@ -0,0 +1,14 @@
|
||||
Exclude party members, allies, neutral observers, mentioned-but-absent enemies,
|
||||
hazards, traps, environmental effects, uncertain allegiance, table talk,
|
||||
planning, hypotheses, recaps outside this passage, and downstream inference.
|
||||
|
||||
Do not infer an engagement or outcome from initiative, turn absence, damage,
|
||||
defeat, movement, a scene ending, combat-opponent grounding, or any auxiliary
|
||||
artifact. Auxiliary inputs can guide attention but cannot prove or supply an
|
||||
event. Cite only narrow current-transcript ranges that establish each event.
|
||||
|
||||
Return the `events` array even when no enemy event is established. Every event
|
||||
must contain only `name`, `kind`, and `source_refs`. Use exactly one kind:
|
||||
`engaged`, `killed`, `fled`, `captured`, or `incapacitated`. Each source range
|
||||
uses integer `start_unit_id` and `end_unit_id`; omit `source_id` because
|
||||
Notarius assigns the current source identity.
|
||||
20
assets/dnd/enemy-events/prompts/task.md
Normal file
20
assets/dnd/enemy-events/prompts/task.md
Normal file
@@ -0,0 +1,20 @@
|
||||
Extract Dungeons & Dragons enemy events from the supplied combat transcript.
|
||||
|
||||
Return an `engaged` event only when the transcript directly establishes that a
|
||||
subject is actively opposing the party in combat. Return `killed`, `fled`,
|
||||
`captured`, or `incapacitated` only when the transcript explicitly establishes
|
||||
that outcome. An outcome may share evidence with an engagement, and a later
|
||||
engagement or outcome for the same subject remains a separate observation.
|
||||
Emit at most one engagement for the same subject in this combat scene.
|
||||
|
||||
For `killed`, direct death or killing is required. For `fled`, the subject must
|
||||
explicitly escape, retreat, or leave combat to avoid continued engagement. For
|
||||
`captured`, the subject must be explicitly taken prisoner or secured under the
|
||||
party's control. For `incapacitated`, the subject must be explicitly unable to
|
||||
continue acting without being established as killed or captured.
|
||||
|
||||
Use a normalized NPC registry spelling when the transcript identifies that
|
||||
named NPC. A hostile creature without a registry entry is allowed. For unnamed
|
||||
individuals or groups, use only the narrowest transcript-grounded label, such
|
||||
as `Orcs`, `One orc`, or `Remaining orcs`; never invent member names, IDs, or
|
||||
quantities.
|
||||
33
assets/dnd/enemy-events/schemas/dnd_enemy_events_llm.v1.json
Normal file
33
assets/dnd/enemy-events/schemas/dnd_enemy_events_llm.v1.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "notarius.dnd.enemy_events.llm",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["events"],
|
||||
"properties": {
|
||||
"events": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["name", "kind", "source_refs"],
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"kind": {"type": "string"},
|
||||
"source_refs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["start_unit_id", "end_unit_id"],
|
||||
"properties": {
|
||||
"start_unit_id": {"type": "integer"},
|
||||
"end_unit_id": {"type": "integer"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
42
assets/dnd/item-events/prompts/dnd.item_events.yaml
Normal file
42
assets/dnd/item-events/prompts/dnd.item_events.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
id: dnd.item_events
|
||||
version: "v1"
|
||||
default_profile: dnd-extraction
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
content_type: application/json
|
||||
- name: players
|
||||
required: false
|
||||
content_type: text/plain
|
||||
- name: party
|
||||
required: false
|
||||
content_type: text/plain
|
||||
- name: glossary
|
||||
required: false
|
||||
content_type: text/plain
|
||||
messages:
|
||||
- role: system
|
||||
content_file: ./sharedassets/common-dnd-system.md
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-identity.md
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-references.md
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-transcript.md
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-extraction-evidence.md
|
||||
- role: user
|
||||
content_file: ./task.md
|
||||
- role: user
|
||||
content_file: ./instructions.md
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json_schema
|
||||
schema_path: dnd_item_events_llm.v1.json
|
||||
repair_attempts: 0
|
||||
26
assets/dnd/item-events/prompts/instructions.md
Normal file
26
assets/dnd/item-events/prompts/instructions.md
Normal file
@@ -0,0 +1,26 @@
|
||||
Return one event only when the transcript establishes a meaningful item or
|
||||
currency occurrence. Use a concise observed item name and preserve the stated
|
||||
currency denomination. Set `quantity` to the explicitly stated integer, or to
|
||||
`null` when the transcript does not state one.
|
||||
|
||||
Use `discovered` when the party learns of or encounters an item without
|
||||
establishing possession. Use `acquired` when the party or a party member gains
|
||||
possession. Use `lost` when party possession ends through a gift, sale, payment,
|
||||
theft, abandonment, or destruction not caused by intended use. Use `consumed`
|
||||
when intended use depletes an expendable item. Monetary spending, purchases, and
|
||||
payments are always `lost`, not `consumed`. Classify currency as `consumed` only
|
||||
when the transcript explicitly describes it being physically destroyed or
|
||||
expended as a non-payment component. Use `transferred` only when possession
|
||||
moves between two distinct named party members.
|
||||
|
||||
Return both `from` and `to` for every event, using `null` when a holder does not
|
||||
apply. For `discovered`, set both holders to `null`. For `acquired`, set `from`
|
||||
to `null` and provide `to`; for `lost` and `consumed`, provide `from` and set
|
||||
`to` to `null`; and for `transferred`, provide both holders. Use `party` only
|
||||
for collective or unresolved party possession, never for either side of a
|
||||
transfer. Do not emit a transfer for a gift, sale, or payment outside the party.
|
||||
|
||||
Ordinary non-depleting use is not an event. Do not infer acquisition from a
|
||||
discovery, or discovery from an acquisition: emit both only when each is
|
||||
independently established. Every event needs at least one narrow transcript
|
||||
range. Return no lore, inventory totals, aliases, or unstated holder details.
|
||||
7
assets/dnd/item-events/prompts/task.md
Normal file
7
assets/dnd/item-events/prompts/task.md
Normal file
@@ -0,0 +1,7 @@
|
||||
Extract meaningful Dungeons & Dragons item and currency events established by
|
||||
the transcript. Record only discoveries and changes in party possession, with
|
||||
the transcript ranges that support each event.
|
||||
|
||||
This is an event history, not an inventory or ledger. Do not calculate balances,
|
||||
resolve item identity across records, or infer ownership that the transcript
|
||||
does not establish.
|
||||
36
assets/dnd/item-events/schemas/dnd_item_events_llm.v1.json
Normal file
36
assets/dnd/item-events/schemas/dnd_item_events_llm.v1.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "notarius.dnd.item_events.llm",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["events"],
|
||||
"properties": {
|
||||
"events": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["name", "kind", "quantity", "from", "to", "source_refs"],
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"kind": {"type": "string"},
|
||||
"quantity": {"type": ["integer", "null"]},
|
||||
"from": {"type": ["string", "null"]},
|
||||
"to": {"type": ["string", "null"]},
|
||||
"source_refs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["start_segment", "end_segment"],
|
||||
"properties": {
|
||||
"start_segment": {"type": "integer"},
|
||||
"end_segment": {"type": "integer"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user