Documentation
¶
Index ¶
- func GlobalConfigPath() (string, error)
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GlobalConfigPath ¶
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"`
OpenAIEmbedModel string `yaml:"openai_embed_model,omitempty"`
GenerationEndpoint string `yaml:"generation_endpoint,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) UsesOpenAI ¶
func (c *CoreRuntime) UsesOpenAI() bool
type Global ¶
type Global struct {
APIBase string `yaml:"api_base,omitempty"`
Defaults map[string]any `yaml:"defaults,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"`
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"`
}
Click to show internal directories.
Click to hide internal directories.