@@ -28,6 +28,7 @@ func (t *closureTransport) RoundTrip(req *http.Request) (*http.Response, error)
28
28
func TestUserAgentHeader (t * testing.T ) {
29
29
var userAgent string
30
30
client := openai .NewClient (
31
+ option .WithAPIKey ("My API Key" ),
31
32
option .WithHTTPClient (& http.Client {
32
33
Transport : & closureTransport {
33
34
fn : func (req * http.Request ) (* http.Response , error ) {
@@ -57,6 +58,7 @@ func TestUserAgentHeader(t *testing.T) {
57
58
func TestRetryAfter (t * testing.T ) {
58
59
retryCountHeaders := make ([]string , 0 )
59
60
client := openai .NewClient (
61
+ option .WithAPIKey ("My API Key" ),
60
62
option .WithHTTPClient (& http.Client {
61
63
Transport : & closureTransport {
62
64
fn : func (req * http.Request ) (* http.Response , error ) {
@@ -99,6 +101,7 @@ func TestRetryAfter(t *testing.T) {
99
101
func TestDeleteRetryCountHeader (t * testing.T ) {
100
102
retryCountHeaders := make ([]string , 0 )
101
103
client := openai .NewClient (
104
+ option .WithAPIKey ("My API Key" ),
102
105
option .WithHTTPClient (& http.Client {
103
106
Transport : & closureTransport {
104
107
fn : func (req * http.Request ) (* http.Response , error ) {
@@ -137,6 +140,7 @@ func TestDeleteRetryCountHeader(t *testing.T) {
137
140
func TestOverwriteRetryCountHeader (t * testing.T ) {
138
141
retryCountHeaders := make ([]string , 0 )
139
142
client := openai .NewClient (
143
+ option .WithAPIKey ("My API Key" ),
140
144
option .WithHTTPClient (& http.Client {
141
145
Transport : & closureTransport {
142
146
fn : func (req * http.Request ) (* http.Response , error ) {
@@ -175,6 +179,7 @@ func TestOverwriteRetryCountHeader(t *testing.T) {
175
179
func TestRetryAfterMs (t * testing.T ) {
176
180
attempts := 0
177
181
client := openai .NewClient (
182
+ option .WithAPIKey ("My API Key" ),
178
183
option .WithHTTPClient (& http.Client {
179
184
Transport : & closureTransport {
180
185
fn : func (req * http.Request ) (* http.Response , error ) {
@@ -209,6 +214,7 @@ func TestRetryAfterMs(t *testing.T) {
209
214
210
215
func TestContextCancel (t * testing.T ) {
211
216
client := openai .NewClient (
217
+ option .WithAPIKey ("My API Key" ),
212
218
option .WithHTTPClient (& http.Client {
213
219
Transport : & closureTransport {
214
220
fn : func (req * http.Request ) (* http.Response , error ) {
@@ -237,6 +243,7 @@ func TestContextCancel(t *testing.T) {
237
243
238
244
func TestContextCancelDelay (t * testing.T ) {
239
245
client := openai .NewClient (
246
+ option .WithAPIKey ("My API Key" ),
240
247
option .WithHTTPClient (& http.Client {
241
248
Transport : & closureTransport {
242
249
fn : func (req * http.Request ) (* http.Response , error ) {
@@ -273,6 +280,7 @@ func TestContextDeadline(t *testing.T) {
273
280
274
281
go func () {
275
282
client := openai .NewClient (
283
+ option .WithAPIKey ("My API Key" ),
276
284
option .WithHTTPClient (& http.Client {
277
285
Transport : & closureTransport {
278
286
fn : func (req * http.Request ) (* http.Response , error ) {
@@ -318,6 +326,7 @@ func TestContextDeadlineStreaming(t *testing.T) {
318
326
319
327
go func () {
320
328
client := openai .NewClient (
329
+ option .WithAPIKey ("My API Key" ),
321
330
option .WithHTTPClient (& http.Client {
322
331
Transport : & closureTransport {
323
332
fn : func (req * http.Request ) (* http.Response , error ) {
@@ -371,6 +380,7 @@ func TestContextDeadlineStreamingWithRequestTimeout(t *testing.T) {
371
380
372
381
go func () {
373
382
client := openai .NewClient (
383
+ option .WithAPIKey ("My API Key" ),
374
384
option .WithHTTPClient (& http.Client {
375
385
Transport : & closureTransport {
376
386
fn : func (req * http.Request ) (* http.Response , error ) {
0 commit comments