Add claude code support

This commit is contained in:
Luis Pater
2025-08-19 01:16:52 +08:00
parent c5cc238308
commit d58cc55cb2
40 changed files with 4429 additions and 185 deletions

View File

@@ -36,6 +36,8 @@ type Config struct {
// RequestLog enables or disables detailed request logging functionality.
RequestLog bool `yaml:"request-log"`
ClaudeKey []ClaudeKey `yaml:"claude-api-key"`
}
// QuotaExceeded defines the behavior when API quota limits are exceeded.
@@ -48,6 +50,11 @@ type QuotaExceeded struct {
SwitchPreviewModel bool `yaml:"switch-preview-model"`
}
type ClaudeKey struct {
APIKey string `yaml:"api-key"`
BaseURL string `yaml:"base-url"`
}
// LoadConfig reads a YAML configuration file from the given path,
// unmarshals it into a Config struct, applies environment variable overrides,
// and returns it.