Documentation
¶
Index ¶
- Constants
- Variables
- func GetConfig() *op.Config
- func GetHostName() string
- func GetIps() []string
- func GetModelConfig(modelKey string) (*op.ModelConfig, error)
- func GetSecrets() map[string]string
- func GetSystem() *op.SystemConfig
- func GetUserConfig() *op.UserConfig
- func GetUserProfile() *op.UserProfile
- func LoadLocalUserProfile() (*op.UserProfile, error)
- func NormalizeServiceTier(value string) string
- func Parse(configDir string) error
- func ReloadLocalUserConfig() (*op.UserProfile, error)
- func SetSecrets(values map[string]string)
- func SetSystem(c *op.SystemConfig)
- func SetUserProfile(c *op.UserProfile)
- func StartUserConfigWatcher(ctx context.Context, onReload func(changedPath string)) error
- func SyncModelCache(models []op.ModelConfig)
- type HostInfoConfig
Constants ¶
View Source
const ( DefaultBaseDir = "~/.openbrain" // System config supports JSONC: ~/.openbrain/configs/config.json // DefaultConfigDir = "~/.openbrain/configs/config.json" // DefaultAgentsDir = "~/.openbrain/agents" // DefaultLogDir = "~/.openbrain/logs/opagent-runtime" DefaultDebug = false DefaultEnv = op.EnvLocal DefaultCloudOSBaseURL = "http://127.0.0.1:8080" DefaultMessageStorage = "markdown" DefaultRuntimeUpdateManifestURL = "https://github.com/colinagent/openbrain/releases/latest/download/runtime-manifest.json" DefaultRuntimeUpdateCheckInterval = "10m" DefaultRuntimeUpdateCheckTimeout = "8s" DefaultRuntimeUpdateIdleGracePeriod = "15s" DefaultRuntimeUpdateDownloadDir = "run/runtime-update" DefaultMaxThreads = 10000 )
Variables ¶
View Source
var ( // command line flags CmdBaseDir = "" CmdDebug = false CmdEnv = op.EnvLocal CmdCloudOSBaseURL = "" )
Functions ¶
func GetHostName ¶
func GetHostName() string
func GetModelConfig ¶
func GetModelConfig(modelKey string) (*op.ModelConfig, error)
func GetSecrets ¶
func GetSystem ¶
func GetSystem() *op.SystemConfig
func GetUserConfig ¶
func GetUserConfig() *op.UserConfig
func GetUserProfile ¶
func GetUserProfile() *op.UserProfile
func LoadLocalUserProfile ¶
func LoadLocalUserProfile() (*op.UserProfile, error)
func NormalizeServiceTier ¶
func ReloadLocalUserConfig ¶
func ReloadLocalUserConfig() (*op.UserProfile, error)
func SetSecrets ¶
func SetSystem ¶
func SetSystem(c *op.SystemConfig)
func SetUserProfile ¶
func SetUserProfile(c *op.UserProfile)
func StartUserConfigWatcher ¶
StartUserConfigWatcher watches baseDir/configs/user and hot-reloads local user config files.
func SyncModelCache ¶
func SyncModelCache(models []op.ModelConfig)
Types ¶
type HostInfoConfig ¶
func GetHostInfo ¶
func GetHostInfo(sysDir string) *HostInfoConfig
GetHostInfo returns host info using sysDir for host_id persistence. Use this when building system config before SetSystem has been called.
Click to show internal directories.
Click to hide internal directories.