Documentation
¶
Index ¶
- Constants
- func BuildSimple(repoPath, sha, agentName string) (string, error)
- func GetSystemPrompt(agentName string, promptType string) string
- type Builder
- func (b *Builder) Build(repoPath, gitRef string, repoID int64, contextCount int, ...) (string, error)
- func (b *Builder) BuildAddressPrompt(repoPath string, review *storage.Review, previousAttempts []storage.Response) (string, error)
- func (b *Builder) BuildDirty(repoPath, diff string, repoID int64, contextCount int, ...) (string, error)
- type ReviewContext
Constants ¶
const MaxPromptSize = 250 * 1024
MaxPromptSize is the maximum size of a prompt in bytes (250KB) If the prompt with diffs exceeds this, we fall back to just commit info
const PreviousAttemptsForCommitHeader = `` /* 355-byte string literal not displayed */
PreviousAttemptsForCommitHeader introduces previous review attempts for the same commit
const PreviousAttemptsHeader = `` /* 357-byte string literal not displayed */
PreviousAttemptsHeader introduces previous addressing attempts section
const PreviousReviewsHeader = `` /* 478-byte string literal not displayed */
PreviousReviewsHeader introduces the previous reviews section
const ProjectGuidelinesHeader = `` /* 202-byte string literal not displayed */
ProjectGuidelinesHeader introduces the project-specific guidelines section
const SystemPromptAddress = `` /* 1018-byte string literal not displayed */
SystemPromptAddress is the instruction for addressing review findings
const SystemPromptDirty = `` /* 789-byte string literal not displayed */
SystemPromptDirty is the base instruction for reviewing uncommitted (dirty) changes
const SystemPromptRange = `` /* 875-byte string literal not displayed */
SystemPromptRange is the base instruction for commit range reviews
const SystemPromptSecurity = `` /* 1541-byte string literal not displayed */
SystemPromptSecurity is the instruction for security-focused reviews
const SystemPromptSingle = `` /* 870-byte string literal not displayed */
SystemPromptSingle is the base instruction for single commit reviews
Variables ¶
This section is empty.
Functions ¶
func BuildSimple ¶
BuildSimple constructs a simpler prompt without database context
func GetSystemPrompt ¶ added in v0.17.0
GetSystemPrompt returns the system prompt for the specified agent and type. If a specific template exists for the agent, it uses that. Otherwise, it falls back to the default constant. Supported prompt types: review, range, dirty, address, run, security
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder constructs review prompts
func (*Builder) Build ¶
func (b *Builder) Build(repoPath, gitRef string, repoID int64, contextCount int, agentName, reviewType string) (string, error)
Build constructs a review prompt for a commit or range with context from previous reviews. reviewType selects the system prompt variant (e.g., "security"); empty or "general" uses the default.
func (*Builder) BuildAddressPrompt ¶
func (b *Builder) BuildAddressPrompt(repoPath string, review *storage.Review, previousAttempts []storage.Response) (string, error)
BuildAddressPrompt constructs a prompt for addressing review findings
func (*Builder) BuildDirty ¶
func (b *Builder) BuildDirty(repoPath, diff string, repoID int64, contextCount int, agentName, reviewType string) (string, error)
BuildDirty constructs a review prompt for uncommitted (dirty) changes. The diff is provided directly since it was captured at enqueue time. reviewType selects the system prompt variant (e.g., "security"); empty or "general" uses the default.