Layered prompt rendering from embedded templates (#55)
CI / ci (push) Successful in 1m33s

Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
This commit was merged in pull request #55.
This commit is contained in:
2026-10-05 08:15:35 -04:00
committed by approver_agent
parent 55c15b1b3a
commit 942ac42b86
15 changed files with 695 additions and 20 deletions
+8 -4
View File
@@ -9,9 +9,13 @@ import (
)
// echoSkill is the trivial test skill: it asks the model to repeat a word.
// Its prompt is prompts/echo.v1.tmpl.
type echoSkill struct{}
type echoInput struct{ Word string }
type echoInput struct {
Word string
Context []ContextSection
}
type echoOutput struct {
Echo string `json:"echo"`
@@ -23,11 +27,11 @@ func (echoSkill) Name() string { return "echo" }
func (echoSkill) Version() int { return 1 }
func (echoSkill) Render(in echoInput) (Prompt, error) {
func (echoSkill) PromptInput(in echoInput) (PromptInput, error) {
if in.Word == "" {
return Prompt{}, errors.New("no word to echo")
return PromptInput{}, errors.New("no word to echo")
}
return Prompt{System: "You repeat words.", User: "Repeat: " + in.Word}, nil
return PromptInput{Data: in, Context: in.Context}, nil
}
func (echoSkill) Schema() llm.JSONSchema {