config

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxDiffBytes = 10240

DefaultMaxDiffBytes is the default maximum diff size (10 KB) allowed in the prompt before omitting the diff.

Variables

This section is empty.

Functions

func ResolveGuidelinesContent

func ResolveGuidelinesContent(guidelinesPath string) (string, error)

ResolveGuidelinesContent fetches the content of a guideline, either from a file or the library.

Types

type Config

type Config struct {
	Base                         string         `mapstructure:"base"`
	Head                         string         `mapstructure:"head"`
	Model                        string         `mapstructure:"model"`
	Provider                     string         `mapstructure:"provider"`
	ProviderAPIKey               string         `mapstructure:"provider-api-key"`
	ProviderURL                  string         `mapstructure:"provider-url"`
	WorkingDir                   string         `mapstructure:"-"`
	MainGuidelines               string         `mapstructure:"main-guidelines"`
	SupplementalGuidelines       []string       `mapstructure:"supplemental-guidelines"`
	MaxTokens                    int            `mapstructure:"max-tokens"`
	MaxDiffBytes                 int            `mapstructure:"max-diff-bytes"`
	ReviewOutputFile             string         `mapstructure:"review-output-file"`
	OutputJSONFile               string         `mapstructure:"output-json"`
	MetricsJSONFile              string         `mapstructure:"metrics-json"`
	ExtractionModel              string         `mapstructure:"extraction-model"`
	MetadataJSONFile             string         `mapstructure:"metadata-json"`
	ApprovalEvaluationPromptFile string         `mapstructure:"approval-evaluation-prompt-file"`
	PreReviewPromptFile          string         `mapstructure:"pre-review-prompt"`
	PreReviewModel               string         `mapstructure:"pre-review-model"`
	DiffFile                     string         `mapstructure:"diff-file"`
	FilesListFile                string         `mapstructure:"files-list-file"`
	CommitsFile                  string         `mapstructure:"commits-file"`
	MCPConfigFile                string         `mapstructure:"mcp-config"`
	AllowURLFetch                bool           `mapstructure:"allow-url-fetch"`
	AllowAskDeveloper            bool           `mapstructure:"allow-ask-developer"`
	IgnoredLockFiles             []string       `mapstructure:"ignored-lock-files"`
	ConfigFile                   string         `mapstructure:"config"`
	WishlistDir                  string         `mapstructure:"wishlist-dir"`
	ProviderOptionsFile          string         `mapstructure:"provider-options-file"`
	ProviderOptions              map[string]any `mapstructure:"-"`
	Render                       string         `mapstructure:"render"`
	InteractivePostReview        bool           `mapstructure:"interactive-post-review"`
	WaitForMessage               bool           `mapstructure:"-"`
	CassandraConfigFolder        string         `mapstructure:"cassandra-config-folder"`
}

Config represents the complete configuration for a Cassandra reviewer.

func Load

func Load(configFile string) (*Config, error)

Load reads the configuration from a TOML file. It does NOT handle CLI flags or environment variables; the caller should bind those if needed before calling Unmarshal.

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a Config with default values populated.

func (*Config) LoadProviderOptions

func (cfg *Config) LoadProviderOptions() error

LoadProviderOptions loads provider options from the configured ProviderOptionsFile.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL