Documentation
¶
Overview ¶
Package prompt parses .prompt templates.
A .prompt file is YAML frontmatter followed by freeform text:
---
name: Customer Support Classifier
version: 2.1.0
models:
- gpt-4o-mini
variables:
- user_query
---
You are an expert customer support agent.
Analyze the user query: {{ user_query }}
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMalformedFrontmatter = errors.New("malformed frontmatter: missing closing `---`")
ErrMalformedFrontmatter is returned when the frontmatter block is not terminated.
View Source
var ErrNoFrontmatter = errors.New("no frontmatter found (expected a leading `---` block)")
ErrNoFrontmatter is returned when a file has no `---` delimiter.
Functions ¶
Types ¶
type Template ¶
type Template struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Models []string `yaml:"models"`
Variables []string `yaml:"variables"`
Body string `yaml:"-"`
RawVariable string `yaml:"variableSet"` // any additional user keys are ignored
}
Template is a parsed .prompt file.
Click to show internal directories.
Click to hide internal directories.