suggest

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableGraderTypes

func AvailableGraderTypes() []string

AvailableGraderTypes returns supported grader kinds.

func BuildPrompt

func BuildPrompt(sk *skill.Skill, skillContent string) string

BuildPrompt builds a single-pass LLM prompt (no grader docs). Retained for backward compatibility and tests.

func GraderSummaries

func GraderSummaries() string

GraderSummaries returns a formatted block of one-line grader descriptions suitable for the selection prompt (pass 1).

func LoadGraderDocs

func LoadGraderDocs(fsys fs.FS, types []string) string

LoadGraderDocs loads the full documentation for the specified grader types from the embedded filesystem. Unknown types are silently skipped.

Types

type GeneratedFile

type GeneratedFile struct {
	Path    string `yaml:"path" json:"path"`
	Content string `yaml:"content" json:"content"`
}

GeneratedFile is a single generated artifact.

type Options

type Options struct {
	SkillPath  string
	TimeoutSec int
	GraderDocs fs.FS // embedded grader documentation (optional)
}

Options configures suggestion generation.

type Suggestion

type Suggestion struct {
	EvalYAML string          `yaml:"eval_yaml" json:"eval_yaml"`
	Tasks    []GeneratedFile `yaml:"tasks,omitempty" json:"tasks,omitempty"`
	Fixtures []GeneratedFile `yaml:"fixtures,omitempty" json:"fixtures,omitempty"`
}

Suggestion is the structured output returned by the LLM.

func Generate

func Generate(ctx context.Context, engine execution.AgentEngine, opts Options) (*Suggestion, error)

Generate runs the suggestion flow end-to-end. When opts.GraderDocs is set, uses a two-pass approach:

Pass 1: ask the LLM which grader types to use (lightweight)
Pass 2: provide detailed docs for those graders and generate eval YAML

When opts.GraderDocs is nil, falls back to a single-pass prompt.

func ParseResponse

func ParseResponse(raw string) (*Suggestion, error)

ParseResponse parses model YAML output into a Suggestion.

func (*Suggestion) WriteToDir

func (s *Suggestion) WriteToDir(outputDir string) ([]string, error)

WriteToDir writes suggested files to outputDir and returns written paths.

Jump to

Keyboard shortcuts

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