Skip to content

Commit 15dbda8

Browse files
🌿 Fern Regeneration -- June 11, 2024 (#175)
* SDK regeneration * Add webpack test * Fixes --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Billy Trend <billy@cohere.com>
1 parent ff6cca8 commit 15dbda8

File tree

10 files changed

+471
-56
lines changed

10 files changed

+471
-56
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cohere-ai",
3-
"version": "7.10.4",
3+
"version": "7.10.5",
44
"private": false,
55
"repository": "https://github.com/cohere-ai/cohere-typescript",
66
"main": "./index.js",
@@ -36,7 +36,9 @@
3636
"jest-environment-jsdom": "29.7.0",
3737
"@types/node": "17.0.33",
3838
"prettier": "2.7.1",
39+
"ts-loader": "^9.5.1",
3940
"typescript": "4.6.4",
40-
"@types/readable-stream": "^4.0.14"
41+
"@types/readable-stream": "^4.0.14",
42+
"webpack": "^5.91.0"
4143
}
4244
}

src/Client.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class CohereClient {
5555
: undefined,
5656
"X-Fern-Language": "JavaScript",
5757
"X-Fern-SDK-Name": "cohere-ai",
58-
"X-Fern-SDK-Version": "7.10.4",
58+
"X-Fern-SDK-Version": "7.10.5",
5959
"X-Fern-Runtime": core.RUNTIME.type,
6060
"X-Fern-Runtime-Version": core.RUNTIME.version,
6161
},
@@ -163,7 +163,7 @@ export class CohereClient {
163163
: undefined,
164164
"X-Fern-Language": "JavaScript",
165165
"X-Fern-SDK-Name": "cohere-ai",
166-
"X-Fern-SDK-Version": "7.10.4",
166+
"X-Fern-SDK-Version": "7.10.5",
167167
"X-Fern-Runtime": core.RUNTIME.type,
168168
"X-Fern-Runtime-Version": core.RUNTIME.version,
169169
},
@@ -250,7 +250,7 @@ export class CohereClient {
250250
: undefined,
251251
"X-Fern-Language": "JavaScript",
252252
"X-Fern-SDK-Name": "cohere-ai",
253-
"X-Fern-SDK-Version": "7.10.4",
253+
"X-Fern-SDK-Version": "7.10.5",
254254
"X-Fern-Runtime": core.RUNTIME.type,
255255
"X-Fern-Runtime-Version": core.RUNTIME.version,
256256
},
@@ -365,7 +365,7 @@ export class CohereClient {
365365
: undefined,
366366
"X-Fern-Language": "JavaScript",
367367
"X-Fern-SDK-Name": "cohere-ai",
368-
"X-Fern-SDK-Version": "7.10.4",
368+
"X-Fern-SDK-Version": "7.10.5",
369369
"X-Fern-Runtime": core.RUNTIME.type,
370370
"X-Fern-Runtime-Version": core.RUNTIME.version,
371371
},
@@ -472,7 +472,7 @@ export class CohereClient {
472472
: undefined,
473473
"X-Fern-Language": "JavaScript",
474474
"X-Fern-SDK-Name": "cohere-ai",
475-
"X-Fern-SDK-Version": "7.10.4",
475+
"X-Fern-SDK-Version": "7.10.5",
476476
"X-Fern-Runtime": core.RUNTIME.type,
477477
"X-Fern-Runtime-Version": core.RUNTIME.version,
478478
},
@@ -568,7 +568,7 @@ export class CohereClient {
568568
: undefined,
569569
"X-Fern-Language": "JavaScript",
570570
"X-Fern-SDK-Name": "cohere-ai",
571-
"X-Fern-SDK-Version": "7.10.4",
571+
"X-Fern-SDK-Version": "7.10.5",
572572
"X-Fern-Runtime": core.RUNTIME.type,
573573
"X-Fern-Runtime-Version": core.RUNTIME.version,
574574
},
@@ -692,7 +692,7 @@ export class CohereClient {
692692
: undefined,
693693
"X-Fern-Language": "JavaScript",
694694
"X-Fern-SDK-Name": "cohere-ai",
695-
"X-Fern-SDK-Version": "7.10.4",
695+
"X-Fern-SDK-Version": "7.10.5",
696696
"X-Fern-Runtime": core.RUNTIME.type,
697697
"X-Fern-Runtime-Version": core.RUNTIME.version,
698698
},
@@ -790,7 +790,7 @@ export class CohereClient {
790790
: undefined,
791791
"X-Fern-Language": "JavaScript",
792792
"X-Fern-SDK-Name": "cohere-ai",
793-
"X-Fern-SDK-Version": "7.10.4",
793+
"X-Fern-SDK-Version": "7.10.5",
794794
"X-Fern-Runtime": core.RUNTIME.type,
795795
"X-Fern-Runtime-Version": core.RUNTIME.version,
796796
},
@@ -883,7 +883,7 @@ export class CohereClient {
883883
: undefined,
884884
"X-Fern-Language": "JavaScript",
885885
"X-Fern-SDK-Name": "cohere-ai",
886-
"X-Fern-SDK-Version": "7.10.4",
886+
"X-Fern-SDK-Version": "7.10.5",
887887
"X-Fern-Runtime": core.RUNTIME.type,
888888
"X-Fern-Runtime-Version": core.RUNTIME.version,
889889
},
@@ -978,7 +978,7 @@ export class CohereClient {
978978
: undefined,
979979
"X-Fern-Language": "JavaScript",
980980
"X-Fern-SDK-Name": "cohere-ai",
981-
"X-Fern-SDK-Version": "7.10.4",
981+
"X-Fern-SDK-Version": "7.10.5",
982982
"X-Fern-Runtime": core.RUNTIME.type,
983983
"X-Fern-Runtime-Version": core.RUNTIME.version,
984984
},
@@ -1062,7 +1062,7 @@ export class CohereClient {
10621062
: undefined,
10631063
"X-Fern-Language": "JavaScript",
10641064
"X-Fern-SDK-Name": "cohere-ai",
1065-
"X-Fern-SDK-Version": "7.10.4",
1065+
"X-Fern-SDK-Version": "7.10.5",
10661066
"X-Fern-Runtime": core.RUNTIME.type,
10671067
"X-Fern-Runtime-Version": core.RUNTIME.version,
10681068
},

