// Copyright 2026 The MokoGitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package setting

// AI settings
var (
	AI = struct {
		Enabled      bool
		DefaultModel string `ini:"DEFAULT_MODEL"`
		DefaultKey   string `ini:"DEFAULT_API_KEY"`
		ClaudeBinPath string `ini:"CLAUDE_BIN_PATH"`
	}{
		Enabled:      false,
		DefaultModel: "claude-sonnet-4-6",
	}
)

func loadAIFrom(rootCfg ConfigProvider) {
	sec := rootCfg.Section("ai")
	AI.Enabled = sec.Key("ENABLED").MustBool(AI.Enabled)
	AI.DefaultModel = sec.Key("DEFAULT_MODEL").MustString(AI.DefaultModel)
	AI.DefaultKey = sec.Key("DEFAULT_API_KEY").String()
	AI.ClaudeBinPath = sec.Key("CLAUDE_BIN_PATH").MustString("claude")
}
