hints

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 6 Imported by: 0

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

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

func FormatCallHint(id tools.Ident, payload any) string

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

func FormatResultHint(id tools.Ident, result any) string

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

func RegisterCallHint(id tools.Ident, tmpl *template.Template)

RegisterCallHint registers a compiled template for a tool call hint.

func RegisterCallHints

func RegisterCallHints(m map[tools.Ident]*template.Template)

RegisterCallHints registers multiple call hint templates.

func RegisterResultHint

func RegisterResultHint(id tools.Ident, tmpl *template.Template)

RegisterResultHint registers a compiled template for a tool result hint.

func RegisterResultHints

func RegisterResultHints(m map[tools.Ident]*template.Template)

RegisterResultHints registers multiple result hint templates.

Types

This section is empty.

Jump to

Keyboard shortcuts

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