summaryrefslogtreecommitdiff
path: root/prompts/embedded.go
blob: e967029fdff37f3f6056fe4ea67cbac5c5bc6bca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package prompts

import (
	"embed"
	"path/filepath"
	"strings"
)

// embeddedTemplates stores the built-in prompt templates shipped with the binary.
//
//go:embed *.md
var embeddedTemplates embed.FS

// Read returns the embedded prompt template named by name.
func Read(name string) ([]byte, error) {
	return embeddedTemplates.ReadFile(filepath.Base(strings.TrimSpace(name)))
}