feat: add i18n support and batch JSON credentials import

This commit is contained in:
Quorinex
2026-02-06 21:54:04 +08:00
parent d05bd00207
commit d6fa49f24e
9 changed files with 1730 additions and 673 deletions

View File

@@ -95,6 +95,9 @@ type Config struct {
OpenAIThinkingFormat string `json:"openaiThinkingFormat,omitempty"` // OpenAI output format: "reasoning_content", "thinking", or "think"
ClaudeThinkingFormat string `json:"claudeThinkingFormat,omitempty"` // Claude output format: "reasoning_content", "thinking", or "think"
// Endpoint configuration: "auto", "codewhisperer", or "amazonq"
PreferredEndpoint string `json:"preferredEndpoint,omitempty"`
// Global statistics (persisted across restarts)
TotalRequests int `json:"totalRequests,omitempty"` // Total API requests received
SuccessRequests int `json:"successRequests,omitempty"` // Successful requests count
@@ -410,3 +413,21 @@ func UpdateThinkingConfig(suffix, openaiFormat, claudeFormat string) error {
cfg.ClaudeThinkingFormat = claudeFormat
return Save()
}
// GetPreferredEndpoint 获取首选端点配置
func GetPreferredEndpoint() string {
cfgLock.RLock()
defer cfgLock.RUnlock()
if cfg.PreferredEndpoint == "" {
return "auto"
}
return cfg.PreferredEndpoint
}
// UpdatePreferredEndpoint 更新首选端点配置
func UpdatePreferredEndpoint(endpoint string) error {
cfgLock.Lock()
defer cfgLock.Unlock()
cfg.PreferredEndpoint = endpoint
return Save()
}