Documentation
¶
Overview ¶
Package hints provides lightweight, template-based rendering helpers for tool call/result hints. It exposes a global registry usable by sinks without requiring a runtime instance.
Index ¶
- func CompileHintTemplates(raw map[tools.Ident]string, extra template.FuncMap) (map[tools.Ident]*template.Template, error)
- func FormatCallHint(id tools.Ident, payload any) string
- func FormatResultHint(id tools.Ident, result any) string
- func RegisterCallHint(id tools.Ident, tmpl *template.Template)
- func RegisterCallHints(m map[tools.Ident]*template.Template)
- func RegisterResultHint(id tools.Ident, tmpl *template.Template)
- func RegisterResultHints(m map[tools.Ident]*template.Template)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileHintTemplates ¶
func CompileHintTemplates(raw map[tools.Ident]string, extra template.FuncMap) (map[tools.Ident]*template.Template, error)
CompileHintTemplates compiles text templates with a conservative default setup. Missing keys are ignored so authors can write templates that adapt to optional fields using if/with blocks without runtime errors.
func FormatCallHint ¶
FormatCallHint renders the call hint for the given tool and payload. Returns an empty string when no template is registered or rendering fails.
func FormatResultHint ¶
FormatResultHint renders the result hint for the given tool and result. Returns an empty string when no template is registered or rendering fails.
func RegisterCallHint ¶
RegisterCallHint registers a compiled template for a tool call hint.
func RegisterCallHints ¶
RegisterCallHints registers multiple call hint templates.
func RegisterResultHint ¶
RegisterResultHint registers a compiled template for a tool result hint.
Types ¶
This section is empty.