src/api/resources/connectors/client/Client.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class Connectors {
6868
: undefined,
6969
"X-Fern-Language": "JavaScript",
7070
"X-Fern-SDK-Name": "cohere-ai",
71-
"X-Fern-SDK-Version": "7.10.4",
71+
"X-Fern-SDK-Version": "7.10.5",
7272
"X-Fern-Runtime": core.RUNTIME.type,
7373
"X-Fern-Runtime-Version": core.RUNTIME.version,
7474
},
@@ -162,7 +162,7 @@ export class Connectors {
162162
: undefined,
163163
"X-Fern-Language": "JavaScript",
164164
"X-Fern-SDK-Name": "cohere-ai",
165-
"X-Fern-SDK-Version": "7.10.4",
165+
"X-Fern-SDK-Version": "7.10.5",
166166
"X-Fern-Runtime": core.RUNTIME.type,
167167
"X-Fern-Runtime-Version": core.RUNTIME.version,
168168
},
@@ -256,7 +256,7 @@ export class Connectors {
256256
: undefined,
257257
"X-Fern-Language": "JavaScript",
258258
"X-Fern-SDK-Name": "cohere-ai",
259-
"X-Fern-SDK-Version": "7.10.4",
259+
"X-Fern-SDK-Version": "7.10.5",
260260
"X-Fern-Runtime": core.RUNTIME.type,
261261
"X-Fern-Runtime-Version": core.RUNTIME.version,
262262
},
@@ -349,7 +349,7 @@ export class Connectors {
349349
: undefined,
350350
"X-Fern-Language": "JavaScript",
351351
"X-Fern-SDK-Name": "cohere-ai",
352-
"X-Fern-SDK-Version": "7.10.4",
352+
"X-Fern-SDK-Version": "7.10.5",
353353
"X-Fern-Runtime": core.RUNTIME.type,
354354
"X-Fern-Runtime-Version": core.RUNTIME.version,
355355
},
@@ -446,7 +446,7 @@ export class Connectors {
446446
: undefined,
447447
"X-Fern-Language": "JavaScript",
448448
"X-Fern-SDK-Name": "cohere-ai",
449-
"X-Fern-SDK-Version": "7.10.4",
449+
"X-Fern-SDK-Version": "7.10.5",
450450
"X-Fern-Runtime": core.RUNTIME.type,
451451
"X-Fern-Runtime-Version": core.RUNTIME.version,
452452
},
@@ -553,7 +553,7 @@ export class Connectors {
553553
: undefined,
554554
"X-Fern-Language": "JavaScript",
555555
"X-Fern-SDK-Name": "cohere-ai",
556-
"X-Fern-SDK-Version": "7.10.4",
556+
"X-Fern-SDK-Version": "7.10.5",
557557
"X-Fern-Runtime": core.RUNTIME.type,
558558
"X-Fern-Runtime-Version": core.RUNTIME.version,
559559
},

