prompt

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prompt

type Prompt struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	Template    string   `json:"template"`
	Variables   []string `json:"variables,omitempty"` // Expected template variables

	// Runtime fields (not serialized)
	Scope      string `json:"-"` // "local" or "global" - where this prompt came from
	SourcePath string `json:"-"` // Path to the source file
}

Prompt represents a reusable prompt template

func Load

func Load(path string) (*Prompt, error)

Load loads a prompt from a JSON file

func LoadAll

func LoadAll(dir string) ([]*Prompt, error)

LoadAll loads all prompts from a directory

func (*Prompt) Render

func (p *Prompt) Render(vars map[string]string) string

Render renders a prompt template with the given variables

Jump to

Keyboard shortcuts

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