Skip to content

Commit

Permalink
🌿 Fern Regeneration -- June 11, 2024 (#175)
Browse files Browse the repository at this point in the history
* SDK regeneration

* Add webpack test

* Fixes

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Billy Trend <[email protected]>
  • Loading branch information
fern-api[bot] and billytrend-cohere authored Jun 11, 2024
1 parent ff6cca8 commit 15dbda8
Show file tree
Hide file tree
Showing 10 changed files with 471 additions and 56 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cohere-ai",
"version": "7.10.4",
"version": "7.10.5",
"private": false,
"repository": "https://github.com/cohere-ai/cohere-typescript",
"main": "./index.js",
Expand Down Expand Up @@ -36,7 +36,9 @@
"jest-environment-jsdom": "29.7.0",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"ts-loader": "^9.5.1",
"typescript": "4.6.4",
"@types/readable-stream": "^4.0.14"
"@types/readable-stream": "^4.0.14",
"webpack": "^5.91.0"
}
}
22 changes: 11 additions & 11 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -163,7 +163,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -250,7 +250,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -365,7 +365,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -472,7 +472,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -568,7 +568,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -692,7 +692,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -790,7 +790,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -883,7 +883,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -978,7 +978,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -1062,7 +1062,7 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
12 changes: 6 additions & 6 deletions src/api/resources/connectors/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -162,7 +162,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -256,7 +256,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -349,7 +349,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -446,7 +446,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -553,7 +553,7 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/datasets/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -220,7 +220,7 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...(await _maybeEncodedRequest.getHeaders()),
Expand Down Expand Up @@ -301,7 +301,7 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -381,7 +381,7 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -461,7 +461,7 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
8 changes: 4 additions & 4 deletions src/api/resources/embedJobs/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class EmbedJobs {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -147,7 +147,7 @@ export class EmbedJobs {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -239,7 +239,7 @@ export class EmbedJobs {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -328,7 +328,7 @@ export class EmbedJobs {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
14 changes: 7 additions & 7 deletions src/api/resources/finetuning/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Finetuning {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -189,7 +189,7 @@ export class Finetuning {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -298,7 +298,7 @@ export class Finetuning {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -402,7 +402,7 @@ export class Finetuning {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -516,7 +516,7 @@ export class Finetuning {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -641,7 +641,7 @@ export class Finetuning {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -758,7 +758,7 @@ export class Finetuning {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/models/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class Models {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down Expand Up @@ -160,7 +160,7 @@ export class Models {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.10.4",
"X-Fern-SDK-Version": "7.10.5",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand Down
3 changes: 1 addition & 2 deletions src/aws-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Sha256 } from '@aws-crypto/sha256-js';
import { fromNodeProviderChain } from '@aws-sdk/credential-providers';
import { HttpRequest } from '@aws-sdk/protocol-http';
import { SignatureV4 } from '@aws-sdk/signature-v4';
import { assert } from 'console';
import { PassThrough, Readable } from 'readable-stream';
import { APIResponse, FetchFunction, Fetcher, fetcher } from './core';
import { readableStreamAsyncIterable } from './core/streaming-fetcher/Stream';
Expand Down Expand Up @@ -161,7 +160,7 @@ export const fetchOverride = (platform: AwsPlatform, {
}: AwsProps): FetchFunction => async (fetcherArgs: Fetcher.Args): Promise<APIResponse<any, Fetcher.Error>> => {
const endpoint = fetcherArgs.url.split('/').pop() as string;
const bodyJson = fetcherArgs.body as { model?: string, stream?: boolean };
assert(bodyJson.model, "model is required")
console.assert(bodyJson.model, "model is required")

const isStreaming = Boolean(bodyJson.stream);

Expand Down
29 changes: 29 additions & 0 deletions src/test/env.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { describe, test } from "@jest/globals";
import webpack from 'webpack';

describe("test env compatibility", () => {
test("webpack", (done) => {
webpack({
mode: "production",
entry: "./src/index.ts",
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},

}, (err, stats) => {
done();
console.log(stats?.toString())
expect(err).toBe(null);
expect(stats?.hasErrors()).toBe(false);
})
})
});
Loading

0 comments on commit 15dbda8

Please sign in to comment.