Make shared prompt filesystem composition generic

This commit is contained in:
2026-07-06 17:10:59 +00:00
parent 223f3751e8
commit 68b426cdb0
5 changed files with 112 additions and 42 deletions

View File

@@ -9,10 +9,28 @@ import (
//go:embed assets/prompts/*.md
var embeddedAssets embed.FS
var commonDNDPromptFiles = []string{
"common-dnd-system.md",
"common-dnd-transcript.md",
"common-dnd-references.md",
}
func Register(registry *llm.AssetRegistry) error {
return registry.RegisterPromptFS(embeddedAssets, "assets/prompts")
}
func SharedPromptFiles() []SharedPromptFile {
files := make([]SharedPromptFile, 0, len(commonDNDPromptFiles))
for _, name := range commonDNDPromptFiles {
files = append(files, SharedPromptFile{
Name: name,
FS: embeddedAssets,
Path: "assets/prompts/" + name,
})
}
return files
}
func CommonHashParts() []llm.AssetHashPart {
return []llm.AssetHashPart{
{FS: embeddedAssets, Path: "assets/prompts/common-dnd-system.md"},