template

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTemplate, _ = Parse("{{ .Prompt }}")

Functions

func Identifiers added in v0.2.6

func Identifiers(n parse.Node) []string

Identifiers walks the node tree returning any identifiers it finds along the way

func Named

func Named(s string) (*named, error)

Types

type Template

type Template struct {
	*template.Template
	// contains filtered or unexported fields
}

func Parse

func Parse(s string) (*Template, error)

func (*Template) Execute added in v0.2.2

func (t *Template) Execute(w io.Writer, v Values) error

func (*Template) String

func (t *Template) String() string

func (*Template) Subtree added in v0.2.6

func (t *Template) Subtree(fn func(parse.Node) bool) *template.Template

func (*Template) Vars

func (t *Template) Vars() []string

type Values added in v0.2.2

type Values struct {
	Messages []api.Message
	api.Tools
	Prompt string
	Suffix string
	Think  bool
	// whether or not the user explicitly set the thinking flag (vs. it being
	// implicitly false). Templates can't see whether `Think` is nil
	IsThinkSet bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL