feat: add OAuth login support for Anthropic API configuration

This commit is contained in:
Kayvan Sylvan
2025-07-05 14:46:43 -07:00
parent 2f9afe0247
commit f13a56685b
2 changed files with 41 additions and 36 deletions

View File

@@ -45,6 +45,11 @@ func NewClient() (ret *Client) {
ret.ApiBaseURL = ret.AddSetupQuestion("API Base URL", false)
ret.ApiBaseURL.Value = defaultBaseUrl
ret.UseOAuth = ret.AddSetupQuestionBool("Use OAuth login", false)
if plugins.ParseBoolElseFalse(ret.UseOAuth.Value) {
ret.ApiKey = ret.PluginBase.AddSetupQuestion("API key", false)
} else {
ret.ApiKey = ret.PluginBase.AddSetupQuestion("API key", true)
}
ret.ApiKey = ret.PluginBase.AddSetupQuestion("API key", false)
ret.maxTokens = 4096