From 3b589c7cb6ed257d5ca0e7a45c89a98ae96c9c34 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 10:18:23 -0500 Subject: [PATCH] :herb: Fern Regeneration -- May 22, 2024 (#157) * SDK regeneration * /* webpackIgnore: true */ --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Billy Trend --- package.json | 2 +- src/api/client/requests/ChatRequest.ts | 2 + src/api/client/requests/ChatStreamRequest.ts | 3 +- src/api/client/requests/ClassifyRequest.ts | 2 +- src/api/client/requests/GenerateRequest.ts | 2 +- .../client/requests/GenerateStreamRequest.ts | 2 +- src/api/resources/connectors/client/Client.ts | 12 ++--- src/api/resources/datasets/client/Client.ts | 10 ++-- src/api/resources/embedJobs/client/Client.ts | 8 +-- src/api/resources/finetuning/client/Client.ts | 14 +++--- src/api/resources/models/client/Client.ts | 4 +- src/core/form-data-utils/FormDataWrapper.ts | 2 +- src/environments.ts | 2 +- .../client/requests/ChatRequest.ts | 2 + .../client/requests/ChatStreamRequest.ts | 2 + yarn.lock | 50 +++++++++---------- 16 files changed, 63 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index ca18a2f..de3652f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cohere-ai", - "version": "7.10.0", + "version": "7.10.1", "private": false, "repository": "https://github.com/cohere-ai/cohere-typescript", "main": "./index.js", diff --git a/src/api/client/requests/ChatRequest.ts b/src/api/client/requests/ChatRequest.ts index 8ef511c..d525dd1 100644 --- a/src/api/client/requests/ChatRequest.ts +++ b/src/api/client/requests/ChatRequest.ts @@ -226,4 +226,6 @@ export interface ChatRequest { * */ toolResults?: Cohere.ToolResult[]; + /** Forces the chat to be single step. Defaults to `false`. */ + forceSingleStep?: boolean; } diff --git a/src/api/client/requests/ChatStreamRequest.ts b/src/api/client/requests/ChatStreamRequest.ts index 6df50ec..5e8c94f 100644 --- a/src/api/client/requests/ChatStreamRequest.ts +++ b/src/api/client/requests/ChatStreamRequest.ts @@ -94,7 +94,6 @@ import * as Cohere from "../../index"; * } * }] * }], - * enableMultiStep: true, * forceSingleStep: true * } */ @@ -311,4 +310,6 @@ export interface ChatStreamRequest { * */ toolResults?: Cohere.ToolResult[]; + /** Forces the chat to be single step. Defaults to `false`. */ + forceSingleStep?: boolean; } diff --git a/src/api/client/requests/ClassifyRequest.ts b/src/api/client/requests/ClassifyRequest.ts index 8f8045c..2cb7520 100644 --- a/src/api/client/requests/ClassifyRequest.ts +++ b/src/api/client/requests/ClassifyRequest.ts @@ -55,7 +55,7 @@ export interface ClassifyRequest { examples?: Cohere.ClassifyExample[]; /** The identifier of the model. Currently available models are `embed-multilingual-v2.0`, `embed-english-light-v2.0`, and `embed-english-v2.0` (default). Smaller "light" models are faster, while larger models will perform better. [Fine-tuned models](https://docs.cohere.com/docs/fine-tuning) can also be supplied with their full ID. */ model?: string; - /** The ID of a custom playground preset. You can create presets in the [playground](https://dashboard.cohere.ai/playground/classify?model=large). If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters. */ + /** The ID of a custom playground preset. You can create presets in the [playground](https://dashboard.cohere.com/playground/classify?model=large). If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters. */ preset?: string; /** * One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length. diff --git a/src/api/client/requests/GenerateRequest.ts b/src/api/client/requests/GenerateRequest.ts index 0e0d52f..ef88829 100644 --- a/src/api/client/requests/GenerateRequest.ts +++ b/src/api/client/requests/GenerateRequest.ts @@ -54,7 +54,7 @@ export interface GenerateRequest { /** If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinsim cannot be totally guaranteed. */ seed?: number; /** - * Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the [playground](https://dashboard.cohere.ai/playground/generate). + * Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the [playground](https://dashboard.cohere.com/playground/generate). * When a preset is specified, the `prompt` parameter becomes optional, and any included parameters will override the preset's parameters. * */ diff --git a/src/api/client/requests/GenerateStreamRequest.ts b/src/api/client/requests/GenerateStreamRequest.ts index 3ad159d..0de2efb 100644 --- a/src/api/client/requests/GenerateStreamRequest.ts +++ b/src/api/client/requests/GenerateStreamRequest.ts @@ -69,7 +69,7 @@ export interface GenerateStreamRequest { /** If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinsim cannot be totally guaranteed. */ seed?: number; /** - * Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the [playground](https://dashboard.cohere.ai/playground/generate). + * Identifier of a custom preset. A preset is a combination of parameters, such as prompt, temperature etc. You can create presets in the [playground](https://dashboard.cohere.com/playground/generate). * When a preset is specified, the `prompt` parameter becomes optional, and any included parameters will override the preset's parameters. * */ diff --git a/src/api/resources/connectors/client/Client.ts b/src/api/resources/connectors/client/Client.ts index 9c4144e..ab9ad80 100644 --- a/src/api/resources/connectors/client/Client.ts +++ b/src/api/resources/connectors/client/Client.ts @@ -66,7 +66,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -159,7 +159,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -252,7 +252,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -344,7 +344,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -440,7 +440,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -546,7 +546,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/datasets/client/Client.ts b/src/api/resources/datasets/client/Client.ts index 7438c8b..4a620d3 100644 --- a/src/api/resources/datasets/client/Client.ts +++ b/src/api/resources/datasets/client/Client.ts @@ -81,7 +81,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -217,7 +217,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...(await _maybeEncodedRequest.getHeaders()), @@ -297,7 +297,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -376,7 +376,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -455,7 +455,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/embedJobs/client/Client.ts b/src/api/resources/embedJobs/client/Client.ts index f0704d7..4091a74 100644 --- a/src/api/resources/embedJobs/client/Client.ts +++ b/src/api/resources/embedJobs/client/Client.ts @@ -52,7 +52,7 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -144,7 +144,7 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -235,7 +235,7 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -323,7 +323,7 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/finetuning/client/Client.ts b/src/api/resources/finetuning/client/Client.ts index e65575c..a5211e4 100644 --- a/src/api/resources/finetuning/client/Client.ts +++ b/src/api/resources/finetuning/client/Client.ts @@ -74,7 +74,7 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -186,7 +186,7 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -294,7 +294,7 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -397,7 +397,7 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -510,7 +510,7 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -634,7 +634,7 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -750,7 +750,7 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/models/client/Client.ts b/src/api/resources/models/client/Client.ts index 9c510c3..1da901e 100644 --- a/src/api/resources/models/client/Client.ts +++ b/src/api/resources/models/client/Client.ts @@ -53,7 +53,7 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -157,7 +157,7 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.10.0", + "X-Fern-SDK-Version": "7.10.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/core/form-data-utils/FormDataWrapper.ts b/src/core/form-data-utils/FormDataWrapper.ts index 4974501..cabb161 100644 --- a/src/core/form-data-utils/FormDataWrapper.ts +++ b/src/core/form-data-utils/FormDataWrapper.ts @@ -28,7 +28,7 @@ class FormDataRequestBody { if (this.encoder == null) { await this.setup(); } - return (await import("node:stream")).Readable.from(this.encoder); + return (await import(/* webpackIgnore: true */"node:stream")).Readable.from(this.encoder); } } diff --git a/src/environments.ts b/src/environments.ts index e4b16e4..fabd164 100644 --- a/src/environments.ts +++ b/src/environments.ts @@ -3,7 +3,7 @@ */ export const CohereEnvironment = { - Production: "https://api.cohere.ai/v1", + Production: "https://api.cohere.com/v1", } as const; export type CohereEnvironment = typeof CohereEnvironment.Production; diff --git a/src/serialization/client/requests/ChatRequest.ts b/src/serialization/client/requests/ChatRequest.ts index f1344be..ea6a99c 100644 --- a/src/serialization/client/requests/ChatRequest.ts +++ b/src/serialization/client/requests/ChatRequest.ts @@ -41,6 +41,7 @@ export const ChatRequest: core.serialization.Schema