Documentation
¶
Index ¶
- Constants
- func AllDigits(s string) bool
- func AppendOrUpdateProvider(r *Root, p Provider)
- func ApplyOAuthTokens(p *Provider, t codex.TokenSet)
- func ApplyOnboardMerge(dst *Root, res *OnboardResult)
- func BackupConfig() (string, error)
- func ClampTimeoutMinutes(n int) error
- func ConfigExists() (bool, error)
- func ConfirmOnboardRerun(stdin io.Reader, out io.Writer) (bool, error)
- func EffectiveCompactionThresholdTokens(r *Root) int64
- func EffectiveSkillSearchMinNorm(r *Root) float64
- func EnsureChatGPTSubBaseURL(p *Provider)
- func ModelPassesChatGPTSubFilter(modelID string) bool
- func NeedsOnboard(r *Root) bool
- func NormalizeAPIBase(raw string) (string, error)
- func NoteRecentModelUse(r *Root, providerName, modelID string)
- func ParseReasoningEffortToken(s string) (string, error)
- func PickModelInteractive(stdin io.Reader, out io.Writer, p *Provider, providerLabel string, ...) (string, error)
- func PrintConfigSkipHint(out io.Writer, topic string)
- func ProviderCredentialsReady(p *Provider) bool
- func ResolveExecConfig(existing *Root, opts ExecResolveOpts) (*Root, *Provider, error)
- func ResolveProviderBearer(ctx context.Context, r *Root, p *Provider) (string, error)
- func RunInitialSetup(stdin io.Reader, out, errOut io.Writer, cfg *Root, configExists bool) error
- func Save(r *Root) error
- func SubagentTimeout(r *Root) int
- func WriteConfigSetupWarning(w io.Writer, r *Root)
- type Current
- type ExecResolveOpts
- type ModelPickChoice
- type OnboardOpts
- type OnboardResult
- type Provider
- type RecentModelUse
- type Root
Constants ¶
View Source
const ( EnvOpenAIBaseURL = "OPENAI_BASE_URL" EnvOpenAIAPIKey = "OPENAI_API_KEY" EnvModelID = "MODEL_ID" )
View Source
const ( ProviderNameChatGPTSub = "ChatGPT Sub" OpenAIPlatformBase = "https://api.openai.com" AuthKindAPIKey = "api_key" AuthKindOAuthChatGPT = "oauth_chatgpt" )
View Source
const DefaultCompactionThresholdTokens int64 = 131072
View Source
const DefaultResponseLanguage = "English"
View Source
const DefaultSkillSearchMinNormalizedScore = 0.05
View Source
const DefaultSubagentTimeoutMinutes = 20
View Source
const DefaultWebSearchEngine = "duckduckgo"
View Source
const MinCompactionThresholdTokens int64 = 32768
Variables ¶
This section is empty.
Functions ¶
func AppendOrUpdateProvider ¶ added in v0.20260521.1
func ApplyOAuthTokens ¶ added in v0.20260521.1
func ApplyOnboardMerge ¶
func ApplyOnboardMerge(dst *Root, res *OnboardResult)
func BackupConfig ¶
func ClampTimeoutMinutes ¶
func ConfigExists ¶
func EnsureChatGPTSubBaseURL ¶ added in v0.20260521.1
func EnsureChatGPTSubBaseURL(p *Provider)
func ModelPassesChatGPTSubFilter ¶ added in v0.20260521.1
func NeedsOnboard ¶
func NormalizeAPIBase ¶
func NoteRecentModelUse ¶
func PickModelInteractive ¶
func PrintConfigSkipHint ¶
func ProviderCredentialsReady ¶ added in v0.20260521.1
func ResolveExecConfig ¶
func ResolveExecConfig(existing *Root, opts ExecResolveOpts) (*Root, *Provider, error)
func ResolveProviderBearer ¶ added in v0.20260521.1
func RunInitialSetup ¶
func SubagentTimeout ¶
func WriteConfigSetupWarning ¶
Types ¶
type ExecResolveOpts ¶
type ExecResolveOpts struct {
EnvFile string
}
type ModelPickChoice ¶
type OnboardOpts ¶
type OnboardOpts struct {
RequireProvider bool
}
type OnboardResult ¶
type OnboardResult struct {
UserName string
ResponseLanguage string
SubagentTimeoutMinutes int
CompactionThresholdTokens int64
NewProvider *Provider
SwitchCurrent bool
CurrentProvider string
CurrentModel string
}
func RunOnboardWizard ¶
func RunOnboardWizard(stdin io.Reader, out io.Writer, existing *Root, opts OnboardOpts) (*OnboardResult, error)
type Provider ¶
type Provider struct {
Name string `toml:"name"`
BaseURL string `toml:"base_url"`
APIKey string `toml:"api_key"`
AuthKind string `toml:"auth_kind,omitempty"`
OAuthAccessToken string `toml:"oauth_access_token,omitempty"`
OAuthRefreshToken string `toml:"oauth_refresh_token,omitempty"`
OAuthExpiresAt string `toml:"oauth_expires_at,omitempty"`
OAuthAccountID string `toml:"oauth_account_id,omitempty"`
}
func NewChatGPTSubProvider ¶ added in v0.20260521.1
func ResolveProvider ¶
func (*Provider) EffectiveAuthKind ¶ added in v0.20260521.1
func (*Provider) IsChatGPTSub ¶ added in v0.20260521.1
type RecentModelUse ¶
type Root ¶
type Root struct {
UserName string `toml:"user_name"`
Providers []Provider `toml:"providers"`
Current Current `toml:"current"`
RecentModelUses []RecentModelUse `toml:"recent_model_uses,omitempty"`
SubagentTimeoutMinutes int `toml:"subagent_timeout_minutes"`
ReasoningEffort string `toml:"reasoning_effort"`
LogLevel string `toml:"log_level"`
MaxResponseTokens int `toml:"max_response_tokens"`
ShowThinking bool `toml:"show_thinking"`
ShowUsageStats *bool `toml:"show_usage_stats"`
ResponseLanguage string `toml:"response_language"`
CompactionThresholdTokens int64 `toml:"compaction_threshold_tokens"`
SkillSearchMinNorm *float64 `toml:"skill_search_min_normalized_score,omitempty"`
WebSearchEngine string `toml:"web_search_engine,omitempty"`
WebSearchAPIKey string `toml:"web_search_api_key,omitempty"`
WebSearchBaseURL string `toml:"web_search_base_url,omitempty"`
WebSearchCX string `toml:"web_search_cx,omitempty"`
}
func LoadOptional ¶
func (*Root) EffectiveResponseLanguage ¶
func (*Root) EffectiveWebSearchEngine ¶
func (*Root) GlobalReasoningEffort ¶
func (r *Root) GlobalReasoningEffort() shared.ReasoningEffort
func (*Root) ReasoningEffortIsNone ¶
func (*Root) ReasoningEffortLabel ¶
func (*Root) UsageStatsEnabled ¶
Click to show internal directories.
Click to hide internal directories.