Documentation
¶
Overview ¶
Package prompts provides LLM prompt templates for git-courer operations. Each operation has its own focused prompt — no generic one-size-fits-all. Templates are loaded from .txt files in the txt/ directory.
Index ¶
- Constants
- func Get(op string) string
- func GetAll() map[string]string
- func GetCommitMessage() string
- func GetDecideCommit() string
- func GetWithFallback(op string) string
- func HasTemplate(op string) bool
- func Render(tmpl string, data interface{}) (string, error)
- func RenderOp(op string, params interface{}) (string, error)
- func RenderWithData(tmpl string, data interface{}) (string, error)
- func TemplateFor(op string) string
- type DecideParams
- type InterpretParams
- type MessageParams
- type OpParams
Constants ¶
const FallbackBranchCreate = `` /* 181-byte string literal not displayed */
const FallbackDecideCommit = `` /* 168-byte string literal not displayed */
const FallbackGenerateMessage = `` /* 250-byte string literal not displayed */
const InterpretGitOp = `` /* 344-byte string literal not displayed */
InterpretGitOp is a generic template that wraps operation-specific prompts. It takes the operation name and delegates to the specific template.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns the prompt template for the given operation. Falls back to a minimal generic prompt for unknown operations.
func GetCommitMessage ¶
func GetCommitMessage() string
GetCommitMessage returns the commit message template
func GetDecideCommit ¶
func GetDecideCommit() string
GetDecideCommit returns the decide commit template
func GetWithFallback ¶
GetWithFallback returns the template, falling back to embedded if file loading fails
func HasTemplate ¶
HasTemplate checks if a template exists for the given operation
func RenderWithData ¶
Render renders a template string with the given data. Kept for backward compatibility.
func TemplateFor ¶
TemplateFor returns the prompt template for the given operation. Kept for backward compatibility.
Types ¶
type DecideParams ¶
type DecideParams struct {
Instruction string
CurrentBranch string
GitStatus string
Untracked string
Modified string
Deleted string
}
DecideParams for deciding what to commit
func BuildDecideParams ¶
func BuildDecideParams(instruction, gitStatus, untracked, modified, deleted string) DecideParams
BuildDecideParams creates DecideParams
type InterpretParams ¶
type InterpretParams struct {
Operation string
Instruction string
Context string
OperationPrompt string
}
InterpretParams holds parameters for the generic interpreter
func BuildInterpretParams ¶
func BuildInterpretParams(op, instruction string, ctx map[string]string) InterpretParams
BuildInterpretParams creates InterpretParams for a given operation
type MessageParams ¶
MessageParams for commit message generation
func BuildMessageParams ¶
func BuildMessageParams(files []string, diff string) MessageParams
BuildMessageParams creates MessageParams for commit message
func BuildMessageParamsWithRetry ¶
func BuildMessageParamsWithRetry(files []string, diff, rejected string) MessageParams
BuildMessageParamsWithRetry creates MessageParams with rejection context