48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package dnd
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
|
|
"gitea.maximumdirect.net/eric/notarius/internal/framework/llm"
|
|
"gitea.maximumdirect.net/eric/notarius/internal/modules/sharedassets"
|
|
)
|
|
|
|
//go:embed assets/prompts/*.md
|
|
var embeddedAssets embed.FS
|
|
|
|
var sharedPromptFiles = []string{
|
|
"common-dnd-system.md",
|
|
"common-dnd-transcript.md",
|
|
"common-dnd-references.md",
|
|
}
|
|
|
|
func SharedPromptFiles() []sharedassets.SharedPromptFile {
|
|
files := make([]sharedassets.SharedPromptFile, 0, len(sharedPromptFiles))
|
|
for _, name := range sharedPromptFiles {
|
|
files = append(files, sharedassets.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"},
|
|
{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"},
|
|
}
|
|
}
|
|
|
|
func ModulePromptFS(moduleDir string, moduleFS fs.FS, files []sharedassets.ModulePromptFile) (fs.FS, error) {
|
|
return sharedassets.ModulePromptFS(moduleDir, moduleFS, files, SharedPromptFiles()...)
|
|
}
|