config

package
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHTTPTimeout = 30 * time.Second
	SerperHTTPTimeout  = 10 * time.Second // Serper API専用
)

HTTP Configuration

View Source
const (
	MaxToolIterations    = 10 // ツールループ最大回数
	MaxChangeStack       = 10 // Undo履歴最大保存数
	MaxAPIRetries        = 2  // API呼び出し最大リトライ回数
	MaxSameToolCallCount = 3  // 同じツール呼び出しの最大繰り返し回数(ループ検知)
)

Tool Execution Limits

View Source
const (
	OutputTruncateLen   = 5000 // bash出力切り詰め長
	MaxDiffDisplayLines = 15   // diff表示最大行数
	MaxDiffIterations   = 20   // diff比較最大イテレーション
)

Output Display Limits

Variables

This section is empty.

Functions

func SaveConfig

func SaveConfig(cfg *Config) error

SaveConfig は設定ファイルを保存

func SetGlobalConfig added in v0.29.0

func SetGlobalConfig(cfg *Config)

SetGlobalConfig はグローバル設定を保存

func ValidateModel

func ValidateModel(model string) bool

ValidateModel は任意のモデル名を受け付ける(後方互換のため残す) 注: v0.16.0以降、モデル名の検証は行わない

Types

type APIRetryConfig added in v0.29.0

type APIRetryConfig struct {
	Count        int `yaml:"count"`         // リトライ回数(デフォルト3)
	InitialDelay int `yaml:"initial_delay"` // 初回待機秒数(デフォルト1)
	MaxDelay     int `yaml:"max_delay"`     // 最大待機秒数(デフォルト30)
}

APIRetryConfig はAPIリトライの設定

type BackupConfig added in v0.29.0

type BackupConfig struct {
	MaxGenerations int `yaml:"max_generations"` // 保持する世代数(デフォルト5)
}

BackupConfig はバックアップファイルの設定

type CompressionConfig added in v0.29.0

type CompressionConfig struct {
	AutoCompress    bool `yaml:"auto_compress"`    // 自動圧縮を有効化
	ThresholdTokens int  `yaml:"threshold_tokens"` // 自動圧縮のトークン閾値
	KeepRecent      int  `yaml:"keep_recent"`      // 保持する最新メッセージ数
}

CompressionConfig は会話履歴圧縮の設定

type Config

type Config struct {
	DefaultProvider string                         `yaml:"default_provider"`
	DefaultModel    string                         `yaml:"default_model"`
	ProviderModels  map[string]ProviderModelConfig `yaml:"provider_models"`
	Compression     CompressionConfig              `yaml:"compression,omitempty"`
	Backup          BackupConfig                   `yaml:"backup,omitempty"`
	LoopDetection   LoopDetectionConfig            `yaml:"loop_detection,omitempty"`
	APIRetry        APIRetryConfig                 `yaml:"api_retry,omitempty"`
	Diff            DiffConfig                     `yaml:"diff,omitempty"`
}

Config はXELYON CLIの設定

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig はデフォルト設定

func GetGlobalConfig added in v0.29.0

func GetGlobalConfig() *Config

GetGlobalConfig はグローバル設定を取得

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig は設定ファイルを読み込む

func (*Config) ApplyEnvironmentOverrides added in v0.29.0

func (c *Config) ApplyEnvironmentOverrides()

ApplyEnvironmentOverrides は環境変数で設定を上書き

func (*Config) ApplyFlagOverrides added in v0.29.0

func (c *Config) ApplyFlagOverrides(loopThreshold, apiRetry, apiRetryDelay, diffLines *int)

ApplyFlagOverrides はCLIフラグで設定を上書き

func (*Config) GetModelForProvider

func (c *Config) GetModelForProvider(provider string) string

GetModelForProvider はプロバイダーに対応するデフォルトモデルを取得

func (*Config) ValidateModelForProvider

func (c *Config) ValidateModelForProvider(provider, model string) bool

ValidateModelForProvider は任意のモデル名を受け付ける(後方互換のため残す) 注: v0.16.0以降、モデル名の検証は行わない

type DiffConfig added in v0.29.0

type DiffConfig struct {
	ContextLines int `yaml:"context_lines"` // 差分表示行数(デフォルト10、0で省略なし)
}

DiffConfig は差分表示の設定

type LoopDetectionConfig added in v0.29.0

type LoopDetectionConfig struct {
	Threshold int `yaml:"threshold"` // ループ検知回数(デフォルト3)
}

LoopDetectionConfig はループ検知の設定

type ProviderModelConfig

type ProviderModelConfig struct {
	DefaultModel string `yaml:"default_model"`
}

ProviderModelConfig はプロバイダーごとのモデル設定

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL