From 5d51ad7975e695400082d99020977a1cddc89e07 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 13:15:20 -0500 Subject: [PATCH] :herb: Fern Regeneration -- February 1, 2024 (#129) * SDK regeneration * Make evalData optional * Add _queryParams --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: billytrend-cohere <144115527+billytrend-cohere@users.noreply.github.com> --- package.json | 2 +- src/Client.ts | 95 ++++++++++++++----- src/api/client/requests/ChatRequest.ts | 28 +++++- src/api/client/requests/ChatStreamRequest.ts | 17 ++++ src/api/client/requests/ClassifyRequest.ts | 36 ++++++- src/api/client/requests/DetokenizeRequest.ts | 2 +- src/api/client/requests/EmbedRequest.ts | 2 +- src/api/client/requests/RerankRequest.ts | 3 +- src/api/client/requests/SummarizeRequest.ts | 2 +- src/api/client/requests/TokenizeRequest.ts | 3 +- src/api/resources/connectors/client/Client.ts | 12 +-- src/api/resources/datasets/client/Client.ts | 10 +- .../datasets/types/DatasetsGetResponse.ts | 2 +- src/api/resources/embedJobs/client/Client.ts | 8 +- ...uestExamplesItem.ts => ClassifyExample.ts} | 2 +- .../types/EmbedRequestEmbeddingTypesItem.ts | 13 +++ src/api/types/ParseInfo.ts | 8 ++ src/api/types/index.ts | 4 +- .../client/requests/ChatRequest.ts | 6 ++ .../client/requests/ChatStreamRequest.ts | 6 ++ .../client/requests/ClassifyRequest.ts | 4 +- .../client/requests/EmbedRequest.ts | 6 +- .../datasets/types/DatasetsGetResponse.ts | 4 +- src/serialization/types/ClassifyExample.ts | 20 ++++ .../types/ClassifyRequestExamplesItem.ts | 22 ----- .../types/EmbedRequestEmbeddingTypesItem.ts | 16 ++++ src/serialization/types/ParseInfo.ts | 20 ++++ src/serialization/types/index.ts | 4 +- yarn.lock | 6 +- 29 files changed, 274 insertions(+), 89 deletions(-) rename src/api/types/{ClassifyRequestExamplesItem.ts => ClassifyExample.ts} (70%) create mode 100644 src/api/types/EmbedRequestEmbeddingTypesItem.ts create mode 100644 src/api/types/ParseInfo.ts create mode 100644 src/serialization/types/ClassifyExample.ts delete mode 100644 src/serialization/types/ClassifyRequestExamplesItem.ts create mode 100644 src/serialization/types/EmbedRequestEmbeddingTypesItem.ts create mode 100644 src/serialization/types/ParseInfo.ts diff --git a/package.json b/package.json index 0a44277..b3eae16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cohere-ai", - "version": "7.7.4", + "version": "7.7.5", "private": false, "repository": "https://github.com/cohere-ai/cohere-typescript", "main": "./index.js", diff --git a/src/Client.ts b/src/Client.ts index 132e9d7..7ec53cc 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -52,10 +52,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", - body: await serializers.ChatStreamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: { + ...(await serializers.ChatStreamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })), + stream: true, + }, responseType: "streaming", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, @@ -105,17 +108,18 @@ export class CohereClient { * * @example * await cohere.chat({ - * message: "string", + * message: "Can you give me a global market overview of solar panels?", * stream: false, * chatHistory: [{ * role: Cohere.ChatMessageRole.Chatbot, - * message: "string" + * message: "Hi!" + * }, { + * role: Cohere.ChatMessageRole.Chatbot, + * message: "How can I help you today?" * }], * promptTruncation: Cohere.ChatRequestPromptTruncation.Off, - * connectors: [{ - * id: "string" - * }], * citationQuality: Cohere.ChatRequestCitationQuality.Fast, + * temperature: 0.3, * searchOptions: {}, * promptOverride: {} * }) @@ -138,10 +142,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", - body: await serializers.ChatRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: { + ...(await serializers.ChatRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })), + stream: false, + }, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, }); @@ -198,10 +205,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", - body: await serializers.GenerateStreamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: { + ...(await serializers.GenerateStreamRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })), + stream: true, + }, responseType: "streaming", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, @@ -283,10 +293,13 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", - body: await serializers.GenerateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), + body: { + ...(await serializers.GenerateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" })), + stream: false, + }, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, }); @@ -356,7 +369,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", body: await serializers.EmbedRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -407,7 +420,8 @@ export class CohereClient { * * @example * await cohere.rerank({ - * query: "string", + * model: "rerank-english-v2.0", + * query: "What is the capital of the United States?", * documents: [] * }) */ @@ -429,7 +443,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", body: await serializers.RerankRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -476,8 +490,38 @@ export class CohereClient { * * @example * await cohere.classify({ - * inputs: [], - * examples: [{}], + * inputs: ["Confirm your email address", "hey i need u to send some $"], + * examples: [{ + * text: "Dermatologists don't like her!", + * label: "Spam" + * }, { + * text: "Hello, open to this?", + * label: "Spam" + * }, { + * text: "I need help please wire me $1000 right now", + * label: "Spam" + * }, { + * text: "Nice to know you ;)", + * label: "Spam" + * }, { + * text: "Please help me?", + * label: "Spam" + * }, { + * text: "Your parcel will be delivered today", + * label: "Not spam" + * }, { + * text: "Review changes to our Terms and Conditions", + * label: "Not spam" + * }, { + * text: "Weekly sync notes", + * label: "Not spam" + * }, { + * text: "Re: Follow up from today\u2019s meeting", + * label: "Not spam" + * }, { + * text: "Pre-read for tomorrow", + * label: "Not spam" + * }], * preset: "my-preset-a58sbd", * truncate: Cohere.ClassifyRequestTruncate.None * }) @@ -500,7 +544,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", body: await serializers.ClassifyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -551,7 +595,7 @@ export class CohereClient { * * @example * await cohere.summarize({ - * text: "string", + * text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. It may be made from milk or cream and is flavoured with a sweetener, either sugar or an alternative, and a spice, such as cocoa or vanilla, or with fruit such as strawberries or peaches. It can also be made by whisking a flavored cream base and liquid nitrogen together. Food coloring is sometimes added, in addition to stabilizers. The mixture is cooled below the freezing point of water and stirred to incorporate air spaces and to prevent detectable ice crystals from forming. The result is a smooth, semi-solid foam that is solid at very low temperatures (below 2 \u00B0C or 35 \u00B0F). It becomes more malleable as its temperature increases.\n\nThe meaning of the name \"ice cream\" varies from one country to another. In some countries, such as the United States, \"ice cream\" applies only to a specific variety, and most governments regulate the commercial use of the various terms according to the relative quantities of the main ingredients, notably the amount of cream. Products that do not meet the criteria to be called ice cream are sometimes labelled \"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, one word is used fo\r all variants. Analogues made from dairy alternatives, such as goat's or sheep's milk, or milk substitutes (e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are lactose intolerant, allergic to dairy protein or vegan.", * length: Cohere.SummarizeRequestLength.Short, * format: Cohere.SummarizeRequestFormat.Paragraph, * extractiveness: Cohere.SummarizeRequestExtractiveness.Low @@ -575,7 +619,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", body: await serializers.SummarizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -621,7 +665,8 @@ export class CohereClient { * * @example * await cohere.tokenize({ - * text: "string" + * text: "tokenize me! :D", + * model: "command" * }) */ public async tokenize( @@ -642,7 +687,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", body: await serializers.TokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -693,7 +738,7 @@ export class CohereClient { * * @example * await cohere.detokenize({ - * tokens: [] + * tokens: [10104, 12221, 1315, 34, 1420, 69] * }) */ public async detokenize( @@ -714,7 +759,7 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", body: await serializers.DetokenizeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), diff --git a/src/api/client/requests/ChatRequest.ts b/src/api/client/requests/ChatRequest.ts index 7ff4586..7af2bf3 100644 --- a/src/api/client/requests/ChatRequest.ts +++ b/src/api/client/requests/ChatRequest.ts @@ -7,17 +7,18 @@ import * as Cohere from "../.."; /** * @example * { - * message: "string", + * message: "Can you give me a global market overview of solar panels?", * stream: false, * chatHistory: [{ * role: Cohere.ChatMessageRole.Chatbot, - * message: "string" + * message: "Hi!" + * }, { + * role: Cohere.ChatMessageRole.Chatbot, + * message: "How can I help you today?" * }], * promptTruncation: Cohere.ChatRequestPromptTruncation.Off, - * connectors: [{ - * id: "string" - * }], * citationQuality: Cohere.ChatRequestCitationQuality.Fast, + * temperature: 0.3, * searchOptions: {}, * promptOverride: {} * } @@ -101,6 +102,23 @@ export interface ChatRequest { * */ temperature?: number; + /** + * The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. + * + */ + maxTokens?: number; + /** + * Ensures only the top `k` most likely tokens are considered for generation at each step. + * Defaults to `0`, min value of `0`, max value of `500`. + * + */ + k?: number; + /** + * Ensures that only the most likely tokens, with total probability mass of `p`, are considered for generation at each step. If both `k` and `p` are enabled, `p` acts after `k`. + * Defaults to `0.75`. min value of `0.01`, max value of `0.99`. + * + */ + p?: number; /** * Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation. * diff --git a/src/api/client/requests/ChatStreamRequest.ts b/src/api/client/requests/ChatStreamRequest.ts index 5b6155e..84d4b44 100644 --- a/src/api/client/requests/ChatStreamRequest.ts +++ b/src/api/client/requests/ChatStreamRequest.ts @@ -83,6 +83,23 @@ export interface ChatStreamRequest { * */ temperature?: number; + /** + * The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations. + * + */ + maxTokens?: number; + /** + * Ensures only the top `k` most likely tokens are considered for generation at each step. + * Defaults to `0`, min value of `0`, max value of `500`. + * + */ + k?: number; + /** + * Ensures that only the most likely tokens, with total probability mass of `p`, are considered for generation at each step. If both `k` and `p` are enabled, `p` acts after `k`. + * Defaults to `0.75`. min value of `0.01`, max value of `0.99`. + * + */ + p?: number; /** * Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation. * diff --git a/src/api/client/requests/ClassifyRequest.ts b/src/api/client/requests/ClassifyRequest.ts index 89f1cc2..0d85869 100644 --- a/src/api/client/requests/ClassifyRequest.ts +++ b/src/api/client/requests/ClassifyRequest.ts @@ -7,8 +7,38 @@ import * as Cohere from "../.."; /** * @example * { - * inputs: [], - * examples: [{}], + * inputs: ["Confirm your email address", "hey i need u to send some $"], + * examples: [{ + * text: "Dermatologists don't like her!", + * label: "Spam" + * }, { + * text: "Hello, open to this?", + * label: "Spam" + * }, { + * text: "I need help please wire me $1000 right now", + * label: "Spam" + * }, { + * text: "Nice to know you ;)", + * label: "Spam" + * }, { + * text: "Please help me?", + * label: "Spam" + * }, { + * text: "Your parcel will be delivered today", + * label: "Not spam" + * }, { + * text: "Review changes to our Terms and Conditions", + * label: "Not spam" + * }, { + * text: "Weekly sync notes", + * label: "Not spam" + * }, { + * text: "Re: Follow up from today\u2019s meeting", + * label: "Not spam" + * }, { + * text: "Pre-read for tomorrow", + * label: "Not spam" + * }], * preset: "my-preset-a58sbd", * truncate: Cohere.ClassifyRequestTruncate.None * } @@ -24,7 +54,7 @@ export interface ClassifyRequest { * An array of examples to provide context to the model. Each example is a text string and its associated label/class. Each unique label requires at least 2 examples associated with it; the maximum number of examples is 2500, and each example has a maximum length of 512 tokens. The values should be structured as `{text: "...",label: "..."}`. * Note: [Fine-tuned Models](https://docs.cohere.com/docs/classify-fine-tuning) trained on classification examples don't require the `examples` parameter to be passed in explicitly. */ - examples: Cohere.ClassifyRequestExamplesItem[]; + 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. */ diff --git a/src/api/client/requests/DetokenizeRequest.ts b/src/api/client/requests/DetokenizeRequest.ts index 777a5d1..01fa2f5 100644 --- a/src/api/client/requests/DetokenizeRequest.ts +++ b/src/api/client/requests/DetokenizeRequest.ts @@ -5,7 +5,7 @@ /** * @example * { - * tokens: [] + * tokens: [10104, 12221, 1315, 34, 1420, 69] * } */ export interface DetokenizeRequest { diff --git a/src/api/client/requests/EmbedRequest.ts b/src/api/client/requests/EmbedRequest.ts index 35cc797..b2e6a45 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?: string[]; + embeddingTypes?: Cohere.EmbedRequestEmbeddingTypesItem[]; /** * 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/RerankRequest.ts b/src/api/client/requests/RerankRequest.ts index 066e64f..0f6a875 100644 --- a/src/api/client/requests/RerankRequest.ts +++ b/src/api/client/requests/RerankRequest.ts @@ -7,7 +7,8 @@ import * as Cohere from "../.."; /** * @example * { - * query: "string", + * model: "rerank-english-v2.0", + * query: "What is the capital of the United States?", * documents: [] * } */ diff --git a/src/api/client/requests/SummarizeRequest.ts b/src/api/client/requests/SummarizeRequest.ts index 38237bc..9bb8904 100644 --- a/src/api/client/requests/SummarizeRequest.ts +++ b/src/api/client/requests/SummarizeRequest.ts @@ -7,7 +7,7 @@ import * as Cohere from "../.."; /** * @example * { - * text: "string", + * text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. It may be made from milk or cream and is flavoured with a sweetener, either sugar or an alternative, and a spice, such as cocoa or vanilla, or with fruit such as strawberries or peaches. It can also be made by whisking a flavored cream base and liquid nitrogen together. Food coloring is sometimes added, in addition to stabilizers. The mixture is cooled below the freezing point of water and stirred to incorporate air spaces and to prevent detectable ice crystals from forming. The result is a smooth, semi-solid foam that is solid at very low temperatures (below 2 \u00B0C or 35 \u00B0F). It becomes more malleable as its temperature increases.\n\nThe meaning of the name \"ice cream\" varies from one country to another. In some countries, such as the United States, \"ice cream\" applies only to a specific variety, and most governments regulate the commercial use of the various terms according to the relative quantities of the main ingredients, notably the amount of cream. Products that do not meet the criteria to be called ice cream are sometimes labelled \"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, one word is used fo\r all variants. Analogues made from dairy alternatives, such as goat's or sheep's milk, or milk substitutes (e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are lactose intolerant, allergic to dairy protein or vegan.", * length: Cohere.SummarizeRequestLength.Short, * format: Cohere.SummarizeRequestFormat.Paragraph, * extractiveness: Cohere.SummarizeRequestExtractiveness.Low diff --git a/src/api/client/requests/TokenizeRequest.ts b/src/api/client/requests/TokenizeRequest.ts index bdc2933..7e9d162 100644 --- a/src/api/client/requests/TokenizeRequest.ts +++ b/src/api/client/requests/TokenizeRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * text: "string" + * text: "tokenize me! :D", + * model: "command" * } */ export interface TokenizeRequest { diff --git a/src/api/resources/connectors/client/Client.ts b/src/api/resources/connectors/client/Client.ts index e71f9a5..70ad62a 100644 --- a/src/api/resources/connectors/client/Client.ts +++ b/src/api/resources/connectors/client/Client.ts @@ -61,7 +61,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -142,7 +142,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", body: await serializers.CreateConnectorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -214,7 +214,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -289,7 +289,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -373,7 +373,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", body: await serializers.UpdateConnectorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -457,7 +457,7 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", queryParameters: _queryParams, diff --git a/src/api/resources/datasets/client/Client.ts b/src/api/resources/datasets/client/Client.ts index 8743bb6..44f49c7 100644 --- a/src/api/resources/datasets/client/Client.ts +++ b/src/api/resources/datasets/client/Client.ts @@ -73,7 +73,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -174,7 +174,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "multipart/form-data; boundary=" + _request.getBoundary(), body: _request, @@ -234,7 +234,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -293,7 +293,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -352,7 +352,7 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/datasets/types/DatasetsGetResponse.ts b/src/api/resources/datasets/types/DatasetsGetResponse.ts index 7da5b93..5a31bdf 100644 --- a/src/api/resources/datasets/types/DatasetsGetResponse.ts +++ b/src/api/resources/datasets/types/DatasetsGetResponse.ts @@ -5,5 +5,5 @@ import * as Cohere from "../../.."; export interface DatasetsGetResponse { - dataset?: Cohere.Dataset; + dataset: Cohere.Dataset; } diff --git a/src/api/resources/embedJobs/client/Client.ts b/src/api/resources/embedJobs/client/Client.ts index cfe9fb3..6d96a48 100644 --- a/src/api/resources/embedJobs/client/Client.ts +++ b/src/api/resources/embedJobs/client/Client.ts @@ -48,7 +48,7 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -124,7 +124,7 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", body: await serializers.CreateEmbedJobRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), @@ -194,7 +194,7 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -265,7 +265,7 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.7.4", + "X-Fern-SDK-Version": "7.7.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/types/ClassifyRequestExamplesItem.ts b/src/api/types/ClassifyExample.ts similarity index 70% rename from src/api/types/ClassifyRequestExamplesItem.ts rename to src/api/types/ClassifyExample.ts index afc0207..9ffe3bc 100644 --- a/src/api/types/ClassifyRequestExamplesItem.ts +++ b/src/api/types/ClassifyExample.ts @@ -2,7 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -export interface ClassifyRequestExamplesItem { +export interface ClassifyExample { text?: string; label?: string; } diff --git a/src/api/types/EmbedRequestEmbeddingTypesItem.ts b/src/api/types/EmbedRequestEmbeddingTypesItem.ts new file mode 100644 index 0000000..54bc969 --- /dev/null +++ b/src/api/types/EmbedRequestEmbeddingTypesItem.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type EmbedRequestEmbeddingTypesItem = "float" | "int8" | "uint8" | "binary" | "ubinary"; + +export const EmbedRequestEmbeddingTypesItem = { + Float: "float", + Int8: "int8", + Uint8: "uint8", + Binary: "binary", + Ubinary: "ubinary", +} as const; diff --git a/src/api/types/ParseInfo.ts b/src/api/types/ParseInfo.ts new file mode 100644 index 0000000..555198a --- /dev/null +++ b/src/api/types/ParseInfo.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ParseInfo { + separator?: string; + delimiter?: string; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 1e8e74c..3c40d01 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -10,6 +10,7 @@ export * from "./GenerateStreamRequestTruncate"; export * from "./GenerateStreamRequestReturnLikelihoods"; export * from "./GenerateRequestTruncate"; export * from "./GenerateRequestReturnLikelihoods"; +export * from "./EmbedRequestEmbeddingTypesItem"; export * from "./EmbedRequestTruncate"; export * from "./EmbedResponse"; export * from "./RerankRequestDocumentsItemText"; @@ -17,7 +18,6 @@ export * from "./RerankRequestDocumentsItem"; export * from "./RerankResponseResultsItemDocument"; export * from "./RerankResponseResultsItem"; export * from "./RerankResponse"; -export * from "./ClassifyRequestExamplesItem"; export * from "./ClassifyRequestTruncate"; export * from "./ClassifyResponseClassificationsItemLabelsValue"; export * from "./ClassifyResponseClassificationsItemClassificationType"; @@ -72,9 +72,11 @@ export * from "./EmbedJobTruncate"; export * from "./EmbedJob"; export * from "./ListEmbedJobResponse"; export * from "./CreateEmbedJobResponse"; +export * from "./ClassifyExample"; export * from "./DatasetType"; export * from "./DatasetValidationStatus"; export * from "./DatasetPart"; +export * from "./ParseInfo"; export * from "./Dataset"; export * from "./ConnectorOAuth"; export * from "./ConnectorAuthStatus"; diff --git a/src/serialization/client/requests/ChatRequest.ts b/src/serialization/client/requests/ChatRequest.ts index 572e8c0..0f87ee6 100644 --- a/src/serialization/client/requests/ChatRequest.ts +++ b/src/serialization/client/requests/ChatRequest.ts @@ -34,6 +34,9 @@ export const ChatRequest: core.serialization.Schema (await import("../..")).ChatRequestCitationQuality).optional() ), temperature: core.serialization.number().optional(), + maxTokens: core.serialization.property("max_tokens", core.serialization.number().optional()), + k: core.serialization.number().optional(), + p: core.serialization.number().optional(), frequencyPenalty: core.serialization.property("frequency_penalty", core.serialization.number().optional()), presencePenalty: core.serialization.property("presence_penalty", core.serialization.number().optional()), }); @@ -51,6 +54,9 @@ export declare namespace ChatRequest { documents?: serializers.ChatDocument.Raw[] | null; citation_quality?: serializers.ChatRequestCitationQuality.Raw | null; temperature?: number | null; + max_tokens?: number | null; + k?: number | null; + p?: number | null; frequency_penalty?: number | null; presence_penalty?: number | null; } diff --git a/src/serialization/client/requests/ChatStreamRequest.ts b/src/serialization/client/requests/ChatStreamRequest.ts index b271cff..ff48c99 100644 --- a/src/serialization/client/requests/ChatStreamRequest.ts +++ b/src/serialization/client/requests/ChatStreamRequest.ts @@ -34,6 +34,9 @@ export const ChatStreamRequest: core.serialization.Schema (await import("../..")).ChatStreamRequestCitationQuality).optional() ), temperature: core.serialization.number().optional(), + maxTokens: core.serialization.property("max_tokens", core.serialization.number().optional()), + k: core.serialization.number().optional(), + p: core.serialization.number().optional(), frequencyPenalty: core.serialization.property("frequency_penalty", core.serialization.number().optional()), presencePenalty: core.serialization.property("presence_penalty", core.serialization.number().optional()), }); @@ -51,6 +54,9 @@ export declare namespace ChatStreamRequest { documents?: serializers.ChatDocument.Raw[] | null; citation_quality?: serializers.ChatStreamRequestCitationQuality.Raw | null; temperature?: number | null; + max_tokens?: number | null; + k?: number | null; + p?: number | null; frequency_penalty?: number | null; presence_penalty?: number | null; } diff --git a/src/serialization/client/requests/ClassifyRequest.ts b/src/serialization/client/requests/ClassifyRequest.ts index e9ca21d..3e9952a 100644 --- a/src/serialization/client/requests/ClassifyRequest.ts +++ b/src/serialization/client/requests/ClassifyRequest.ts @@ -10,7 +10,7 @@ export const ClassifyRequest: core.serialization.Schema (await import("../..")).ClassifyRequestExamplesItem) + core.serialization.lazyObject(async () => (await import("../..")).ClassifyExample) ), model: core.serialization.string().optional(), preset: core.serialization.string().optional(), @@ -20,7 +20,7 @@ export const ClassifyRequest: core.serialization.Schema (await import("../..")).EmbedRequestEmbeddingTypesItem)) + .optional() ), truncate: core.serialization.lazy(async () => (await import("../..")).EmbedRequestTruncate).optional(), }); @@ -26,7 +28,7 @@ export declare namespace EmbedRequest { texts: string[]; model?: string | null; input_type?: serializers.EmbedInputType.Raw | null; - embedding_types?: string[] | null; + embedding_types?: serializers.EmbedRequestEmbeddingTypesItem.Raw[] | null; truncate?: serializers.EmbedRequestTruncate.Raw | null; } } diff --git a/src/serialization/resources/datasets/types/DatasetsGetResponse.ts b/src/serialization/resources/datasets/types/DatasetsGetResponse.ts index c91587c..fca7b42 100644 --- a/src/serialization/resources/datasets/types/DatasetsGetResponse.ts +++ b/src/serialization/resources/datasets/types/DatasetsGetResponse.ts @@ -10,11 +10,11 @@ export const DatasetsGetResponse: core.serialization.ObjectSchema< serializers.DatasetsGetResponse.Raw, Cohere.DatasetsGetResponse > = core.serialization.object({ - dataset: core.serialization.lazyObject(async () => (await import("../../..")).Dataset).optional(), + dataset: core.serialization.lazyObject(async () => (await import("../../..")).Dataset), }); export declare namespace DatasetsGetResponse { interface Raw { - dataset?: serializers.Dataset.Raw | null; + dataset: serializers.Dataset.Raw; } } diff --git a/src/serialization/types/ClassifyExample.ts b/src/serialization/types/ClassifyExample.ts new file mode 100644 index 0000000..44a8f18 --- /dev/null +++ b/src/serialization/types/ClassifyExample.ts @@ -0,0 +1,20 @@ +/** + * 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 ClassifyExample: core.serialization.ObjectSchema = + core.serialization.object({ + text: core.serialization.string().optional(), + label: core.serialization.string().optional(), + }); + +export declare namespace ClassifyExample { + interface Raw { + text?: string | null; + label?: string | null; + } +} diff --git a/src/serialization/types/ClassifyRequestExamplesItem.ts b/src/serialization/types/ClassifyRequestExamplesItem.ts deleted file mode 100644 index 283ae94..0000000 --- a/src/serialization/types/ClassifyRequestExamplesItem.ts +++ /dev/null @@ -1,22 +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 ClassifyRequestExamplesItem: core.serialization.ObjectSchema< - serializers.ClassifyRequestExamplesItem.Raw, - Cohere.ClassifyRequestExamplesItem -> = core.serialization.object({ - text: core.serialization.string().optional(), - label: core.serialization.string().optional(), -}); - -export declare namespace ClassifyRequestExamplesItem { - interface Raw { - text?: string | null; - label?: string | null; - } -} diff --git a/src/serialization/types/EmbedRequestEmbeddingTypesItem.ts b/src/serialization/types/EmbedRequestEmbeddingTypesItem.ts new file mode 100644 index 0000000..d0438cf --- /dev/null +++ b/src/serialization/types/EmbedRequestEmbeddingTypesItem.ts @@ -0,0 +1,16 @@ +/** + * 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/ParseInfo.ts b/src/serialization/types/ParseInfo.ts new file mode 100644 index 0000000..4b719ec --- /dev/null +++ b/src/serialization/types/ParseInfo.ts @@ -0,0 +1,20 @@ +/** + * 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 ParseInfo: core.serialization.ObjectSchema = + core.serialization.object({ + separator: core.serialization.string().optional(), + delimiter: core.serialization.string().optional(), + }); + +export declare namespace ParseInfo { + interface Raw { + separator?: string | null; + delimiter?: string | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 1e8e74c..3c40d01 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -10,6 +10,7 @@ export * from "./GenerateStreamRequestTruncate"; export * from "./GenerateStreamRequestReturnLikelihoods"; export * from "./GenerateRequestTruncate"; export * from "./GenerateRequestReturnLikelihoods"; +export * from "./EmbedRequestEmbeddingTypesItem"; export * from "./EmbedRequestTruncate"; export * from "./EmbedResponse"; export * from "./RerankRequestDocumentsItemText"; @@ -17,7 +18,6 @@ export * from "./RerankRequestDocumentsItem"; export * from "./RerankResponseResultsItemDocument"; export * from "./RerankResponseResultsItem"; export * from "./RerankResponse"; -export * from "./ClassifyRequestExamplesItem"; export * from "./ClassifyRequestTruncate"; export * from "./ClassifyResponseClassificationsItemLabelsValue"; export * from "./ClassifyResponseClassificationsItemClassificationType"; @@ -72,9 +72,11 @@ export * from "./EmbedJobTruncate"; export * from "./EmbedJob"; export * from "./ListEmbedJobResponse"; export * from "./CreateEmbedJobResponse"; +export * from "./ClassifyExample"; export * from "./DatasetType"; export * from "./DatasetValidationStatus"; export * from "./DatasetPart"; +export * from "./ParseInfo"; export * from "./Dataset"; export * from "./ConnectorOAuth"; export * from "./ConnectorAuthStatus"; diff --git a/yarn.lock b/yarn.lock index 1f7b12b..240a905 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11,9 +11,9 @@ form-data "^4.0.0" "@types/node@*": - version "20.11.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.10.tgz#6c3de8974d65c362f82ee29db6b5adf4205462f9" - integrity sha512-rZEfe/hJSGYmdfX9tvcPMYeYPW2sNl50nsw4jZmRcaG0HIAb0WYEpsB05GOb53vjqpyE9GUhlDQ4jLSoB5q9kg== + version "20.11.16" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.16.tgz#4411f79411514eb8e2926f036c86c9f0e4ec6708" + integrity sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ== dependencies: undici-types "~5.26.4"