Make shared prompt filesystem composition generic
This commit is contained in:
@@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user