File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -104,15 +104,16 @@ The workspace name **MUST** be prefixed with "task".`,
104
104
},
105
105
}
106
106
107
- if anthropicClient := api .anthropicClient .Load (); anthropicClient != nil {
108
- stream , err = anthropicDataStream (ctx , * anthropicClient , conversation )
109
- if err != nil {
110
- return "" , xerrors .Errorf ("create anthropic data stream: %w" , err )
111
- }
112
- } else {
107
+ anthropicClient := api .anthropicClient .Load ()
108
+ if anthropicClient == nil {
113
109
return fallback , nil
114
110
}
115
111
112
+ stream , err = anthropicDataStream (ctx , * anthropicClient , conversation )
113
+ if err != nil {
114
+ return "" , xerrors .Errorf ("create anthropic data stream: %w" , err )
115
+ }
116
+
116
117
var acc aisdk.DataStreamAccumulator
117
118
stream = stream .WithAccumulator (& acc )
118
119
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"time"
22
22
23
23
"github.com/anthropics/anthropic-sdk-go"
24
+
24
25
"github.com/coder/coder/v2/coderd/oauth2provider"
25
26
"github.com/coder/coder/v2/coderd/pproflabel"
26
27
"github.com/coder/coder/v2/coderd/prebuilds"
Original file line number Diff line number Diff line change @@ -477,6 +477,7 @@ require (
477
477
)
478
478
479
479
require (
480
+ github.com/anthropics/anthropic-sdk-go v1.4.0
480
481
github.com/brianvoe/gofakeit/v7 v7.3.0
481
482
github.com/coder/agentapi-sdk-go v0.0.0-20250505131810-560d1d88d225
482
483
github.com/coder/aisdk-go v0.0.9
@@ -500,7 +501,6 @@ require (
500
501
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0 // indirect
501
502
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0 // indirect
502
503
github.com/Masterminds/semver/v3 v3.3.1 // indirect
503
- github.com/anthropics/anthropic-sdk-go v1.4.0 // indirect
504
504
github.com/aquasecurity/go-version v0.0.1 // indirect
505
505
github.com/aquasecurity/trivy v0.58.2 // indirect
506
506
github.com/aws/aws-sdk-go v1.55.7 // indirect
You can’t perform that action at this time.
0 commit comments