src/api/resources/datasets/client/Client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class Datasets {
8383
: undefined,
8484
"X-Fern-Language": "JavaScript",
8585
"X-Fern-SDK-Name": "cohere-ai",
86-
"X-Fern-SDK-Version": "7.10.4",
86+
"X-Fern-SDK-Version": "7.10.5",
8787
"X-Fern-Runtime": core.RUNTIME.type,
8888
"X-Fern-Runtime-Version": core.RUNTIME.version,
8989
},
@@ -220,7 +220,7 @@ export class Datasets {
220220
: undefined,
221221
"X-Fern-Language": "JavaScript",
222222
"X-Fern-SDK-Name": "cohere-ai",
223-
"X-Fern-SDK-Version": "7.10.4",
223+
"X-Fern-SDK-Version": "7.10.5",
224224
"X-Fern-Runtime": core.RUNTIME.type,
225225
"X-Fern-Runtime-Version": core.RUNTIME.version,
226226
...(await _maybeEncodedRequest.getHeaders()),
@@ -301,7 +301,7 @@ export class Datasets {
301301
: undefined,
302302
"X-Fern-Language": "JavaScript",
303303
"X-Fern-SDK-Name": "cohere-ai",
304-
"X-Fern-SDK-Version": "7.10.4",
304+
"X-Fern-SDK-Version": "7.10.5",
305305
"X-Fern-Runtime": core.RUNTIME.type,
306306
"X-Fern-Runtime-Version": core.RUNTIME.version,
307307
},
@@ -381,7 +381,7 @@ export class Datasets {
381381
: undefined,
382382
"X-Fern-Language": "JavaScript",
383383
"X-Fern-SDK-Name": "cohere-ai",
384-
"X-Fern-SDK-Version": "7.10.4",
384+
"X-Fern-SDK-Version": "7.10.5",
385385
"X-Fern-Runtime": core.RUNTIME.type,
386386
"X-Fern-Runtime-Version": core.RUNTIME.version,
387387
},
@@ -461,7 +461,7 @@ export class Datasets {
461461
: undefined,
462462
"X-Fern-Language": "JavaScript",
463463
"X-Fern-SDK-Name": "cohere-ai",
464-
"X-Fern-SDK-Version": "7.10.4",
464+
"X-Fern-SDK-Version": "7.10.5",
465465
"X-Fern-Runtime": core.RUNTIME.type,
466466
"X-Fern-Runtime-Version": core.RUNTIME.version,
467467
},

src/api/resources/embedJobs/client/Client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class EmbedJobs {
5454
: undefined,
5555
"X-Fern-Language": "JavaScript",
5656
"X-Fern-SDK-Name": "cohere-ai",
57-
"X-Fern-SDK-Version": "7.10.4",
57+
"X-Fern-SDK-Version": "7.10.5",
5858
"X-Fern-Runtime": core.RUNTIME.type,
5959
"X-Fern-Runtime-Version": core.RUNTIME.version,
6060
},
@@ -147,7 +147,7 @@ export class EmbedJobs {
147147
: undefined,
148148
"X-Fern-Language": "JavaScript",
149149
"X-Fern-SDK-Name": "cohere-ai",
150-
"X-Fern-SDK-Version": "7.10.4",
150+
"X-Fern-SDK-Version": "7.10.5",
151151
"X-Fern-Runtime": core.RUNTIME.type,
152152
"X-Fern-Runtime-Version": core.RUNTIME.version,
153153
},
@@ -239,7 +239,7 @@ export class EmbedJobs {
239239
: undefined,
240240
"X-Fern-Language": "JavaScript",
241241
"X-Fern-SDK-Name": "cohere-ai",
242-
"X-Fern-SDK-Version": "7.10.4",
242+
"X-Fern-SDK-Version": "7.10.5",
243243
"X-Fern-Runtime": core.RUNTIME.type,
244244
"X-Fern-Runtime-Version": core.RUNTIME.version,
245245
},
@@ -328,7 +328,7 @@ export class EmbedJobs {
328328
: undefined,
329329
"X-Fern-Language": "JavaScript",
330330
"X-Fern-SDK-Name": "cohere-ai",
331-
"X-Fern-SDK-Version": "7.10.4",
331+
"X-Fern-SDK-Version": "7.10.5",
332332
"X-Fern-Runtime": core.RUNTIME.type,
333333
"X-Fern-Runtime-Version": core.RUNTIME.version,
334334
},

src/api/resources/finetuning/client/Client.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class Finetuning {
7676
: undefined,
7777
"X-Fern-Language": "JavaScript",
7878
"X-Fern-SDK-Name": "cohere-ai",
79-
"X-Fern-SDK-Version": "7.10.4",
79+
"X-Fern-SDK-Version": "7.10.5",
8080
"X-Fern-Runtime": core.RUNTIME.type,
8181
"X-Fern-Runtime-Version": core.RUNTIME.version,
8282
},
@@ -189,7 +189,7 @@ export class Finetuning {
189189
: undefined,
190190
"X-Fern-Language": "JavaScript",
191191
"X-Fern-SDK-Name": "cohere-ai",
192-
"X-Fern-SDK-Version": "7.10.4",
192+
"X-Fern-SDK-Version": "7.10.5",
193193
"X-Fern-Runtime": core.RUNTIME.type,
194194
"X-Fern-Runtime-Version": core.RUNTIME.version,
195195
},
@@ -298,7 +298,7 @@ export class Finetuning {
298298
: undefined,
299299
"X-Fern-Language": "JavaScript",
300300
"X-Fern-SDK-Name": "cohere-ai",
301-
"X-Fern-SDK-Version": "7.10.4",
301+
"X-Fern-SDK-Version": "7.10.5",
302302
"X-Fern-Runtime": core.RUNTIME.type,
303303
"X-Fern-Runtime-Version": core.RUNTIME.version,
304304
},
@@ -402,7 +402,7 @@ export class Finetuning {
402402
: undefined,
403403
"X-Fern-Language": "JavaScript",
404404
"X-Fern-SDK-Name": "cohere-ai",
405-
"X-Fern-SDK-Version": "7.10.4",
405+
"X-Fern-SDK-Version": "7.10.5",
406406
"X-Fern-Runtime": core.RUNTIME.type,
407407
"X-Fern-Runtime-Version": core.RUNTIME.version,
408408
},
@@ -516,7 +516,7 @@ export class Finetuning {
516516
: undefined,
517517
"X-Fern-Language": "JavaScript",
518518
"X-Fern-SDK-Name": "cohere-ai",
519-
"X-Fern-SDK-Version": "7.10.4",
519+
"X-Fern-SDK-Version": "7.10.5",
520520
"X-Fern-Runtime": core.RUNTIME.type,
521521
"X-Fern-Runtime-Version": core.RUNTIME.version,
522522
},
@@ -641,7 +641,7 @@ export class Finetuning {
641641
: undefined,
642642
"X-Fern-Language": "JavaScript",
643643
"X-Fern-SDK-Name": "cohere-ai",
644-
"X-Fern-SDK-Version": "7.10.4",
644+
"X-Fern-SDK-Version": "7.10.5",
645645
"X-Fern-Runtime": core.RUNTIME.type,
646646
"X-Fern-Runtime-Version": core.RUNTIME.version,
647647
},
@@ -758,7 +758,7 @@ export class Finetuning {
758758
: undefined,
759759
"X-Fern-Language": "JavaScript",
760760
"X-Fern-SDK-Name": "cohere-ai",
761-
"X-Fern-SDK-Version": "7.10.4",
761+
"X-Fern-SDK-Version": "7.10.5",
762762
"X-Fern-Runtime": core.RUNTIME.type,
763763
"X-Fern-Runtime-Version": core.RUNTIME.version,
764764
},

src/api/resources/models/client/Client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class Models {
5555
: undefined,
5656
"X-Fern-Language": "JavaScript",
5757
"X-Fern-SDK-Name": "cohere-ai",
58-
"X-Fern-SDK-Version": "7.10.4",
58+
"X-Fern-SDK-Version": "7.10.5",
5959
"X-Fern-Runtime": core.RUNTIME.type,
6060
"X-Fern-Runtime-Version": core.RUNTIME.version,
6161
},
@@ -160,7 +160,7 @@ export class Models {
160160
: undefined,
161161
"X-Fern-Language": "JavaScript",
162162
"X-Fern-SDK-Name": "cohere-ai",
163-
"X-Fern-SDK-Version": "7.10.4",
163+
"X-Fern-SDK-Version": "7.10.5",
164164
"X-Fern-Runtime": core.RUNTIME.type,
165165
"X-Fern-Runtime-Version": core.RUNTIME.version,
166166
},

src/aws-utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Sha256 } from '@aws-crypto/sha256-js';
33
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
44
import { HttpRequest } from '@aws-sdk/protocol-http';
55
import { SignatureV4 } from '@aws-sdk/signature-v4';
6-
import { assert } from 'console';
76
import { PassThrough, Readable } from 'readable-stream';
87
import { APIResponse, FetchFunction, Fetcher, fetcher } from './core';
98
import { readableStreamAsyncIterable } from './core/streaming-fetcher/Stream';
@@ -161,7 +160,7 @@ export const fetchOverride = (platform: AwsPlatform, {
161160
}: AwsProps): FetchFunction => async (fetcherArgs: Fetcher.Args): Promise<APIResponse<any, Fetcher.Error>> => {
162161
const endpoint = fetcherArgs.url.split('/').pop() as string;
163162
const bodyJson = fetcherArgs.body as { model?: string, stream?: boolean };
164-
assert(bodyJson.model, "model is required")
163+
console.assert(bodyJson.model, "model is required")
165164

166165
const isStreaming = Boolean(bodyJson.stream);
167166

src/test/env.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { describe, test } from "@jest/globals";
2+
import webpack from 'webpack';
3+
4+
describe("test env compatibility", () => {
5+
test("webpack", (done) => {
6+
webpack({
7+
mode: "production",
8+
entry: "./src/index.ts",
9+
module: {
10+
rules: [
11+
{
12+
test: /\.tsx?$/,
13+
use: 'ts-loader',
14+
exclude: /node_modules/,
15+
},
16+
],
17+
},
18+
resolve: {
19+
extensions: ['.tsx', '.ts', '.js'],
20+
},
21+
22+
}, (err, stats) => {
23+
done();
24+
console.log(stats?.toString())
25+
expect(err).toBe(null);
26+
expect(stats?.hasErrors()).toBe(false);
27+
})
28+
})
29+
});

0 commit comments

Comments
 (0)