Documentation
¶
Index ¶
- func GlobalConfigPath() (string, error)
- func ProjectConfigPath(root string) string
- func ResolveAPIBase(cliProfile, cliAPIBase string) (string, string, string, error)
- func ResolveActiveGroup(flagVal string) (string, error)
- func SaveCoreRuntime(cfg *CoreRuntime) error
- func SaveProfiles(prof *Profiles) error
- func WriteActiveGroup(id string) error
- func WriteGlobal(g Global) error
- func WriteProjectConfig(root string, cfg Project) error
- type CoreRuntime
- type Global
- type Group
- type Profile
- type Profiles
- type Project
- type Repo
- type SnapshotConfig
- type TelemetryConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GlobalConfigPath ¶
func ProjectConfigPath ¶ added in v0.4.7
func ResolveAPIBase ¶
func ResolveActiveGroup ¶
Active group resolution uses: env COMPAIR_ACTIVE_GROUP -> flag --group -> ~/.compair/active_group The flag is expected to be provided by the caller. This function reads env and active_group file.
func SaveCoreRuntime ¶
func SaveCoreRuntime(cfg *CoreRuntime) error
func SaveProfiles ¶
func WriteActiveGroup ¶
func WriteGlobal ¶
func WriteProjectConfig ¶
Types ¶
type CoreRuntime ¶
type CoreRuntime struct {
Image string `yaml:"image"`
ContainerName string `yaml:"container_name"`
DataVolume string `yaml:"data_volume"`
Port int `yaml:"port"`
AuthMode string `yaml:"auth_mode"`
GenerationProvider string `yaml:"generation_provider"`
EmbeddingProvider string `yaml:"embedding_provider"`
OpenAIAPIKey string `yaml:"openai_api_key,omitempty"`
OpenAIModel string `yaml:"openai_model,omitempty"`
OpenAICodeModel string `yaml:"openai_code_model,omitempty"`
OpenAINotifModel string `yaml:"openai_notif_model,omitempty"`
OpenAIEmbedModel string `yaml:"openai_embed_model,omitempty"`
OpenAIBaseURL string `yaml:"openai_base_url,omitempty"`
NotificationScoringTimeoutS int `yaml:"notification_scoring_timeout_s,omitempty"`
NotificationScoringMaxRetries int `yaml:"notification_scoring_max_retries,omitempty"`
ReferenceTrace bool `yaml:"reference_trace,omitempty"`
ReferenceTraceMaxCandidates int `yaml:"reference_trace_max_candidates,omitempty"`
ReferenceSourceTrace bool `yaml:"reference_source_trace,omitempty"`
ReferenceSourceTraceMaxCandidates int `yaml:"reference_source_trace_max_candidates,omitempty"`
ReferenceHybrid bool `yaml:"reference_hybrid,omitempty"`
ReferenceAdjudicator bool `yaml:"reference_adjudicator,omitempty"`
ReferenceAdjudicatorTopK int `yaml:"reference_adjudicator_top_k,omitempty"`
ReferenceReranker bool `yaml:"reference_reranker,omitempty"`
ReferenceRerankerModelPath string `yaml:"reference_reranker_model_path,omitempty"`
GenerationEndpoint string `yaml:"generation_endpoint,omitempty"`
ExtraEnv map[string]string `yaml:"extra_env,omitempty"`
}
func LoadCoreRuntime ¶
func LoadCoreRuntime() (*CoreRuntime, error)
func (*CoreRuntime) APIBase ¶
func (c *CoreRuntime) APIBase() string
func (*CoreRuntime) ResolvedOpenAIAPIKey ¶
func (c *CoreRuntime) ResolvedOpenAIAPIKey() string
func (*CoreRuntime) ResolvedOpenAIBaseURL ¶ added in v0.3.13
func (c *CoreRuntime) ResolvedOpenAIBaseURL() string
func (*CoreRuntime) ResolvedOpenAICodeModel ¶ added in v0.3.13
func (c *CoreRuntime) ResolvedOpenAICodeModel() string
func (*CoreRuntime) ResolvedOpenAINotifModel ¶ added in v0.3.13
func (c *CoreRuntime) ResolvedOpenAINotifModel() string
func (*CoreRuntime) UsesOpenAI ¶
func (c *CoreRuntime) UsesOpenAI() bool
type Global ¶
type Global struct {
APIBase string `yaml:"api_base,omitempty"`
Defaults map[string]any `yaml:"defaults,omitempty"`
Telemetry TelemetryConfig `yaml:"telemetry,omitempty"`
}
Global config lives in ~/.compair/config.yaml
func ReadGlobal ¶
type Profile ¶
type Profile struct {
APIBase string `yaml:"api_base"`
Snapshot SnapshotConfig `yaml:"snapshot,omitempty"`
}
type Profiles ¶
type Profiles struct {
Default string `yaml:"default"`
Profiles map[string]Profile `yaml:"profiles"`
}
func LoadProfiles ¶
type Project ¶
type Project struct {
Version int `yaml:"version"`
ProjectName string `yaml:"project_name"`
Group Group `yaml:"group"`
Repos []Repo `yaml:"repos"`
}
func ReadProjectConfig ¶
type Repo ¶
type Repo struct {
Provider string `yaml:"provider"`
RemoteURL string `yaml:"remote_url"`
RepoID string `yaml:"repo_id"`
DefaultBranch string `yaml:"default_branch"`
LastSyncedCommit string `yaml:"last_synced_commit"`
DocumentID string `yaml:"document_id"`
Unpublished bool `yaml:"unpublished,omitempty"`
PendingTaskID string `yaml:"pending_task_id,omitempty"`
PendingTaskCommit string `yaml:"pending_task_commit,omitempty"`
PendingTaskInitialFeedback int `yaml:"pending_task_initial_feedback,omitempty"`
PendingTaskInitialFeedbackLatest string `yaml:"pending_task_initial_feedback_latest,omitempty"`
PendingTaskStartedAt string `yaml:"pending_task_started_at,omitempty"`
}
type SnapshotConfig ¶
type SnapshotConfig struct {
MaxTreeEntries int `yaml:"max_tree_entries,omitempty"`
MaxFiles int `yaml:"max_files,omitempty"`
MaxTotalBytes int `yaml:"max_total_bytes,omitempty"`
MaxFileBytes int `yaml:"max_file_bytes,omitempty"`
MaxFileRead int `yaml:"max_file_read,omitempty"`
IncludeGlobs []string `yaml:"include_globs,omitempty"`
ExcludeGlobs []string `yaml:"exclude_globs,omitempty"`
}
type TelemetryConfig ¶ added in v0.2.1
Click to show internal directories.
Click to hide internal directories.