File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ const webSearchToolName = "web_search"
19
19
const webSearchToolType = "web_search_20250305"
20
20
const sourcesHeader = "## Sources"
21
21
22
+ const vendorTokenIdentifier = "claude"
23
+
22
24
func NewClient () (ret * Client ) {
23
25
vendorName := "Anthropic"
24
26
ret = & Client {}
@@ -50,9 +52,6 @@ func NewClient() (ret *Client) {
50
52
51
53
// IsConfigured returns true if either the API key or OAuth is configured
52
54
func (an * Client ) IsConfigured () bool {
53
- // First configure to load values from environment variables
54
- an .Configure ()
55
-
56
55
// Check if API key is configured
57
56
if an .ApiKey .Value != "" {
58
57
return true
@@ -66,7 +65,7 @@ func (an *Client) IsConfigured() bool {
66
65
}
67
66
68
67
// If no valid token exists, automatically run OAuth flow
69
- if ! storage .HasValidToken ("claude" , 5 ) {
68
+ if ! storage .HasValidToken (vendorTokenIdentifier , 5 ) {
70
69
fmt .Println ("OAuth enabled but no valid token found. Starting authentication..." )
71
70
_ , err := RunOAuthFlow ()
72
71
if err != nil {
You can’t perform that action at this time.
0 commit comments