Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Permutator ¶
type Permutator struct { Template *template.Template Data dict.DataPermutator }
Permutator generates unique permutations of golang text/templates by mutating the variables in the template using list from a dictionary of values for each variable. The dictionary is loaded from json files. See the data folder for examples.
It can be used to batch generate a number of variable prompts for an LLM like stable-diffusion or chat-gpt
func NewPermutator ¶
func NewPermutator(tplPathGlob string, dataPathGlob string) (*Permutator, error)
NewPermutator creates a new Permutator tplPathGlob is a glob pattern for the template files dataPathGlob is a glob pattern for the data files The data files are expected to be in json format, and the template files are expected to be in go template format
func (*Permutator) ForeachTemplateGen ¶
func (p *Permutator) ForeachTemplateGen(n int) []string
ForeachTemplateGen generates a number of permutations for each template in the template set