Prepare shared context for all D&D extractors

This commit is contained in:
2026-11-29 18:13:45 +00:00
parent e0554209f0
commit 03e4c0d64d
22 changed files with 189 additions and 176 deletions

View File

@@ -262,20 +262,20 @@ func loadGroundedPipelineConfig(t *testing.T) config.Config {
func configureGroundedCampaignReferences(t *testing.T, cfg *config.Config) map[string]string {
t.Helper()
values := map[string]string{
"party": "Mira Thorn: ally\n",
"glossary": "Greencloak: Mira Thorn's title\n",
"party": `{"schema_version":"maximumdirect.rpg.party.v1","characters":{"m":{"character":{"name":"Mira Thorn","aliases":["Ally"]}}}}`,
"glossary": `{"schema_version":"maximumdirect.glossary.v1","collections":{"campaign":{"entries":[{"id":"g","name":"Greencloak","category":"title","description":"Mira Thorn's title"}]}}}`,
}
profile := cfg.Pipelines["dnd-npc-grounded"]
profile.References = make(map[string]pipeline.ReferenceSource, len(values))
for name, content := range values {
path := filepath.Join(t.TempDir(), name+".txt")
path := filepath.Join(t.TempDir(), name+".json")
if err := os.WriteFile(path, []byte(content), 0o600); err != nil {
t.Fatalf("write %s reference: %v", name, err)
}
profile.References[name] = pipeline.ExternalReference(path)
}
cfg.Pipelines["dnd-npc-grounded"] = profile
return values
return map[string]string{"party": "Ally", "glossary": "Greencloak"}
}
func runGroundedPipeline(t *testing.T, configValue config.Config, registries pipeline.Registries, client *groundedDNDLLMClient) pipeline.RunOutput {