Documentation
¶
Index ¶
- func FormatIssuesForPrompt(issues []models.Issue, locale string) string
- func FormatTemplateForPrompt(template *models.IssueTemplate, lang string, templateType string) string
- func GetCommitPromptTemplate(lang string, hasTicket bool) string
- func GetIssuePromptTemplate(lang string) string
- func GetIssueReferenceInstructions(lang string) string
- func GetNoIssueReferenceInstruction(locale string) string
- func GetPRIssueContextInstructions(locale string) string
- func GetPRPromptTemplate(lang string) string
- func GetPRTemplateInstructions(lang string) string
- func GetReleaseNotesSectionHeaders(locale string) map[string]string
- func GetReleasePromptTemplate(lang string) string
- func GetTechnicalAnalysisInstruction(locale string) string
- func GetTemplateInstructions(lang string) string
- func RenderPrompt(name, tmplStr string, data interface{}) (string, error)
- type ConfirmationCallback
- type ConfirmationResult
- type CostAwareWrapper
- type GenerateFunc
- type PromptData
- type WrapperConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatIssuesForPrompt ¶
FormatIssuesForPrompt formats the issue list to be included in the prompt
func FormatTemplateForPrompt ¶
func FormatTemplateForPrompt(template *models.IssueTemplate, lang string, templateType string) string
FormatTemplateForPrompt formats a template for inclusion in an AI prompt. It handles both Issue and PR templates with proper language support.
func GetCommitPromptTemplate ¶
GetCommitPromptTemplate returns the commit template based on language and whether there is a ticket
func GetIssuePromptTemplate ¶
GetIssuePromptTemplate returns the appropriate issue generation template based on language
func GetIssueReferenceInstructions ¶
GetIssueReferenceInstructions returns issue reference instructions based on the language
func GetPRIssueContextInstructions ¶
GetPRIssueContextInstructions returns issue context instructions for PRs
func GetPRPromptTemplate ¶
GetPRPromptTemplate returns the appropriate template based on the language
func GetPRTemplateInstructions ¶
GetPRTemplateInstructions returns PR template instructions based on the language
func GetReleasePromptTemplate ¶
GetReleasePromptTemplate returns the release template based on the language
func GetTemplateInstructions ¶
GetTemplateInstructions returns template instructions based on the language
func RenderPrompt ¶
RenderPrompt renders a prompt template with the provided data
Types ¶
type ConfirmationCallback ¶
type ConfirmationCallback func(result ConfirmationResult) (choice string, proceed bool)
type ConfirmationResult ¶
type CostAwareWrapper ¶
type CostAwareWrapper struct {
// contains filtered or unexported fields
}
func NewCostAwareWrapper ¶
func NewCostAwareWrapper(cfg WrapperConfig) (*CostAwareWrapper, error)
NewCostAwareWrapper creates a provider-agnostic wrapper
func (*CostAwareWrapper) SetSkipConfirmation ¶
func (w *CostAwareWrapper) SetSkipConfirmation(skip bool)
SetSkipConfirmation allows enabling or disabling manual user confirmation.
func (*CostAwareWrapper) WrapGenerate ¶
func (w *CostAwareWrapper) WrapGenerate( ctx context.Context, command string, prompt string, generateFn GenerateFunc, ) (interface{}, *models.TokenUsage, error)
WrapGenerate wraps any generation function with tracking
type GenerateFunc ¶
type PromptData ¶
type PromptData struct {
Count int
Files string
Diff string
Ticket string
History string
Instructions string
IssueNumber int
RelatedIssues string
IssueInfo string
RepoOwner string
RepoName string
PreviousVersion string
CurrentVersion string
LatestVersion string
ReleaseDate string
Changelog string
PRContent string
TechnicalInfo string
}
PromptData holds the parameters for template rendering
type WrapperConfig ¶
type WrapperConfig struct {
Provider ports.CostAwareAIProvider
BudgetDaily float64
EstimatedOutputTokens int
SkipConfirmation bool
OnConfirmation ConfirmationCallback
}