Files
notarius/internal/modules/dnd/shared/assets.go

48 lines
1.2 KiB
Go
Raw Normal View History

2026-07-17 05:05:48 +00:00
package shared
2026-07-06 01:17:13 +00:00
import (
"embed"
"io/fs"
2026-07-06 01:17:13 +00:00
"gitea.maximumdirect.net/eric/notarius/internal/framework/llm"
2026-07-17 05:05:48 +00:00
"gitea.maximumdirect.net/eric/notarius/internal/framework/promptfs"
2026-07-06 01:17:13 +00:00
)
//go:embed assets/prompts/*.md
var embeddedAssets embed.FS
var sharedPromptFiles = []string{
"common-dnd-system.md",
"common-dnd-transcript.md",
"common-dnd-references.md",
}
2026-07-17 05:05:48 +00:00
func SharedPromptFiles() []promptfs.SharedPromptFile {
files := make([]promptfs.SharedPromptFile, 0, len(sharedPromptFiles))
for _, name := range sharedPromptFiles {
2026-07-17 05:05:48 +00:00
files = append(files, promptfs.SharedPromptFile{
Name: name,
FS: embeddedAssets,
Path: "assets/prompts/" + name,
})
}
return files
}
2026-07-06 01:17:13 +00:00
func CommonHashParts() []llm.AssetHashPart {
return []llm.AssetHashPart{
{FS: embeddedAssets, Path: "assets/prompts/common-dnd-system.md"},
{FS: embeddedAssets, Path: "assets/prompts/common-dnd-transcript.md"},
}
}
func ReferenceHashParts() []llm.AssetHashPart {
return []llm.AssetHashPart{
{FS: embeddedAssets, Path: "assets/prompts/common-dnd-references.md"},
}
}
2026-07-17 05:05:48 +00:00
func ModulePromptFS(moduleDir string, moduleFS fs.FS, files []promptfs.ModulePromptFile) (fs.FS, error) {
return promptfs.ModulePromptFS(moduleDir, moduleFS, files, SharedPromptFiles()...)
}