Centralize NPC LLM assets
This commit is contained in:
42
assets/dnd/npcs/extract/prompts/dnd.npcs.yaml
Normal file
42
assets/dnd/npcs/extract/prompts/dnd.npcs.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
id: dnd.npcs
|
||||
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_npcs_llm.v1.json
|
||||
repair_attempts: 0
|
||||
8
assets/dnd/npcs/extract/prompts/instructions.md
Normal file
8
assets/dnd/npcs/extract/prompts/instructions.md
Normal file
@@ -0,0 +1,8 @@
|
||||
For every NPC record, return only the observed display name and transcript
|
||||
units that support that identity.
|
||||
|
||||
Return no other details or lore inferred from general D&D knowledge. Do not
|
||||
invent a label for an anonymous creature, crowd, or generic role.
|
||||
|
||||
Preserve observed display spelling. Return at least one narrow source range for
|
||||
every record.
|
||||
12
assets/dnd/npcs/extract/prompts/task.md
Normal file
12
assets/dnd/npcs/extract/prompts/task.md
Normal file
@@ -0,0 +1,12 @@
|
||||
Extract the individually identifiable Dungeons & Dragons non-player characters
|
||||
established by the provided transcript and cite where each identity appears.
|
||||
|
||||
Include an in-world non-PC participant only when the transcript gives it a
|
||||
proper name or a stable, individually distinguishing title or alias.
|
||||
|
||||
Exclude human players, transcript speakers, and the GM as out-of-world people,
|
||||
player characters identified by the player or party references, incidental or
|
||||
hypothetical name drops, corrected transcription mistakes, anonymous or
|
||||
generic roles, indistinguishable crowds or groups, invented descriptive labels,
|
||||
and temporary summoned creatures or spell effects without a persistent
|
||||
individual identity.
|
||||
41
assets/dnd/npcs/extract/schemas/dnd_npcs_llm.v1.json
Normal file
41
assets/dnd/npcs/extract/schemas/dnd_npcs_llm.v1.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "notarius.dnd.npcs.llm",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["npcs"],
|
||||
"properties": {
|
||||
"npcs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"name",
|
||||
"source_refs"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
4
assets/dnd/npcs/normalize/prompts/candidates.md
Normal file
4
assets/dnd/npcs/normalize/prompts/candidates.md
Normal file
@@ -0,0 +1,4 @@
|
||||
The supplied NPC candidates are below. Use only these display names in the
|
||||
response.
|
||||
|
||||
{{ input "candidates" }}
|
||||
30
assets/dnd/npcs/normalize/prompts/dnd.npcs.normalize.yaml
Normal file
30
assets/dnd/npcs/normalize/prompts/dnd.npcs.normalize.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
id: dnd.npcs.normalize
|
||||
version: "v1"
|
||||
default_profile: dnd-extraction
|
||||
inputs:
|
||||
- name: candidates
|
||||
required: true
|
||||
content_type: application/json
|
||||
- name: transcript
|
||||
required: true
|
||||
content_type: application/json
|
||||
messages:
|
||||
- role: system
|
||||
content_file: ./sharedassets/common-dnd-system.md
|
||||
- role: user
|
||||
content_file: ./task.md
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-entity-reconciliation.md
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
- role: user
|
||||
content_file: ./candidates.md
|
||||
- role: user
|
||||
content_file: ./sharedassets/common-dnd-transcript.md
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json_schema
|
||||
schema_path: dnd_entity_reconcile_llm.v1.json
|
||||
repair_attempts: 0
|
||||
13
assets/dnd/npcs/normalize/prompts/task.md
Normal file
13
assets/dnd/npcs/normalize/prompts/task.md
Normal file
@@ -0,0 +1,13 @@
|
||||
Review NPC candidates and their cited transcript context to identify aliases
|
||||
that refer to the same individual. Propose only groups supported by the
|
||||
transcript, and preserve distinct individuals even when their names are
|
||||
similar.
|
||||
|
||||
For every accepted group, choose as canonical only a supplied candidate from
|
||||
that evidence-supported duplicate group. Prefer a complete, stable proper name
|
||||
over an abbreviation. Prefer an unadorned proper name over that name plus a
|
||||
contextual class, role, title, or relationship descriptor unless the transcript
|
||||
establishes the descriptor as part of the person's name. A longer display name
|
||||
is not inherently more canonical; for example, do not prefer `Captain Aria`
|
||||
over `Aria` solely because it includes the contextual title `Captain`. Do not
|
||||
invent, edit, or combine display names.
|
||||
Reference in New Issue
Block a user