Documentation
¶
Overview ¶
Package ai provides the AI service layer for content drafting. Every method returns nil when AI is unconfigured.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PRDescriptionPrompt ¶
PRDescriptionPrompt generates a prompt for drafting a PR description.
func PRStackPrompt ¶
PRStackPrompt generates a prompt for proposing a PR stack plan.
Types ¶
type ReviewResult ¶
type ReviewResult struct {
Action string // "accept", "edit", "skip"
Content string // the final content (after edit if applicable)
}
ReviewResult represents the outcome of the accept/edit/skip flow.
func PresentDraft ¶
func PresentDraft(sectionName, draft, editor string) (*ReviewResult, error)
PresentDraft presents an AI draft to the user for accept/edit/skip. This is the standard interaction model for all AI-generated content.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service wraps an AIAdapter with null-safe semantics. Every method returns empty/nil when the adapter is nil or unconfigured.
func NewService ¶
NewService creates an AI service. If adapter is nil or disabled, all methods return nil — callers always handle the nil case.
func (*Service) Draft ¶
Draft sends a prompt with context and returns the completion. Returns ("", nil) when AI is unavailable.
func (*Service) IsAvailable ¶
IsAvailable returns true if the AI service is configured and enabled.