templates

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package templates holds ready-made agents (summarizer, tagger, moderator, translator). A template renders an agent definition from a few parameters; the definition is then reviewed and saved like any agent.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknown = fmt.Errorf("unknown template")

ErrUnknown is returned for an unknown template.

Functions

func Render

func Render(id string, params map[string]any) (map[string]any, error)

Render builds an agent definition (the body of POST /admin/agents) from a template and parameters. Errors are about the parameters.

Types

type Param

type Param struct {
	Key   string `json:"key"`
	Label string `json:"label"`
	// Type: collection, field (an attribute of the collection param),
	// fields (several), text, number or bool.
	Type     string   `json:"type"`
	Required bool     `json:"required"`
	Default  any      `json:"default,omitempty"`
	Help     string   `json:"help,omitempty"`
	Types    []string `json:"types,omitempty"` // field/fields: allowed attribute types
	// Localized (field/fields): only localized attributes.
	Localized bool `json:"localized,omitempty"`
}

Param is one input of a template.

type Template

type Template struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Params      []Param `json:"params"`
	// contains filtered or unexported fields
}

Template is a ready-made agent.

func List

func List() []Template

List returns the templates.

Jump to

Keyboard shortcuts

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