Documentation
¶
Overview ¶
Package prompt builds LLM prompts from git history.
The default review system prompt is embedded from templates/review_system.tmpl (byte-identical to the historical hardcoded string). Custom user templates (text/template) can override it via BuildReviewWithTemplate (Item 3). The template requires the model to end with a fenced `risk` JSON block (§7.1), parsed back in internal/llm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildReview ¶
BuildReview renders the system and user messages for a review. The user message carries the commit metadata (subjects, authors, bodies, file lists) followed by the full unified diff in a fenced block. It uses the embedded default system prompt (equivalent to BuildReviewWithTemplate(r, "")).
func BuildReviewWithTemplate ¶ added in v0.2.1
BuildReviewWithTemplate renders the system prompt from a custom template file. If systemTemplateFile is empty, the embedded default is used (identical to BuildReview). Otherwise the file is parsed as a text/template and executed with the Review as data (fields Range, Commits, Diff). The user message is built identically in both cases.