Documentation
¶
Index ¶
- Constants
- Variables
- func ClearModelProvider(baseURL string) error
- func ConfigExists() bool
- func CreateConfig(providerNames []string, keys map[string]string, baseUrls map[string]string, ...) error
- func CustomizationPath() (string, error)
- func DBPath() string
- func DefaultCodexModels() []string
- func DeleteAuthVal(provider string) error
- func Dir() string
- func GetAuthPath() (string, error)
- func GetModels() ([]ResModel, []RecentModels, error)
- func GetTheme() string
- func HasAnyApiKey() bool
- func HasAnyAuthModel() bool
- func ImportCodexAuth() error
- func ImportCodexAuthFromPath(path string) error
- func IsReasoningEffort(effort string) bool
- func ReconcileAuthProviderModels(baseURL string, models []string) error
- func SetApiKey(m ResModel, apikey string) error
- func SetCurrentModel(model ResModel) error
- func SetReasoningEffort(effort string) error
- func SetTheme(theme string) error
- func SkillsPath() string
- func SupportsReasoningEffort(model ResModel) bool
- func UpdateAuthVal(provider string, newVal AuthVal) error
- func ValidateProviderKey(providerName, apiKey string) error
- type AllModels
- type AuthJson
- type AuthVal
- type Customization
- type Provider
- type RecentModels
- type ResModel
Constants ¶
const ( CodexAuthProvider = "codex" CopilotAuthProvider = "copilot" )
Variables ¶
var Debug = false
Functions ¶
func ClearModelProvider ¶ added in v0.2.0
func ConfigExists ¶ added in v0.2.0
func ConfigExists() bool
func CreateConfig ¶ added in v0.2.0
func CreateConfig(providerNames []string, keys map[string]string, baseUrls map[string]string, models map[string][]string) error
CreateConfig writes a fresh config.json containing only the chosen providers, filling in any API keys collected during onboarding. This is the only place that materializes config.json reads no longer create it.
func CustomizationPath ¶
CustomizationPath returns the config.json path. It no longer creates the file — onboarding owns creation (see CreateConfig).
func DefaultCodexModels ¶ added in v0.2.0
func DefaultCodexModels() []string
func DeleteAuthVal ¶ added in v0.2.0
func GetAuthPath ¶ added in v0.2.0
func GetModels ¶
func GetModels() ([]ResModel, []RecentModels, error)
func HasAnyApiKey ¶ added in v0.2.0
func HasAnyApiKey() bool
func HasAnyAuthModel ¶ added in v0.2.0
func HasAnyAuthModel() bool
func ImportCodexAuth ¶ added in v0.2.0
func ImportCodexAuth() error
func ImportCodexAuthFromPath ¶ added in v0.2.0
func IsReasoningEffort ¶ added in v0.2.0
func ReconcileAuthProviderModels ¶ added in v0.2.0
func SetCurrentModel ¶
func SetReasoningEffort ¶ added in v0.2.0
func SkillsPath ¶
func SkillsPath() string
func SupportsReasoningEffort ¶ added in v0.2.0
func UpdateAuthVal ¶ added in v0.2.0
func ValidateProviderKey ¶ added in v0.2.0
ValidateProviderKey makes a minimal chat-completion request (max_tokens: 1) to the given provider to confirm the API key is accepted. It returns nil if the request succeeds. A short timeout keeps onboarding responsive.
Types ¶
type AllModels ¶ added in v0.1.8
type AllModels struct {
Models []ResModel
RecentModels []RecentModels
}
type AuthVal ¶ added in v0.2.0
type AuthVal struct {
Type string `json:"type"`
Access string `json:"access_token"`
Refresh string `json:"refresh_token"`
Expires int64 `json:"expires"`
AccountId string `json:"account_id"`
Models []string `json:"models"`
}
func GetAuthVal ¶ added in v0.2.0
func ReadCodexAuth ¶ added in v0.2.0
type Customization ¶
type Customization struct {
SkillsPath string `json:"skills_path"`
Port string `json:"port"`
Theme string `json:"theme"`
Providers []Provider `json:"providers"`
CurrentModel ResModel `json:"current_model"`
RecentModels []RecentModels `json:"recent_models"`
}
```bash OPENAI_API_KEY=sk-... OPENAI_BASE_URL=https://... SKILL_PATH=path/to/skill/folder API_URL=http://localhost:8080 ```
func GetCustomization ¶
func GetCustomization() Customization
type Provider ¶
type Provider struct {
BaseUrl string `json:"base_url"`
ApiKey string `json:"api_key"`
Models []string `json:"models"`
}
func AllProviders ¶ added in v0.2.0
func AllProviders() []Provider
Providers displayed in onboarding
func ProviderByName ¶ added in v0.2.0
type RecentModels ¶ added in v0.1.8
type RecentModels struct {
Model string `json:"model"`
ApiKey string `json:"api_key"`
BaseUrl string `json:"base_url"`
ReasoningEffort string `json:"reasoning_effort,omitempty"`
LastUsed int64 `json:"last_used"`
}
func GetRecentModels ¶ added in v0.1.8
func GetRecentModels() []RecentModels
type ResModel ¶
type ResModel struct {
Model string `json:"model"`
ApiKey string `json:"api_key"`
BaseUrl string `json:"base_url"`
ReasoningEffort string `json:"reasoning_effort,omitempty"`
}