Move DnD shared prompt assets into helper package

This commit is contained in:
2026-07-06 17:15:27 +00:00
parent 68b426cdb0
commit 524f2ffb8e
11 changed files with 107 additions and 31 deletions

View File

@@ -9,16 +9,17 @@ import (
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
"gitea.maximumdirect.net/eric/notarius/internal/framework/llm"
"gitea.maximumdirect.net/eric/notarius/internal/modules/sharedassets"
"gitea.maximumdirect.net/eric/notarius/internal/modules/sharedassets/dnd"
)
const scriptoriumPromptRoot = "assets/prompts"
func RegisterPromptAssets(registry *llm.AssetRegistry) error {
promptFS, err := sharedassets.ModulePromptFS("dnd.scenes", embeddedAssets, []sharedassets.ModulePromptFile{
promptFS, err := dnd.ModulePromptFS("dnd.scenes", embeddedAssets, []sharedassets.ModulePromptFile{
{Name: "dnd.scenes.yaml", Path: "assets/prompts/dnd.scenes.yaml"},
{Name: "task.md", Path: "assets/prompts/task.md"},
{Name: "instructions.md", Path: "assets/prompts/instructions.md"},
}, sharedassets.SharedPromptFiles()...)
})
if err != nil {
return fmt.Errorf("prepare scene prompt assets: %w", err)
}
@@ -64,7 +65,7 @@ func scriptoriumPromptMetadata() (string, error) {
{FS: embeddedAssets, Path: "assets/prompts/dnd.scenes.yaml"},
{FS: embeddedAssets, Path: "assets/prompts/task.md"},
{FS: embeddedAssets, Path: "assets/prompts/instructions.md"},
}, append(sharedassets.CommonHashParts(), sharedassets.ReferenceHashParts()...)...)
}, append(dnd.CommonHashParts(), dnd.ReferenceHashParts()...)...)
scriptoriumPromptHash, scriptoriumPromptHashErr = llm.HashAssets(parts)
})
return scriptoriumPromptHash, scriptoriumPromptHashErr

View File

@@ -8,7 +8,6 @@ import (
"time"
"gitea.maximumdirect.net/eric/notarius/internal/framework/llm"
"gitea.maximumdirect.net/eric/notarius/internal/modules/sharedassets"
"gitea.maximumdirect.net/eric/scriptorium"
)
@@ -90,9 +89,6 @@ func TestScriptoriumPromptDiagnosticsOmitRawMaterials(t *testing.T) {
func prepareScenesPrompt(t *testing.T, transcript []byte, players string, party string, glossary string) *scriptorium.PreparedRun {
t.Helper()
registry := llm.NewAssetRegistry()
if err := sharedassets.Register(registry); err != nil {
t.Fatalf("register shared prompt assets: %v", err)
}
if err := RegisterPromptAssets(registry); err != nil {
t.Fatalf("register scene prompt assets: %v", err)
}