diff --git a/package.json b/package.json index 75f6005..2888c43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cohere-ai", - "version": "7.9.0", + "version": "7.9.1", "private": false, "repository": "https://github.com/cohere-ai/cohere-typescript", "main": "./index.js", diff --git a/src/Client.ts b/src/Client.ts index 1bacce2..eadebd6 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -53,7 +53,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -63,7 +63,7 @@ export class CohereClient { stream: true, }, responseType: "streaming", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -147,7 +147,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -156,7 +156,7 @@ export class CohereClient { ...(await serializers.ChatRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })), stream: false, }, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -221,7 +221,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -231,7 +231,7 @@ export class CohereClient { stream: true, }, responseType: "streaming", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -316,7 +316,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -325,7 +325,7 @@ export class CohereClient { ...(await serializers.GenerateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })), stream: false, }, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -397,13 +397,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.EmbedRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -476,13 +476,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.RerankRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -584,13 +584,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.ClassifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -665,13 +665,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.SummarizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -741,13 +741,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.TokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -797,7 +797,8 @@ export class CohereClient { * * @example * await cohere.detokenize({ - * tokens: [10104, 12221, 1315, 34, 1420, 69] + * tokens: [10104, 12221, 1315, 34, 1420, 69], + * model: "command" * }) */ public async detokenize( @@ -818,13 +819,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.DetokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { diff --git a/src/api/client/requests/ChatRequest.ts b/src/api/client/requests/ChatRequest.ts index 0830bfc..cb5a316 100644 --- a/src/api/client/requests/ChatRequest.ts +++ b/src/api/client/requests/ChatRequest.ts @@ -27,7 +27,7 @@ export interface ChatRequest { */ message: string; /** - * Defaults to `command`. + * Defaults to `command-r`. * * The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model. * diff --git a/src/api/client/requests/ChatStreamRequest.ts b/src/api/client/requests/ChatStreamRequest.ts index c9e3584..f059b2d 100644 --- a/src/api/client/requests/ChatStreamRequest.ts +++ b/src/api/client/requests/ChatStreamRequest.ts @@ -11,7 +11,7 @@ export interface ChatStreamRequest { */ message: string; /** - * Defaults to `command`. + * Defaults to `command-r`. * * The name of a compatible [Cohere model](https://docs.cohere.com/docs/models) or the ID of a [fine-tuned](https://docs.cohere.com/docs/chat-fine-tuning) model. * diff --git a/src/api/client/requests/DetokenizeRequest.ts b/src/api/client/requests/DetokenizeRequest.ts index 01fa2f5..deb55ec 100644 --- a/src/api/client/requests/DetokenizeRequest.ts +++ b/src/api/client/requests/DetokenizeRequest.ts @@ -5,12 +5,13 @@ /** * @example * { - * tokens: [10104, 12221, 1315, 34, 1420, 69] + * tokens: [10104, 12221, 1315, 34, 1420, 69], + * model: "command" * } */ export interface DetokenizeRequest { /** The list of tokens to be detokenized. */ tokens: number[]; /** An optional parameter to provide the model name. This will ensure that the detokenization is done by the tokenizer used by that model. */ - model?: string; + model: string; } diff --git a/src/api/client/requests/EmbedRequest.ts b/src/api/client/requests/EmbedRequest.ts index b2e6a45..247e275 100644 --- a/src/api/client/requests/EmbedRequest.ts +++ b/src/api/client/requests/EmbedRequest.ts @@ -34,7 +34,7 @@ export interface EmbedRequest { * * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models. * * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models. */ - embeddingTypes?: Cohere.EmbedRequestEmbeddingTypesItem[]; + embeddingTypes?: Cohere.EmbeddingType[]; /** * 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/TokenizeRequest.ts b/src/api/client/requests/TokenizeRequest.ts index 7e9d162..25a8c97 100644 --- a/src/api/client/requests/TokenizeRequest.ts +++ b/src/api/client/requests/TokenizeRequest.ts @@ -13,5 +13,5 @@ export interface TokenizeRequest { /** The string to be tokenized, the minimum text length is 1 character, and the maximum text length is 65536 characters. */ text: string; /** An optional parameter to provide the model name. This will ensure that the tokenization uses the tokenizer used by that model. */ - model?: string; + model: string; } diff --git a/src/api/resources/connectors/client/Client.ts b/src/api/resources/connectors/client/Client.ts index 288d3f4..e02970a 100644 --- a/src/api/resources/connectors/client/Client.ts +++ b/src/api/resources/connectors/client/Client.ts @@ -62,13 +62,13 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -143,13 +143,13 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.CreateConnectorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -220,12 +220,12 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -300,12 +300,12 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -383,13 +383,13 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.UpdateConnectorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -472,13 +472,13 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { diff --git a/src/api/resources/datasets/client/Client.ts b/src/api/resources/datasets/client/Client.ts index 8f138a9..e545a9a 100644 --- a/src/api/resources/datasets/client/Client.ts +++ b/src/api/resources/datasets/client/Client.ts @@ -74,13 +74,13 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -185,14 +185,14 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "multipart/form-data; boundary=" + _request.getBoundary(), queryParameters: _queryParams, body: _request, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -254,12 +254,12 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -321,12 +321,12 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -388,12 +388,12 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { diff --git a/src/api/resources/datasets/client/requests/DatasetsCreateRequest.ts b/src/api/resources/datasets/client/requests/DatasetsCreateRequest.ts index 33f4c6c..554cffd 100644 --- a/src/api/resources/datasets/client/requests/DatasetsCreateRequest.ts +++ b/src/api/resources/datasets/client/requests/DatasetsCreateRequest.ts @@ -10,7 +10,7 @@ export interface DatasetsCreateRequest { */ name: string; /** - * The dataset type, which is used to validate the data. + * The dataset type, which is used to validate the data. Valid types are `embed-input`, `reranker-finetune-input`, `prompt-completion-finetune-input`, `single-label-classification-finetune-input`, `chat-finetune-input`, and `multi-label-classification-finetune-input`. */ type: Cohere.DatasetType; /** diff --git a/src/api/resources/embedJobs/client/Client.ts b/src/api/resources/embedJobs/client/Client.ts index fe81ed6..4e4179f 100644 --- a/src/api/resources/embedJobs/client/Client.ts +++ b/src/api/resources/embedJobs/client/Client.ts @@ -49,12 +49,12 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -129,13 +129,13 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.CreateEmbedJobRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -204,12 +204,12 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -280,12 +280,12 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { diff --git a/src/api/resources/embedJobs/client/requests/CreateEmbedJobRequest.ts b/src/api/resources/embedJobs/client/requests/CreateEmbedJobRequest.ts index 490c0b4..433b816 100644 --- a/src/api/resources/embedJobs/client/requests/CreateEmbedJobRequest.ts +++ b/src/api/resources/embedJobs/client/requests/CreateEmbedJobRequest.ts @@ -30,6 +30,16 @@ export interface CreateEmbedJobRequest { inputType: Cohere.EmbedInputType; /** The name of the embed job. */ name?: string; + /** + * Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types. + * + * * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models. + * * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models. + * * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models. + * * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models. + * * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models. + */ + embeddingTypes?: Cohere.EmbeddingType[]; /** * One of `START|END` to specify how the API will handle inputs longer than the maximum token length. * diff --git a/src/api/resources/finetuning/client/Client.ts b/src/api/resources/finetuning/client/Client.ts index bf98ec9..c6d3f12 100644 --- a/src/api/resources/finetuning/client/Client.ts +++ b/src/api/resources/finetuning/client/Client.ts @@ -71,13 +71,13 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -180,13 +180,13 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", body: await serializers.finetuning.FinetunedModel.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -281,12 +281,12 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -381,12 +381,12 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -490,7 +490,7 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -498,7 +498,7 @@ export class Finetuning { body: await serializers.FinetuningUpdateFinetunedModelRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", }), - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -608,13 +608,13 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { @@ -720,13 +720,13 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { diff --git a/src/api/resources/models/client/Client.ts b/src/api/resources/models/client/Client.ts index 5ef59c2..86204d8 100644 --- a/src/api/resources/models/client/Client.ts +++ b/src/api/resources/models/client/Client.ts @@ -25,6 +25,79 @@ export declare namespace Models { export class Models { constructor(protected readonly _options: Models.Options = {}) {} + /** + * Returns the details of a model, provided its name. + * @throws {@link Cohere.BadRequestError} + * @throws {@link Cohere.TooManyRequestsError} + * @throws {@link Cohere.InternalServerError} + * + * @example + * await cohere.models.get("model") + */ + public async get(model: string, requestOptions?: Models.RequestOptions): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production, + `models/${model}` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Client-Name": + (await core.Supplier.get(this._options.clientName)) != null + ? await core.Supplier.get(this._options.clientName) + : undefined, + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "cohere-ai", + "X-Fern-SDK-Version": "7.9.1", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + }, + contentType: "application/json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, + maxRetries: requestOptions?.maxRetries, + }); + if (_response.ok) { + return await serializers.GetModelResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Cohere.BadRequestError(_response.error.body); + case 429: + throw new Cohere.TooManyRequestsError(_response.error.body); + case 500: + throw new Cohere.InternalServerError(_response.error.body); + default: + throw new errors.CohereError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.CohereError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.CohereTimeoutError(); + case "unknown": + throw new errors.CohereError({ + message: _response.error.errorMessage, + }); + } + } + /** * Returns a list of models available for use. The list contains models from Cohere as well as your fine-tuned models. * @throws {@link Cohere.TooManyRequestsError} @@ -64,13 +137,13 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.9.0", + "X-Fern-SDK-Version": "7.9.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", queryParameters: _queryParams, - timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 300000, maxRetries: requestOptions?.maxRetries, }); if (_response.ok) { diff --git a/src/api/types/ChatRequestPromptOverride.ts b/src/api/types/ChatRequestPromptOverride.ts deleted file mode 100644 index 1f5f9d6..0000000 --- a/src/api/types/ChatRequestPromptOverride.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * (internal) Overrides specified parts of the default Chat or RAG preamble. It is recommended that these options only be used in specific scenarios where the defaults are not adequate. - */ -export interface ChatRequestPromptOverride { - preamble?: unknown; - taskDescription?: unknown; - styleGuide?: unknown; -} diff --git a/src/api/types/ChatSearchResult.ts b/src/api/types/ChatSearchResult.ts index dd40c11..b2ffd32 100644 --- a/src/api/types/ChatSearchResult.ts +++ b/src/api/types/ChatSearchResult.ts @@ -5,9 +5,13 @@ import * as Cohere from ".."; export interface ChatSearchResult { - searchQuery: Cohere.ChatSearchQuery; + searchQuery?: Cohere.ChatSearchQuery; /** The connector from which this result comes from. */ connector: Cohere.ChatSearchResultConnector; /** Identifiers of documents found by this search query. */ documentIds: string[]; + /** An error message if the search failed. */ + errorMessage?: string; + /** Whether a chat request should continue or not if the request to this connector fails. */ + continueOnFailure?: boolean; } diff --git a/src/api/types/ChatSearchResultsEvent.ts b/src/api/types/ChatSearchResultsEvent.ts index aa727d2..10e6de9 100644 --- a/src/api/types/ChatSearchResultsEvent.ts +++ b/src/api/types/ChatSearchResultsEvent.ts @@ -8,5 +8,5 @@ export interface ChatSearchResultsEvent extends Cohere.ChatStreamEvent { /** Conducted searches and the ids of documents retrieved from each of them. */ searchResults?: Cohere.ChatSearchResult[]; /** Documents fetched from searches or provided by the user. */ - documents: Cohere.ChatDocument[]; + documents?: Cohere.ChatDocument[]; } diff --git a/src/api/types/ChatStreamRequestPromptOverride.ts b/src/api/types/ChatStreamRequestPromptOverride.ts deleted file mode 100644 index 2a1288c..0000000 --- a/src/api/types/ChatStreamRequestPromptOverride.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * (internal) Overrides specified parts of the default Chat or RAG preamble. It is recommended that these options only be used in specific scenarios where the defaults are not adequate. - */ -export interface ChatStreamRequestPromptOverride { - preamble?: unknown; - taskDescription?: unknown; - styleGuide?: unknown; -} diff --git a/src/api/types/EmbedRequestEmbeddingTypesItem.ts b/src/api/types/EmbeddingType.ts similarity index 57% rename from src/api/types/EmbedRequestEmbeddingTypesItem.ts rename to src/api/types/EmbeddingType.ts index 54bc969..1260d14 100644 --- a/src/api/types/EmbedRequestEmbeddingTypesItem.ts +++ b/src/api/types/EmbeddingType.ts @@ -2,9 +2,9 @@ * This file was auto-generated by Fern from our API Definition. */ -export type EmbedRequestEmbeddingTypesItem = "float" | "int8" | "uint8" | "binary" | "ubinary"; +export type EmbeddingType = "float" | "int8" | "uint8" | "binary" | "ubinary"; -export const EmbedRequestEmbeddingTypesItem = { +export const EmbeddingType = { Float: "float", Int8: "int8", Uint8: "uint8", diff --git a/src/api/types/Model.ts b/src/api/types/GetModelResponse.ts similarity index 96% rename from src/api/types/Model.ts rename to src/api/types/GetModelResponse.ts index 9419d5f..e7ee375 100644 --- a/src/api/types/Model.ts +++ b/src/api/types/GetModelResponse.ts @@ -7,7 +7,7 @@ import * as Cohere from ".."; /** * Contains information about the model and which API endpoints it can be used with. */ -export interface Model { +export interface GetModelResponse { /** Specify this name in the `model` parameter of API requests to use your chosen model. */ name?: string; /** The API endpoints that the model is compatible with. */ diff --git a/src/api/types/ListModelsResponse.ts b/src/api/types/ListModelsResponse.ts index 546b2ad..cb97d60 100644 --- a/src/api/types/ListModelsResponse.ts +++ b/src/api/types/ListModelsResponse.ts @@ -5,7 +5,7 @@ import * as Cohere from ".."; export interface ListModelsResponse { - models: Cohere.Model[]; + models: Cohere.GetModelResponse[]; /** A token to retrieve the next page of results. Provide in the page_token parameter of the next request. */ nextPageToken?: string; } diff --git a/src/api/types/ToolParameterDefinitionsValue.ts b/src/api/types/ToolParameterDefinitionsValue.ts index e72ba7b..1e3a347 100644 --- a/src/api/types/ToolParameterDefinitionsValue.ts +++ b/src/api/types/ToolParameterDefinitionsValue.ts @@ -4,7 +4,7 @@ export interface ToolParameterDefinitionsValue { /** The description of the parameter. */ - description: string; + description?: string; /** The type of the parameter. Must be a valid Python type. */ type: string; /** Denotes whether the parameter is always present (required) or not. Defaults to not required. */ diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 488c5be..dbb0fdb 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,18 +1,15 @@ export * from "./ChatStreamRequestPromptTruncation"; export * from "./ChatStreamRequestCitationQuality"; export * from "./ChatStreamRequestConnectorsSearchOptions"; -export * from "./ChatStreamRequestPromptOverride"; export * from "./ChatStreamRequestToolResultsItem"; export * from "./ChatRequestPromptTruncation"; export * from "./ChatRequestCitationQuality"; export * from "./ChatRequestConnectorsSearchOptions"; -export * from "./ChatRequestPromptOverride"; export * from "./ChatRequestToolResultsItem"; export * from "./GenerateStreamRequestTruncate"; export * from "./GenerateStreamRequestReturnLikelihoods"; export * from "./GenerateRequestTruncate"; export * from "./GenerateRequestReturnLikelihoods"; -export * from "./EmbedRequestEmbeddingTypesItem"; export * from "./EmbedRequestTruncate"; export * from "./EmbedResponse"; export * from "./RerankRequestDocumentsItemText"; @@ -68,6 +65,7 @@ export * from "./GenerateStreamEnd"; export * from "./GenerateStreamError"; export * from "./GenerateStreamedResponse"; export * from "./EmbedInputType"; +export * from "./EmbeddingType"; export * from "./EmbedFloatsResponse"; export * from "./EmbedByTypeResponseEmbeddings"; export * from "./EmbedByTypeResponse"; @@ -101,5 +99,5 @@ export * from "./DeleteConnectorResponse"; export * from "./UpdateConnectorResponse"; export * from "./OAuthAuthorizeResponse"; export * from "./CompatibleEndpoint"; -export * from "./Model"; +export * from "./GetModelResponse"; export * from "./ListModelsResponse"; diff --git a/src/serialization/client/requests/DetokenizeRequest.ts b/src/serialization/client/requests/DetokenizeRequest.ts index 5984b7c..e40493e 100644 --- a/src/serialization/client/requests/DetokenizeRequest.ts +++ b/src/serialization/client/requests/DetokenizeRequest.ts @@ -9,12 +9,12 @@ import * as core from "../../../core"; export const DetokenizeRequest: core.serialization.Schema = core.serialization.object({ tokens: core.serialization.list(core.serialization.number()), - model: core.serialization.string().optional(), + model: core.serialization.string(), }); export declare namespace DetokenizeRequest { interface Raw { tokens: number[]; - model?: string | null; + model: string; } } diff --git a/src/serialization/client/requests/EmbedRequest.ts b/src/serialization/client/requests/EmbedRequest.ts index aa143b9..448a22d 100644 --- a/src/serialization/client/requests/EmbedRequest.ts +++ b/src/serialization/client/requests/EmbedRequest.ts @@ -17,7 +17,7 @@ export const EmbedRequest: core.serialization.Schema (await import("../..")).EmbedRequestEmbeddingTypesItem)) + .list(core.serialization.lazy(async () => (await import("../..")).EmbeddingType)) .optional() ), truncate: core.serialization.lazy(async () => (await import("../..")).EmbedRequestTruncate).optional(), @@ -28,7 +28,7 @@ export declare namespace EmbedRequest { texts: string[]; model?: string | null; input_type?: serializers.EmbedInputType.Raw | null; - embedding_types?: serializers.EmbedRequestEmbeddingTypesItem.Raw[] | null; + embedding_types?: serializers.EmbeddingType.Raw[] | null; truncate?: serializers.EmbedRequestTruncate.Raw | null; } } diff --git a/src/serialization/client/requests/TokenizeRequest.ts b/src/serialization/client/requests/TokenizeRequest.ts index ca1fa76..6e81dc0 100644 --- a/src/serialization/client/requests/TokenizeRequest.ts +++ b/src/serialization/client/requests/TokenizeRequest.ts @@ -9,12 +9,12 @@ import * as core from "../../../core"; export const TokenizeRequest: core.serialization.Schema = core.serialization.object({ text: core.serialization.string(), - model: core.serialization.string().optional(), + model: core.serialization.string(), }); export declare namespace TokenizeRequest { interface Raw { text: string; - model?: string | null; + model: string; } } diff --git a/src/serialization/resources/embedJobs/client/requests/CreateEmbedJobRequest.ts b/src/serialization/resources/embedJobs/client/requests/CreateEmbedJobRequest.ts index e6efca8..2f9f178 100644 --- a/src/serialization/resources/embedJobs/client/requests/CreateEmbedJobRequest.ts +++ b/src/serialization/resources/embedJobs/client/requests/CreateEmbedJobRequest.ts @@ -17,6 +17,12 @@ export const CreateEmbedJobRequest: core.serialization.Schema< core.serialization.lazy(async () => (await import("../../../..")).EmbedInputType) ), name: core.serialization.string().optional(), + embeddingTypes: core.serialization.property( + "embedding_types", + core.serialization + .list(core.serialization.lazy(async () => (await import("../../../..")).EmbeddingType)) + .optional() + ), truncate: core.serialization .lazy(async () => (await import("../../../..")).CreateEmbedJobRequestTruncate) .optional(), @@ -28,6 +34,7 @@ export declare namespace CreateEmbedJobRequest { dataset_id: string; input_type: serializers.EmbedInputType.Raw; name?: string | null; + embedding_types?: serializers.EmbeddingType.Raw[] | null; truncate?: serializers.CreateEmbedJobRequestTruncate.Raw | null; } } diff --git a/src/serialization/types/ChatRequestPromptOverride.ts b/src/serialization/types/ChatRequestPromptOverride.ts deleted file mode 100644 index add9a90..0000000 --- a/src/serialization/types/ChatRequestPromptOverride.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from ".."; -import * as Cohere from "../../api"; -import * as core from "../../core"; - -export const ChatRequestPromptOverride: core.serialization.ObjectSchema< - serializers.ChatRequestPromptOverride.Raw, - Cohere.ChatRequestPromptOverride -> = core.serialization.object({ - preamble: core.serialization.unknown().optional(), - taskDescription: core.serialization.property("task_description", core.serialization.unknown().optional()), - styleGuide: core.serialization.property("style_guide", core.serialization.unknown().optional()), -}); - -export declare namespace ChatRequestPromptOverride { - interface Raw { - preamble?: unknown | null; - task_description?: unknown | null; - style_guide?: unknown | null; - } -} diff --git a/src/serialization/types/ChatSearchResult.ts b/src/serialization/types/ChatSearchResult.ts index b872c9f..8198b07 100644 --- a/src/serialization/types/ChatSearchResult.ts +++ b/src/serialization/types/ChatSearchResult.ts @@ -12,16 +12,20 @@ export const ChatSearchResult: core.serialization.ObjectSchema< > = core.serialization.object({ searchQuery: core.serialization.property( "search_query", - core.serialization.lazyObject(async () => (await import("..")).ChatSearchQuery) + core.serialization.lazyObject(async () => (await import("..")).ChatSearchQuery).optional() ), connector: core.serialization.lazyObject(async () => (await import("..")).ChatSearchResultConnector), documentIds: core.serialization.property("document_ids", core.serialization.list(core.serialization.string())), + errorMessage: core.serialization.property("error_message", core.serialization.string().optional()), + continueOnFailure: core.serialization.property("continue_on_failure", core.serialization.boolean().optional()), }); export declare namespace ChatSearchResult { interface Raw { - search_query: serializers.ChatSearchQuery.Raw; + search_query?: serializers.ChatSearchQuery.Raw | null; connector: serializers.ChatSearchResultConnector.Raw; document_ids: string[]; + error_message?: string | null; + continue_on_failure?: boolean | null; } } diff --git a/src/serialization/types/ChatSearchResultsEvent.ts b/src/serialization/types/ChatSearchResultsEvent.ts index 1a06709..4dedcf7 100644 --- a/src/serialization/types/ChatSearchResultsEvent.ts +++ b/src/serialization/types/ChatSearchResultsEvent.ts @@ -17,13 +17,15 @@ export const ChatSearchResultsEvent: core.serialization.ObjectSchema< .list(core.serialization.lazyObject(async () => (await import("..")).ChatSearchResult)) .optional() ), - documents: core.serialization.list(core.serialization.lazy(async () => (await import("..")).ChatDocument)), + documents: core.serialization + .list(core.serialization.lazy(async () => (await import("..")).ChatDocument)) + .optional(), }) .extend(core.serialization.lazyObject(async () => (await import("..")).ChatStreamEvent)); export declare namespace ChatSearchResultsEvent { interface Raw extends serializers.ChatStreamEvent.Raw { search_results?: serializers.ChatSearchResult.Raw[] | null; - documents: serializers.ChatDocument.Raw[]; + documents?: serializers.ChatDocument.Raw[] | null; } } diff --git a/src/serialization/types/ChatStreamRequestPromptOverride.ts b/src/serialization/types/ChatStreamRequestPromptOverride.ts deleted file mode 100644 index a44aa2d..0000000 --- a/src/serialization/types/ChatStreamRequestPromptOverride.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from ".."; -import * as Cohere from "../../api"; -import * as core from "../../core"; - -export const ChatStreamRequestPromptOverride: core.serialization.ObjectSchema< - serializers.ChatStreamRequestPromptOverride.Raw, - Cohere.ChatStreamRequestPromptOverride -> = core.serialization.object({ - preamble: core.serialization.unknown().optional(), - taskDescription: core.serialization.property("task_description", core.serialization.unknown().optional()), - styleGuide: core.serialization.property("style_guide", core.serialization.unknown().optional()), -}); - -export declare namespace ChatStreamRequestPromptOverride { - interface Raw { - preamble?: unknown | null; - task_description?: unknown | null; - style_guide?: unknown | null; - } -} diff --git a/src/serialization/types/EmbedRequestEmbeddingTypesItem.ts b/src/serialization/types/EmbedRequestEmbeddingTypesItem.ts deleted file mode 100644 index d0438cf..0000000 --- a/src/serialization/types/EmbedRequestEmbeddingTypesItem.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from ".."; -import * as Cohere from "../../api"; -import * as core from "../../core"; - -export const EmbedRequestEmbeddingTypesItem: core.serialization.Schema< - serializers.EmbedRequestEmbeddingTypesItem.Raw, - Cohere.EmbedRequestEmbeddingTypesItem -> = core.serialization.enum_(["float", "int8", "uint8", "binary", "ubinary"]); - -export declare namespace EmbedRequestEmbeddingTypesItem { - type Raw = "float" | "int8" | "uint8" | "binary" | "ubinary"; -} diff --git a/src/serialization/types/EmbeddingType.ts b/src/serialization/types/EmbeddingType.ts new file mode 100644 index 0000000..6a111d2 --- /dev/null +++ b/src/serialization/types/EmbeddingType.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from ".."; +import * as Cohere from "../../api"; +import * as core from "../../core"; + +export const EmbeddingType: core.serialization.Schema = + core.serialization.enum_(["float", "int8", "uint8", "binary", "ubinary"]); + +export declare namespace EmbeddingType { + type Raw = "float" | "int8" | "uint8" | "binary" | "ubinary"; +} diff --git a/src/serialization/types/Model.ts b/src/serialization/types/GetModelResponse.ts similarity index 82% rename from src/serialization/types/Model.ts rename to src/serialization/types/GetModelResponse.ts index 33da419..0a4ddb3 100644 --- a/src/serialization/types/Model.ts +++ b/src/serialization/types/GetModelResponse.ts @@ -6,7 +6,10 @@ import * as serializers from ".."; import * as Cohere from "../../api"; import * as core from "../../core"; -export const Model: core.serialization.ObjectSchema = core.serialization.object({ +export const GetModelResponse: core.serialization.ObjectSchema< + serializers.GetModelResponse.Raw, + Cohere.GetModelResponse +> = core.serialization.object({ name: core.serialization.string().optional(), endpoints: core.serialization .list(core.serialization.lazy(async () => (await import("..")).CompatibleEndpoint)) @@ -17,7 +20,7 @@ export const Model: core.serialization.ObjectSchema = core.serialization.object({ - models: core.serialization.list(core.serialization.lazyObject(async () => (await import("..")).Model)), + models: core.serialization.list(core.serialization.lazyObject(async () => (await import("..")).GetModelResponse)), nextPageToken: core.serialization.property("next_page_token", core.serialization.string().optional()), }); export declare namespace ListModelsResponse { interface Raw { - models: serializers.Model.Raw[]; + models: serializers.GetModelResponse.Raw[]; next_page_token?: string | null; } } diff --git a/src/serialization/types/ToolParameterDefinitionsValue.ts b/src/serialization/types/ToolParameterDefinitionsValue.ts index c8bf97c..e8995e0 100644 --- a/src/serialization/types/ToolParameterDefinitionsValue.ts +++ b/src/serialization/types/ToolParameterDefinitionsValue.ts @@ -10,14 +10,14 @@ export const ToolParameterDefinitionsValue: core.serialization.ObjectSchema< serializers.ToolParameterDefinitionsValue.Raw, Cohere.ToolParameterDefinitionsValue > = core.serialization.object({ - description: core.serialization.string(), + description: core.serialization.string().optional(), type: core.serialization.string(), required: core.serialization.boolean().optional(), }); export declare namespace ToolParameterDefinitionsValue { interface Raw { - description: string; + description?: string | null; type: string; required?: boolean | null; } diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 488c5be..dbb0fdb 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,18 +1,15 @@ export * from "./ChatStreamRequestPromptTruncation"; export * from "./ChatStreamRequestCitationQuality"; export * from "./ChatStreamRequestConnectorsSearchOptions"; -export * from "./ChatStreamRequestPromptOverride"; export * from "./ChatStreamRequestToolResultsItem"; export * from "./ChatRequestPromptTruncation"; export * from "./ChatRequestCitationQuality"; export * from "./ChatRequestConnectorsSearchOptions"; -export * from "./ChatRequestPromptOverride"; export * from "./ChatRequestToolResultsItem"; export * from "./GenerateStreamRequestTruncate"; export * from "./GenerateStreamRequestReturnLikelihoods"; export * from "./GenerateRequestTruncate"; export * from "./GenerateRequestReturnLikelihoods"; -export * from "./EmbedRequestEmbeddingTypesItem"; export * from "./EmbedRequestTruncate"; export * from "./EmbedResponse"; export * from "./RerankRequestDocumentsItemText"; @@ -68,6 +65,7 @@ export * from "./GenerateStreamEnd"; export * from "./GenerateStreamError"; export * from "./GenerateStreamedResponse"; export * from "./EmbedInputType"; +export * from "./EmbeddingType"; export * from "./EmbedFloatsResponse"; export * from "./EmbedByTypeResponseEmbeddings"; export * from "./EmbedByTypeResponse"; @@ -101,5 +99,5 @@ export * from "./DeleteConnectorResponse"; export * from "./UpdateConnectorResponse"; export * from "./OAuthAuthorizeResponse"; export * from "./CompatibleEndpoint"; -export * from "./Model"; +export * from "./GetModelResponse"; export * from "./ListModelsResponse"; diff --git a/yarn.lock b/yarn.lock index 87f556f..5507d21 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19,22 +19,22 @@ picocolors "^1.0.0" "@babel/compat-data@^7.23.5": - version "7.24.1" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.1.tgz#31c1f66435f2a9c329bb5716a6d6186c516c3742" - integrity sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA== + version "7.24.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.4.tgz#6f102372e9094f25d908ca0d34fc74c74606059a" + integrity sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ== "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": - version "7.24.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.3.tgz#568864247ea10fbd4eff04dda1e05f9e2ea985c3" - integrity sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ== + version "7.24.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.4.tgz#1f758428e88e0d8c563874741bc4ffc4f71a4717" + integrity sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg== dependencies: "@ampproject/remapping" "^2.2.0" "@babel/code-frame" "^7.24.2" - "@babel/generator" "^7.24.1" + "@babel/generator" "^7.24.4" "@babel/helper-compilation-targets" "^7.23.6" "@babel/helper-module-transforms" "^7.23.3" - "@babel/helpers" "^7.24.1" - "@babel/parser" "^7.24.1" + "@babel/helpers" "^7.24.4" + "@babel/parser" "^7.24.4" "@babel/template" "^7.24.0" "@babel/traverse" "^7.24.1" "@babel/types" "^7.24.0" @@ -44,10 +44,10 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.24.1", "@babel/generator@^7.7.2": - version "7.24.1" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.1.tgz#e67e06f68568a4ebf194d1c6014235344f0476d0" - integrity sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A== +"@babel/generator@^7.24.1", "@babel/generator@^7.24.4", "@babel/generator@^7.7.2": + version "7.24.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.4.tgz#1fc55532b88adf952025d5d2d1e71f946cb1c498" + integrity sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw== dependencies: "@babel/types" "^7.24.0" "@jridgewell/gen-mapping" "^0.3.5" @@ -137,10 +137,10 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== -"@babel/helpers@^7.24.1": - version "7.24.1" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.1.tgz#183e44714b9eba36c3038e442516587b1e0a1a94" - integrity sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg== +"@babel/helpers@^7.24.4": + version "7.24.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.4.tgz#dc00907fd0d95da74563c142ef4cd21f2cb856b6" + integrity sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw== dependencies: "@babel/template" "^7.24.0" "@babel/traverse" "^7.24.1" @@ -156,10 +156,10 @@ js-tokens "^4.0.0" picocolors "^1.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.24.0", "@babel/parser@^7.24.1": - version "7.24.1" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.1.tgz#1e416d3627393fab1cb5b0f2f1796a100ae9133a" - integrity sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.24.0", "@babel/parser@^7.24.1", "@babel/parser@^7.24.4": + version "7.24.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.4.tgz#234487a110d89ad5a3ed4a8a566c36b9453e8c88" + integrity sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg== "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -633,9 +633,9 @@ form-data "^4.0.0" "@types/node@*": - version "20.11.30" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.30.tgz#9c33467fc23167a347e73834f788f4b9f399d66f" - integrity sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw== + version "20.12.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.4.tgz#af5921bd75ccdf3a3d8b3fa75bf3d3359268cd11" + integrity sha512-E+Fa9z3wSQpzgYQdYmme5X3OTuejnnTx88A6p6vkkJosR3KBz+HpE3kqNm98VE6cfLFcISx7zW7MsJkH6KwbTw== dependencies: undici-types "~5.26.4" @@ -858,9 +858,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001587: - version "1.0.30001599" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001599.tgz#571cf4f3f1506df9bf41fcbb6d10d5d017817bce" - integrity sha512-LRAQHZ4yT1+f9LemSMeqdMpMxZcc4RMWdj4tiFe3G8tNkWK+E58g+/tzotb5cU6TbcVJLr4fySiAW7XmxQvZQA== + version "1.0.30001605" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001605.tgz#ca12d7330dd8bcb784557eb9aa64f0037870d9d6" + integrity sha512-nXwGlFWo34uliI9z3n6Qc0wZaf7zaZWA1CPZ169La5mV3I/gem7bst0vr5XQH5TJXZIMfDeZyOrZnSlVzKxxHQ== chalk@^2.4.2: version "2.4.2" @@ -1018,9 +1018,9 @@ diff-sequences@^29.6.3: integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== electron-to-chromium@^1.4.668: - version "1.4.714" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.714.tgz#708fdc8d5bdec824e41fe8b1b0e10af508a10946" - integrity sha512-OfnVHt+nMRH9Ua5koH/2gKlCAXbG+u1yXwLKyBVqNboBV34ZTwb846RUe8K5mtE1uhz0BXoMarZ13JCQr+sBtQ== + version "1.4.726" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.726.tgz#9ca95f19e9a0d63675e838b24681182203e40a30" + integrity sha512-xtjfBXn53RORwkbyKvDfTajtnTp0OJoPOIBzXvkNbb7+YYvCHJflba3L7Txyx/6Fov3ov2bGPr/n5MTixmPhdQ== emittery@^0.13.1: version "0.13.1"