(workflow) add simple harness workflow for manual testing
This commit is contained in:
+26
-1
@@ -1,3 +1,28 @@
|
||||
package prompts
|
||||
|
||||
// Empty stub - will be filled in T0.5
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
//go:embed planner/default.tmpl judge/default.tmpl implementer/default.tmpl
|
||||
var templates embed.FS
|
||||
|
||||
// Render renders a template with the given variables.
|
||||
func Render(templateRef string, variables map[string]any) (string, error) {
|
||||
// Load template from embedded files
|
||||
tmpl, err := template.ParseFS(templates, templateRef)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to parse template %s: %w", templateRef, err)
|
||||
}
|
||||
|
||||
// Render the template
|
||||
var result strings.Builder
|
||||
if err := tmpl.Execute(&result, variables); err != nil {
|
||||
return "", fmt.Errorf("failed to render template %s: %w", templateRef, err)
|
||||
}
|
||||
|
||||
return result.String(), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user