Documentation
¶
Overview ¶
Package review_code implements the AI-powered code review tool.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrVertexAIMissingConfig indicates that Vertex AI is enabled but project/location configuration is missing. ErrVertexAIMissingConfig = fmt.Errorf("vertex AI enabled but missing configuration") // ErrAuthFailed indicates that no valid authentication credentials were found. ErrAuthFailed = fmt.Errorf("authentication failed") )
Functions ¶
Types ¶
type ContentGenerator ¶
type ContentGenerator interface {
GenerateContent(ctx context.Context, model string, contents []*genai.Content,
config *genai.GenerateContentConfig) (*genai.GenerateContentResponse, error)
}
ContentGenerator abstracts the generative model for testing.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler holds the dependencies for the review code tool.
func NewHandler ¶
NewHandler creates a new Handler.
type Option ¶
type Option func(*Handler)
Option is a function that configures a Handler.
func WithGenerator ¶
func WithGenerator(generator ContentGenerator) Option
WithGenerator sets the ContentGenerator for the Handler.
type Params ¶
type Params struct {
FileContent string `json:"file_content"`
ModelName string `json:"model_name,omitempty"`
Hint string `json:"hint,omitempty"`
}
Params defines the input parameters for the code_review tool.
type RealGenerator ¶
type RealGenerator struct {
// contains filtered or unexported fields
}
RealGenerator wraps the actual GenAI client.
func (*RealGenerator) GenerateContent ¶
func (r *RealGenerator) GenerateContent(ctx context.Context, model string, contents []*genai.Content, config *genai.GenerateContentConfig) (*genai.GenerateContentResponse, error)
GenerateContent generates content using the underlying GenAI client.
type Result ¶
type Result struct {
Suggestions []Suggestion `json:"suggestions"`
}
Result defines the structured output for the code_review tool.
Click to show internal directories.
Click to hide internal directories.