diff --git a/package.json b/package.json index e21ff9ed..5d33aed7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cohere-ai", - "version": "7.15.4", + "version": "8.0.0", "private": false, "repository": "https://github.com/cohere-ai/cohere-typescript", "main": "./index.js", diff --git a/reference.md b/reference.md index e8a10e48..6d4f9dd8 100644 --- a/reference.md +++ b/reference.md @@ -59,7 +59,7 @@ await client.checkApiKey(); ## V2 -
client.v2.chatStream({ ...params }) -> core.Stream +
client.v2.chatStream({ ...params }) -> core.Stream
@@ -71,7 +71,7 @@ await client.checkApiKey();
-Generates a text response to a user message. To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api). +Generates a text response to a user message and streams it down, token by token. To learn how to use the Chat API with streaming follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api). Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) for instructions on moving from API v1 to API v2. @@ -90,12 +90,11 @@ Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) ```typescript const response = await client.v2.chatStream({ - model: "model", + model: "command-r", messages: [ { - role: "tool", - toolCallId: "messages", - content: "messages", + role: "user", + content: "Hello!", }, ], }); @@ -136,7 +135,7 @@ for await (const item of response) {
-
client.v2.chat({ ...params }) -> Cohere.ChatResponse +
client.v2.chat({ ...params }) -> Cohere.V2ChatResponse
@@ -167,12 +166,11 @@ Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) ```typescript await client.v2.chat({ - model: "model", + model: "command-r", messages: [ { - role: "tool", - toolCallId: "messages", - content: "messages", + role: "user", + content: "Tell me about LLMs", }, ], }); @@ -243,9 +241,12 @@ If you want to learn more how to use the embedding model, have a look at the [Se ```typescript await client.v2.embed({ - model: "model", - inputType: "search_document", + model: "embed-english-v3.0", + inputType: "image", embeddingTypes: ["float"], + images: [ + "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29tcHJ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TH81vG49UVVtzAGjbRH6cq90TxGvdE8RoW0Q7M6Cqu5VA9kVrNLvC5DvNRWEa75CWPIUqqgyVQB5bVzarMCy7n7++mUoxVhkRtW9tPdypBbRNJI3BVFYf0FdlWTErnQP24uP5JqLojgUYyNqznvZ2q46GYLKDq0khPejk/8ArOsU6HX1irTWre8xDeQBk4/FHduPtALEKozJq3skjAaQaT/wOqv4NJdco3jj6bNtby3c8VtAulJIwVRWCYJb4PbKqqGnYDWSdpPcPLZ6V9HEmikxOxjAlQaUqL9Q7x5+2xgCrrmG8/p9OrIDAg8CKkTQd07iRsdBcPV3ucSkX9H9KP1O8naIBBBG410gsBh2K3MCDKNjrE/2tSLpuqDtIFKAqhRwA6y9GVw/mAdjohEEwK2I4u0jH/Lb6exgXljL2tEwP9pq0GdzF69bfHO4fyAGx0ScPgVpl9JkB/yO309cG6w9O0ROeZq3bQnib/UOsJyBJqV9ZI7952Ogl8DDdYezfEra1B5HcdvpTfC+xicoc44QIl/t4/z7LaUTRK3bwPr1d9PoJqlPxN/A2cOvpsNvIbyA/Eh3jvHaDWHYjbYnapdWzgg/qHap7js9JseTDLZreBwbuVSAB9AP1GiSSSeJ9ltcGB8/pPEUjq6hlOYPU3FykC97dgp3aRi7HMnaw3FbzCptdaSZeJDvVh5isO6aYdcqq3gNvJ25705ikxXDJAGS/gI/5FqfHMIt10pb+H0DBjyGdYr03XRaLCojnw1sg/6FTTSzyPNNIXkc5szHMnYhuJIDmh3doPCo7+F9z5oaE0R4SrzrWR/cXnWsj+4vOtZH9xeYrWx/cXmKe6gTjID6b6lxAnMQrl5mmYsSzEkn92//2Q==", + ], }); ``` @@ -310,9 +311,16 @@ This endpoint takes in a query and a list of texts and produces an ordered array ```typescript await client.v2.rerank({ - model: "model", - query: "query", - documents: ["documents"], + documents: [ + "Carson City is the capital city of the American state of Nevada.", + "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.", + "Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.", + "Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.", + "Capital punishment has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states.", + ], + query: "What is the capital of the United States?", + topN: 3, + model: "rerank-v3.5", }); ``` diff --git a/src/Client.ts b/src/Client.ts index 5bf138a1..46aa5e6f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -74,8 +74,7 @@ export class CohereClient { } /** - * Generates a streamed text response to a user message. - * + * Generates a text response to a user message. * To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/docs/chat-api). */ public async chatStream( @@ -97,8 +96,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, Accepts: accepts != null ? accepts : undefined, @@ -150,21 +149,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -201,7 +238,6 @@ export class CohereClient { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -210,14 +246,61 @@ export class CohereClient { * * @example * await client.chat({ - * message: "Can you give me a global market overview of solar panels?", * chatHistory: [{ - * role: "TOOL" + * role: "USER", + * message: "Who discovered gravity?" * }, { - * role: "TOOL" + * role: "CHATBOT", + * message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" * }], - * promptTruncation: "OFF", - * temperature: 0.3 + * message: "What year was he born?", + * connectors: [{ + * id: "web-search" + * }] + * }) + * + * @example + * await client.chat({ + * message: "Who is more popular: Nsync or Backstreet Boys?", + * documents: [{ + * "title": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters", + * "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHern\u00E1n Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." + * }, { + * "title": "CSPC: NSYNC Popularity Analysis - ChartMasters", + * "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven\u2019t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn\u2019t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." + * }, { + * "title": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters", + * "snippet": "1997, 1998, 2000 and 2001 also rank amongst some of the very best years.\nYet the way many music consumers \u2013 especially teenagers and young women\u2019s \u2013 embraced their output deserves its own chapter. If Jonas Brothers and more recently One Direction reached a great level of popularity during the past decade, the type of success achieved by Backstreet Boys is in a completely different level as they really dominated the business for a few years all over the world, including in some countries that were traditionally hard to penetrate for Western artists.\n\nWe will try to analyze the extent of that hegemony with this new article with final results which will more than surprise many readers." + * }, { + * "title": "CSPC: NSYNC Popularity Analysis - ChartMasters", + * "snippet": "Was the teen group led by Justin Timberlake really that big? Was it only in the US where they found success? Or were they a global phenomenon?\nAs usual, I\u2019ll be using the Commensurate Sales to Popularity Concept in order to relevantly gauge their results. This concept will not only bring you sales information for all NSYNC\u2018s albums, physical and download singles, as well as audio and video streaming, but it will also determine their true popularity. If you are not yet familiar with the CSPC method, the next page explains it with a short video. I fully recommend watching the video before getting into the sales figures." + * }] + * }) + * + * @example + * await client.chat({ + * message: "Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?", + * tools: [{ + * name: "query_daily_sales_report", + * description: "Connects to a database to retrieve overall sales volumes and sales information for a given day.", + * parameterDefinitions: { + * "day": { + * description: "Retrieves sales data for this day, formatted as YYYY-MM-DD.", + * type: "str", + * required: true + * } + * } + * }, { + * name: "query_product_catalog", + * description: "Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.", + * parameterDefinitions: { + * "category": { + * description: "Retrieves product information data for all products in this category.", + * type: "str", + * required: true + * } + * } + * }] * }) */ public async chat( @@ -239,8 +322,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, Accepts: accepts != null ? accepts : undefined, @@ -281,21 +364,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -343,8 +464,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -395,21 +516,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -448,7 +607,6 @@ export class CohereClient { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -478,8 +636,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -519,21 +677,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -573,7 +769,6 @@ export class CohereClient { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -581,7 +776,19 @@ export class CohereClient { * @throws {@link Cohere.GatewayTimeoutError} * * @example - * await client.embed() + * await client.embed({ + * model: "embed-english-v3.0", + * inputType: "image", + * embeddingTypes: ["float"], + * images: ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29tcHJlc3NlZCBieSBqcGVnLXJlY29tcHJlc3P/2wCEAAQEBAQEBAQEBAQGBgUGBggHBwcHCAwJCQkJCQwTDA4MDA4MExEUEA8QFBEeFxUVFx4iHRsdIiolJSo0MjRERFwBBAQEBAQEBAQEBAYGBQYGCAcHBwcIDAkJCQkJDBMMDgwMDgwTERQQDxAUER4XFRUXHiIdGx0iKiUlKjQyNEREXP/CABEIAZABkAMBIgACEQEDEQH/xAAdAAEAAQQDAQAAAAAAAAAAAAAABwEFBggCAwQJ/9oACAEBAAAAAN/gAAAAAAAAAAAAAAAAAAAAAAAAAAHTg9j6agAAp23/ADjsAAAPFrlAUYeagAAArdZ12uzcAAKax6jWUAAAAO/bna+oAC1aBxAAAAAAbM7rVABYv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K2I4u0jH/Lb6exgXljL2tEwP9pq0GdzF69bfHO4fyAGx0ScPgVpl9JkB/yO309cG6w9O0ROeZq3bQnib/UOsJyBJqV9ZI7952Ogl8DDdYezfEra1B5HcdvpTfC+xicoc44QIl/t4/z7LaUTRK3bwPr1d9PoJqlPxN/A2cOvpsNvIbyA/Eh3jvHaDWHYjbYnapdWzgg/qHap7js9JseTDLZreBwbuVSAB9AP1GiSSSeJ9ltcGB8/pPEUjq6hlOYPU3FykC97dgp3aRi7HMnaw3FbzCptdaSZeJDvVh5isO6aYdcqq3gNvJ25705ikxXDJAGS/gI/5FqfHMIt10pb+H0DBjyGdYr03XRaLCojnw1sg/6FTTSzyPNNIXkc5szHMnYhuJIDmh3doPCo7+F9z5oaE0R4SrzrWR/cXnWsj+4vOtZH9xeYrWx/cXmKe6gTjID6b6lxAnMQrl5mmYsSzEkn92//2Q=="] + * }) + * + * @example + * await client.embed({ + * texts: ["hello", "goodbye"], + * model: "embed-english-v3.0", + * inputType: "classification" + * }) */ public async embed( request: Cohere.EmbedRequest = {}, @@ -601,8 +808,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -639,21 +846,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -689,7 +934,6 @@ export class CohereClient { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -698,8 +942,20 @@ export class CohereClient { * * @example * await client.rerank({ - * query: "query", - * documents: ["documents"] + * documents: [{ + * "text": "Carson City is the capital city of the American state of Nevada." + * }, { + * "text": "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan." + * }, { + * "text": "Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages." + * }, { + * "text": "Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district." + * }, { + * "text": "Capital punishment has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states." + * }], + * query: "What is the capital of the United States?", + * topN: 3, + * model: "rerank-v3.5" * }) */ public async rerank( @@ -720,8 +976,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -758,21 +1014,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -809,7 +1103,6 @@ export class CohereClient { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -818,7 +1111,38 @@ export class CohereClient { * * @example * await client.classify({ - * inputs: ["inputs"] + * 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's meeting'", + * label: "Not spam" + * }, { + * text: "Pre-read for tomorrow", + * label: "Not spam" + * }], + * inputs: ["Confirm your email address", "hey i need u to send some $"] * }) */ public async classify( @@ -839,8 +1163,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -877,21 +1201,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -930,7 +1292,6 @@ export class CohereClient { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -939,7 +1300,7 @@ export class CohereClient { * * @example * await client.summarize({ - * text: "text" + * 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." * }) */ public async summarize( @@ -960,8 +1321,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -998,21 +1359,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -1048,7 +1447,6 @@ export class CohereClient { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -1079,8 +1477,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1117,21 +1515,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -1167,7 +1603,6 @@ export class CohereClient { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -1176,8 +1611,8 @@ export class CohereClient { * * @example * await client.detokenize({ - * tokens: [1], - * model: "model" + * tokens: [10002, 2261, 2012, 8, 2792, 43], + * model: "command" * }) */ public async detokenize( @@ -1198,8 +1633,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1236,21 +1671,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -1285,7 +1758,6 @@ export class CohereClient { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -1310,8 +1782,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -1343,21 +1815,59 @@ export class CohereClient { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, diff --git a/src/api/client/requests/ChatRequest.ts b/src/api/client/requests/ChatRequest.ts index d27824ea..f65704f8 100644 --- a/src/api/client/requests/ChatRequest.ts +++ b/src/api/client/requests/ChatRequest.ts @@ -7,14 +7,61 @@ import * as Cohere from "../../index"; /** * @example * { - * message: "Can you give me a global market overview of solar panels?", * chatHistory: [{ - * role: "TOOL" + * role: "USER", + * message: "Who discovered gravity?" * }, { - * role: "TOOL" + * role: "CHATBOT", + * message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" * }], - * promptTruncation: "OFF", - * temperature: 0.3 + * message: "What year was he born?", + * connectors: [{ + * id: "web-search" + * }] + * } + * + * @example + * { + * message: "Who is more popular: Nsync or Backstreet Boys?", + * documents: [{ + * "title": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters", + * "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHern\u00E1n Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." + * }, { + * "title": "CSPC: NSYNC Popularity Analysis - ChartMasters", + * "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven\u2019t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn\u2019t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." + * }, { + * "title": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters", + * "snippet": "1997, 1998, 2000 and 2001 also rank amongst some of the very best years.\nYet the way many music consumers \u2013 especially teenagers and young women\u2019s \u2013 embraced their output deserves its own chapter. If Jonas Brothers and more recently One Direction reached a great level of popularity during the past decade, the type of success achieved by Backstreet Boys is in a completely different level as they really dominated the business for a few years all over the world, including in some countries that were traditionally hard to penetrate for Western artists.\n\nWe will try to analyze the extent of that hegemony with this new article with final results which will more than surprise many readers." + * }, { + * "title": "CSPC: NSYNC Popularity Analysis - ChartMasters", + * "snippet": "Was the teen group led by Justin Timberlake really that big? Was it only in the US where they found success? Or were they a global phenomenon?\nAs usual, I\u2019ll be using the Commensurate Sales to Popularity Concept in order to relevantly gauge their results. This concept will not only bring you sales information for all NSYNC\u2018s albums, physical and download singles, as well as audio and video streaming, but it will also determine their true popularity. If you are not yet familiar with the CSPC method, the next page explains it with a short video. I fully recommend watching the video before getting into the sales figures." + * }] + * } + * + * @example + * { + * message: "Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?", + * tools: [{ + * name: "query_daily_sales_report", + * description: "Connects to a database to retrieve overall sales volumes and sales information for a given day.", + * parameterDefinitions: { + * "day": { + * description: "Retrieves sales data for this day, formatted as YYYY-MM-DD.", + * type: "str", + * required: true + * } + * } + * }, { + * name: "query_product_catalog", + * description: "Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.", + * parameterDefinitions: { + * "category": { + * description: "Retrieves product information data for all products in this category.", + * type: "str", + * required: true + * } + * } + * }] * } */ export interface ChatRequest { @@ -214,16 +261,6 @@ export interface ChatRequest { * */ presencePenalty?: number; - /** - * When enabled, the user's prompt will be sent to the model without - * any pre-processing. - * - * Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments - * - */ - rawPrompting?: boolean; - /** The prompt is returned in the `prompt` response field when this is enabled. */ - returnPrompt?: boolean; /** * A list of available tools (functions) that the model may suggest invoking before producing a text response. * diff --git a/src/api/client/requests/ChatStreamRequest.ts b/src/api/client/requests/ChatStreamRequest.ts index 119115b0..e8f6560a 100644 --- a/src/api/client/requests/ChatStreamRequest.ts +++ b/src/api/client/requests/ChatStreamRequest.ts @@ -7,14 +7,7 @@ import * as Cohere from "../../index"; /** * @example * { - * message: "Can you give me a global market overview of solar panels?", - * chatHistory: [{ - * role: "TOOL" - * }, { - * role: "TOOL" - * }], - * promptTruncation: "OFF", - * temperature: 0.3 + * message: "hello world!" * } */ export interface ChatStreamRequest { @@ -214,16 +207,6 @@ export interface ChatStreamRequest { * */ presencePenalty?: number; - /** - * When enabled, the user's prompt will be sent to the model without - * any pre-processing. - * - * Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments - * - */ - rawPrompting?: boolean; - /** The prompt is returned in the `prompt` response field when this is enabled. */ - returnPrompt?: boolean; /** * A list of available tools (functions) that the model may suggest invoking before producing a text response. * diff --git a/src/api/client/requests/ClassifyRequest.ts b/src/api/client/requests/ClassifyRequest.ts index 3ebd3e0d..740f107f 100644 --- a/src/api/client/requests/ClassifyRequest.ts +++ b/src/api/client/requests/ClassifyRequest.ts @@ -7,7 +7,38 @@ import * as Cohere from "../../index"; /** * @example * { - * inputs: ["inputs"] + * 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's meeting'", + * label: "Not spam" + * }, { + * text: "Pre-read for tomorrow", + * label: "Not spam" + * }], + * inputs: ["Confirm your email address", "hey i need u to send some $"] * } */ export interface ClassifyRequest { diff --git a/src/api/client/requests/DetokenizeRequest.ts b/src/api/client/requests/DetokenizeRequest.ts index 9bc622e6..2b1a2def 100644 --- a/src/api/client/requests/DetokenizeRequest.ts +++ b/src/api/client/requests/DetokenizeRequest.ts @@ -5,8 +5,8 @@ /** * @example * { - * tokens: [1], - * model: "model" + * tokens: [10002, 2261, 2012, 8, 2792, 43], + * model: "command" * } */ export interface DetokenizeRequest { diff --git a/src/api/client/requests/EmbedRequest.ts b/src/api/client/requests/EmbedRequest.ts index 0868472e..c0838828 100644 --- a/src/api/client/requests/EmbedRequest.ts +++ b/src/api/client/requests/EmbedRequest.ts @@ -6,7 +6,19 @@ import * as Cohere from "../../index"; /** * @example - * {} + * { + * model: "embed-english-v3.0", + * inputType: "image", + * embeddingTypes: ["float"], + * images: ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29tcH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nTH81vG49UVVtzAGjbRH6cq90TxGvdE8RoW0Q7M6Cqu5VA9kVrNLvC5DvNRWEa75CWPIUqqgyVQB5bVzarMCy7n7++mUoxVhkRtW9tPdypBbRNJI3BVFYf0FdlWTErnQP24uP5JqLojgUYyNqznvZ2q46GYLKDq0khPejk/8ArOsU6HX1irTWre8xDeQBk4/FHduPtALEKozJq3skjAaQaT/wOqv4NJdco3jj6bNtby3c8VtAulJIwVRWCYJb4PbKqqGnYDWSdpPcPLZ6V9HEmikxOxjAlQaUqL9Q7x5+2xgCrrmG8/p9OrIDAg8CKkTQd07iRsdBcPV3ucSkX9H9KP1O8naIBBBG410gsBh2K3MCDKNjrE/2tSLpuqDtIFKAqhRwA6y9GVw/mAdjohEEwK2I4u0jH/Lb6exgXljL2tEwP9pq0GdzF69bfHO4fyAGx0ScPgVpl9JkB/yO309cG6w9O0ROeZq3bQnib/UOsJyBJqV9ZI7952Ogl8DDdYezfEra1B5HcdvpTfC+xicoc44QIl/t4/z7LaUTRK3bwPr1d9PoJqlPxN/A2cOvpsNvIbyA/Eh3jvHaDWHYjbYnapdWzgg/qHap7js9JseTDLZreBwbuVSAB9AP1GiSSSeJ9ltcGB8/pPEUjq6hlOYPU3FykC97dgp3aRi7HMnaw3FbzCptdaSZeJDvVh5isO6aYdcqq3gNvJ25705ikxXDJAGS/gI/5FqfHMIt10pb+H0DBjyGdYr03XRaLCojnw1sg/6FTTSzyPNNIXkc5szHMnYhuJIDmh3doPCo7+F9z5oaE0R4SrzrWR/cXnWsj+4vOtZH9xeYrWx/cXmKe6gTjID6b6lxAnMQrl5mmYsSzEkn92//2Q=="] + * } + * + * @example + * { + * texts: ["hello", "goodbye"], + * model: "embed-english-v3.0", + * inputType: "classification" + * } */ export interface EmbedRequest { /** An array of strings for the model to embed. Maximum number of texts per call is `96`. We recommend reducing the length of each text to be under `512` tokens for optimal quality. */ diff --git a/src/api/client/requests/GenerateStreamRequest.ts b/src/api/client/requests/GenerateStreamRequest.ts index 4d2b3f97..08e93e54 100644 --- a/src/api/client/requests/GenerateStreamRequest.ts +++ b/src/api/client/requests/GenerateStreamRequest.ts @@ -7,7 +7,22 @@ import * as Cohere from "../../index"; /** * @example * { - * prompt: "Please explain to me how LLMs work" + * prompt: "string", + * model: "string", + * numGenerations: 1, + * maxTokens: 1, + * truncate: "NONE", + * temperature: 1.1, + * seed: 1, + * preset: "string", + * endSequences: ["string"], + * stopSequences: ["string"], + * k: 1, + * p: 1.1, + * frequencyPenalty: 1.1, + * presencePenalty: 1.1, + * returnLikelihoods: "GENERATION", + * rawPrompting: true * } */ export interface GenerateStreamRequest { diff --git a/src/api/client/requests/RerankRequest.ts b/src/api/client/requests/RerankRequest.ts index 92e36c54..8358ce9b 100644 --- a/src/api/client/requests/RerankRequest.ts +++ b/src/api/client/requests/RerankRequest.ts @@ -7,8 +7,20 @@ import * as Cohere from "../../index"; /** * @example * { - * query: "query", - * documents: ["documents"] + * documents: [{ + * "text": "Carson City is the capital city of the American state of Nevada." + * }, { + * "text": "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan." + * }, { + * "text": "Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages." + * }, { + * "text": "Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district." + * }, { + * "text": "Capital punishment has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states." + * }], + * query: "What is the capital of the United States?", + * topN: 3, + * model: "rerank-v3.5" * } */ export interface RerankRequest { diff --git a/src/api/client/requests/SummarizeRequest.ts b/src/api/client/requests/SummarizeRequest.ts index ac448421..c581afce 100644 --- a/src/api/client/requests/SummarizeRequest.ts +++ b/src/api/client/requests/SummarizeRequest.ts @@ -7,7 +7,7 @@ import * as Cohere from "../../index"; /** * @example * { - * text: "text" + * 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." * } */ export interface SummarizeRequest { diff --git a/src/api/errors/ClientClosedRequestError.ts b/src/api/errors/ClientClosedRequestError.ts index 1c6f3d52..aebadb27 100644 --- a/src/api/errors/ClientClosedRequestError.ts +++ b/src/api/errors/ClientClosedRequestError.ts @@ -3,9 +3,10 @@ */ import * as errors from "../../errors/index"; +import * as Cohere from "../index"; export class ClientClosedRequestError extends errors.CohereError { - constructor(body?: unknown) { + constructor(body: Cohere.ClientClosedRequestErrorBody) { super({ message: "ClientClosedRequestError", statusCode: 499, diff --git a/src/api/errors/GatewayTimeoutError.ts b/src/api/errors/GatewayTimeoutError.ts index 2cf3fe7a..45d9667a 100644 --- a/src/api/errors/GatewayTimeoutError.ts +++ b/src/api/errors/GatewayTimeoutError.ts @@ -3,9 +3,10 @@ */ import * as errors from "../../errors/index"; +import * as Cohere from "../index"; export class GatewayTimeoutError extends errors.CohereError { - constructor(body?: unknown) { + constructor(body: Cohere.GatewayTimeoutErrorBody) { super({ message: "GatewayTimeoutError", statusCode: 504, diff --git a/src/api/errors/InvalidTokenError.ts b/src/api/errors/InvalidTokenError.ts deleted file mode 100644 index e3f4cfd4..00000000 --- a/src/api/errors/InvalidTokenError.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as errors from "../../errors/index"; - -export class InvalidTokenError extends errors.CohereError { - constructor(body?: unknown) { - super({ - message: "InvalidTokenError", - statusCode: 498, - body: body, - }); - Object.setPrototypeOf(this, InvalidTokenError.prototype); - } -} diff --git a/src/api/errors/NotImplementedError.ts b/src/api/errors/NotImplementedError.ts index e0f57e30..091027ba 100644 --- a/src/api/errors/NotImplementedError.ts +++ b/src/api/errors/NotImplementedError.ts @@ -3,9 +3,10 @@ */ import * as errors from "../../errors/index"; +import * as Cohere from "../index"; export class NotImplementedError extends errors.CohereError { - constructor(body?: unknown) { + constructor(body: Cohere.NotImplementedErrorBody) { super({ message: "NotImplementedError", statusCode: 501, diff --git a/src/api/errors/TooManyRequestsError.ts b/src/api/errors/TooManyRequestsError.ts index 525080b5..c7fdf0d6 100644 --- a/src/api/errors/TooManyRequestsError.ts +++ b/src/api/errors/TooManyRequestsError.ts @@ -3,9 +3,10 @@ */ import * as errors from "../../errors/index"; +import * as Cohere from "../index"; export class TooManyRequestsError extends errors.CohereError { - constructor(body?: unknown) { + constructor(body: Cohere.TooManyRequestsErrorBody) { super({ message: "TooManyRequestsError", statusCode: 429, diff --git a/src/api/errors/UnprocessableEntityError.ts b/src/api/errors/UnprocessableEntityError.ts index 5bde21b6..a7c30c81 100644 --- a/src/api/errors/UnprocessableEntityError.ts +++ b/src/api/errors/UnprocessableEntityError.ts @@ -3,9 +3,10 @@ */ import * as errors from "../../errors/index"; +import * as Cohere from "../index"; export class UnprocessableEntityError extends errors.CohereError { - constructor(body?: unknown) { + constructor(body: Cohere.UnprocessableEntityErrorBody) { super({ message: "UnprocessableEntityError", statusCode: 422, diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 651fac27..cb601a98 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -4,7 +4,6 @@ export * from "./ForbiddenError"; export * from "./NotFoundError"; export * from "./UnprocessableEntityError"; export * from "./TooManyRequestsError"; -export * from "./InvalidTokenError"; export * from "./ClientClosedRequestError"; export * from "./InternalServerError"; export * from "./NotImplementedError"; diff --git a/src/api/resources/connectors/client/Client.ts b/src/api/resources/connectors/client/Client.ts index b1a682ab..129138b9 100644 --- a/src/api/resources/connectors/client/Client.ts +++ b/src/api/resources/connectors/client/Client.ts @@ -47,7 +47,6 @@ export class Connectors { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -85,8 +84,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -119,21 +118,59 @@ export class Connectors { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -169,7 +206,6 @@ export class Connectors { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -200,8 +236,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -238,21 +274,59 @@ export class Connectors { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -288,7 +362,6 @@ export class Connectors { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -313,8 +386,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -346,21 +419,59 @@ export class Connectors { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -396,7 +507,6 @@ export class Connectors { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -424,8 +534,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -457,21 +567,59 @@ export class Connectors { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -508,7 +656,6 @@ export class Connectors { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -537,8 +684,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -575,21 +722,59 @@ export class Connectors { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -614,7 +799,7 @@ export class Connectors { } /** - * Authorize the connector with the given ID for the connector oauth app. See ['Connector Authentication'](https://docs.cohere.com/docs/connector-authentication) for more information. + * Authorize the connector with the given ID for the connector oauth app. See ['Connector Authentication'](https://docs.cohere.com/docs/connector-authentication) for more information. * * @param {string} id - The ID of the connector to authorize. * @param {Cohere.ConnectorsOAuthAuthorizeRequest} request @@ -626,7 +811,6 @@ export class Connectors { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -661,8 +845,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -695,21 +879,59 @@ export class Connectors { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, diff --git a/src/api/resources/datasets/client/Client.ts b/src/api/resources/datasets/client/Client.ts index 997a6733..f992dff1 100644 --- a/src/api/resources/datasets/client/Client.ts +++ b/src/api/resources/datasets/client/Client.ts @@ -49,7 +49,6 @@ export class Datasets { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -103,8 +102,8 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -137,21 +136,59 @@ export class Datasets { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -189,7 +226,6 @@ export class Datasets { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -243,10 +279,6 @@ export class Datasets { _queryParams["csv_delimiter"] = request.csvDelimiter; } - if (request.dryRun != null) { - _queryParams["dry_run"] = request.dryRun.toString(); - } - const _request = await core.newFormData(); await _request.appendFile("data", data); if (evalData != null) { @@ -268,8 +300,8 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ..._maybeEncodedRequest.headers, @@ -304,21 +336,59 @@ export class Datasets { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -353,7 +423,6 @@ export class Datasets { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -378,8 +447,8 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -411,21 +480,59 @@ export class Datasets { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -461,7 +568,6 @@ export class Datasets { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -486,8 +592,8 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -519,21 +625,59 @@ export class Datasets { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -569,7 +713,6 @@ export class Datasets { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -594,8 +737,8 @@ export class Datasets { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -627,21 +770,59 @@ export class Datasets { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, diff --git a/src/api/resources/datasets/client/requests/DatasetsCreateRequest.ts b/src/api/resources/datasets/client/requests/DatasetsCreateRequest.ts index 21f4845c..ac72803c 100644 --- a/src/api/resources/datasets/client/requests/DatasetsCreateRequest.ts +++ b/src/api/resources/datasets/client/requests/DatasetsCreateRequest.ts @@ -44,8 +44,4 @@ export interface DatasetsCreateRequest { * The delimiter used for .csv uploads. */ csvDelimiter?: string; - /** - * flag to enable dry_run mode - */ - dryRun?: boolean; } diff --git a/src/api/resources/datasets/types/DatasetsCreateResponseDatasetPartsItem.ts b/src/api/resources/datasets/types/DatasetsCreateResponseDatasetPartsItem.ts deleted file mode 100644 index adcc1d6c..00000000 --- a/src/api/resources/datasets/types/DatasetsCreateResponseDatasetPartsItem.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * the underlying files that make up the dataset - */ -export interface DatasetsCreateResponseDatasetPartsItem { - /** the name of the dataset part */ - name?: string; - /** the number of rows in the dataset part */ - numRows?: number; - samples?: string[]; - /** the kind of dataset part */ - partKind?: string; -} diff --git a/src/api/resources/datasets/types/index.ts b/src/api/resources/datasets/types/index.ts index cc2e2520..54dc414b 100644 --- a/src/api/resources/datasets/types/index.ts +++ b/src/api/resources/datasets/types/index.ts @@ -1,5 +1,4 @@ export * from "./DatasetsListResponse"; -export * from "./DatasetsCreateResponseDatasetPartsItem"; export * from "./DatasetsCreateResponse"; export * from "./DatasetsGetUsageResponse"; export * from "./DatasetsGetResponse"; diff --git a/src/api/resources/embedJobs/client/Client.ts b/src/api/resources/embedJobs/client/Client.ts index 646f0a41..3cd87994 100644 --- a/src/api/resources/embedJobs/client/Client.ts +++ b/src/api/resources/embedJobs/client/Client.ts @@ -46,7 +46,6 @@ export class EmbedJobs { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -71,8 +70,8 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -104,21 +103,59 @@ export class EmbedJobs { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -154,7 +191,6 @@ export class EmbedJobs { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -186,8 +222,8 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -224,21 +260,59 @@ export class EmbedJobs { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -274,7 +348,6 @@ export class EmbedJobs { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -299,8 +372,8 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -332,21 +405,59 @@ export class EmbedJobs { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -382,7 +493,6 @@ export class EmbedJobs { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -407,8 +517,8 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -434,21 +544,59 @@ export class EmbedJobs { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, diff --git a/src/api/resources/finetuning/client/Client.ts b/src/api/resources/finetuning/client/Client.ts index 37d53aba..5d848479 100644 --- a/src/api/resources/finetuning/client/Client.ts +++ b/src/api/resources/finetuning/client/Client.ts @@ -84,8 +84,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -186,8 +186,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -284,8 +284,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -377,8 +377,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -480,8 +480,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -594,8 +594,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -700,8 +700,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, diff --git a/src/api/resources/finetuning/client/requests/FinetuningListEventsRequest.ts b/src/api/resources/finetuning/client/requests/FinetuningListEventsRequest.ts index 0d771bfc..b96e5bd4 100644 --- a/src/api/resources/finetuning/client/requests/FinetuningListEventsRequest.ts +++ b/src/api/resources/finetuning/client/requests/FinetuningListEventsRequest.ts @@ -8,8 +8,7 @@ */ export interface FinetuningListEventsRequest { /** - * Maximum number of results to be returned by the server. If 0, defaults to - * 50. + * Maximum number of results to be returned by the server. If 0, defaults to 50. */ pageSize?: number; /** @@ -22,7 +21,8 @@ export interface FinetuningListEventsRequest { * " desc" to the field name. For example: "created_at desc,name". * * Supported sorting fields: - * - created_at (default) + * + * - created_at (default) */ orderBy?: string; } diff --git a/src/api/resources/finetuning/client/requests/FinetuningListFinetunedModelsRequest.ts b/src/api/resources/finetuning/client/requests/FinetuningListFinetunedModelsRequest.ts index 48ea8b27..833f92db 100644 --- a/src/api/resources/finetuning/client/requests/FinetuningListFinetunedModelsRequest.ts +++ b/src/api/resources/finetuning/client/requests/FinetuningListFinetunedModelsRequest.ts @@ -8,8 +8,7 @@ */ export interface FinetuningListFinetunedModelsRequest { /** - * Maximum number of results to be returned by the server. If 0, defaults to - * 50. + * Maximum number of results to be returned by the server. If 0, defaults to 50. */ pageSize?: number; /** @@ -22,7 +21,8 @@ export interface FinetuningListFinetunedModelsRequest { * " desc" to the field name. For example: "created_at desc,name". * * Supported sorting fields: - * - created_at (default) + * + * - created_at (default) */ orderBy?: string; } diff --git a/src/api/resources/finetuning/client/requests/FinetuningListTrainingStepMetricsRequest.ts b/src/api/resources/finetuning/client/requests/FinetuningListTrainingStepMetricsRequest.ts index b9661fec..535c0b83 100644 --- a/src/api/resources/finetuning/client/requests/FinetuningListTrainingStepMetricsRequest.ts +++ b/src/api/resources/finetuning/client/requests/FinetuningListTrainingStepMetricsRequest.ts @@ -8,8 +8,7 @@ */ export interface FinetuningListTrainingStepMetricsRequest { /** - * Maximum number of results to be returned by the server. If 0, defaults to - * 50. + * Maximum number of results to be returned by the server. If 0, defaults to 50. */ pageSize?: number; /** diff --git a/src/api/resources/finetuning/resources/finetuning/types/BaseType.ts b/src/api/resources/finetuning/resources/finetuning/types/BaseType.ts index 20b88699..3482f187 100644 --- a/src/api/resources/finetuning/resources/finetuning/types/BaseType.ts +++ b/src/api/resources/finetuning/resources/finetuning/types/BaseType.ts @@ -5,11 +5,11 @@ /** * The possible types of fine-tuned models. * - * - BASE_TYPE_UNSPECIFIED: Unspecified model. - * - BASE_TYPE_GENERATIVE: Deprecated: Generative model. - * - BASE_TYPE_CLASSIFICATION: Classification model. - * - BASE_TYPE_RERANK: Rerank model. - * - BASE_TYPE_CHAT: Chat model. + * - BASE_TYPE_UNSPECIFIED: Unspecified model. + * - BASE_TYPE_GENERATIVE: Deprecated: Generative model. + * - BASE_TYPE_CLASSIFICATION: Classification model. + * - BASE_TYPE_RERANK: Rerank model. + * - BASE_TYPE_CHAT: Chat model. */ export type BaseType = | "BASE_TYPE_UNSPECIFIED" diff --git a/src/api/resources/finetuning/resources/finetuning/types/LoraTargetModules.ts b/src/api/resources/finetuning/resources/finetuning/types/LoraTargetModules.ts index b3c17c8b..4a503750 100644 --- a/src/api/resources/finetuning/resources/finetuning/types/LoraTargetModules.ts +++ b/src/api/resources/finetuning/resources/finetuning/types/LoraTargetModules.ts @@ -5,10 +5,10 @@ /** * The possible combinations of LoRA modules to target. * - * - LORA_TARGET_MODULES_UNSPECIFIED: Unspecified LoRA target modules. - * - LORA_TARGET_MODULES_QV: LoRA adapts the query and value matrices in transformer attention layers. - * - LORA_TARGET_MODULES_QKVO: LoRA adapts query, key, value, and output matrices in attention layers. - * - LORA_TARGET_MODULES_QKVO_FFN: LoRA adapts attention projection matrices and feed-forward networks (FFN). + * - LORA_TARGET_MODULES_UNSPECIFIED: Unspecified LoRA target modules. + * - LORA_TARGET_MODULES_QV: LoRA adapts the query and value matrices in transformer attention layers. + * - LORA_TARGET_MODULES_QKVO: LoRA adapts query, key, value, and output matrices in attention layers. + * - LORA_TARGET_MODULES_QKVO_FFN: LoRA adapts attention projection matrices and feed-forward networks (FFN). */ export type LoraTargetModules = | "LORA_TARGET_MODULES_UNSPECIFIED" diff --git a/src/api/resources/finetuning/resources/finetuning/types/Status.ts b/src/api/resources/finetuning/resources/finetuning/types/Status.ts index 04f72b89..6a76d4c7 100644 --- a/src/api/resources/finetuning/resources/finetuning/types/Status.ts +++ b/src/api/resources/finetuning/resources/finetuning/types/Status.ts @@ -5,15 +5,15 @@ /** * The possible stages of a fine-tuned model life-cycle. * - * - STATUS_UNSPECIFIED: Unspecified status. - * - STATUS_FINETUNING: The fine-tuned model is being fine-tuned. - * - STATUS_DEPLOYING_API: Deprecated: The fine-tuned model is being deployed. - * - STATUS_READY: The fine-tuned model is ready to receive requests. - * - STATUS_FAILED: The fine-tuned model failed. - * - STATUS_DELETED: The fine-tuned model was deleted. - * - STATUS_TEMPORARILY_OFFLINE: Deprecated: The fine-tuned model is temporarily unavailable. - * - STATUS_PAUSED: Deprecated: The fine-tuned model is paused (Vanilla only). - * - STATUS_QUEUED: The fine-tuned model is queued for training. + * - STATUS_UNSPECIFIED: Unspecified status. + * - STATUS_FINETUNING: The fine-tuned model is being fine-tuned. + * - STATUS_DEPLOYING_API: Deprecated: The fine-tuned model is being deployed. + * - STATUS_READY: The fine-tuned model is ready to receive requests. + * - STATUS_FAILED: The fine-tuned model failed. + * - STATUS_DELETED: The fine-tuned model was deleted. + * - STATUS_TEMPORARILY_OFFLINE: Deprecated: The fine-tuned model is temporarily unavailable. + * - STATUS_PAUSED: Deprecated: The fine-tuned model is paused (Vanilla only). + * - STATUS_QUEUED: The fine-tuned model is queued for training. */ export type Status = | "STATUS_UNSPECIFIED" diff --git a/src/api/resources/finetuning/resources/finetuning/types/Strategy.ts b/src/api/resources/finetuning/resources/finetuning/types/Strategy.ts index 455569d8..d9a499e4 100644 --- a/src/api/resources/finetuning/resources/finetuning/types/Strategy.ts +++ b/src/api/resources/finetuning/resources/finetuning/types/Strategy.ts @@ -5,9 +5,9 @@ /** * The possible strategy used to serve a fine-tuned models. * - * - STRATEGY_UNSPECIFIED: Unspecified strategy. - * - STRATEGY_VANILLA: Deprecated: Serve the fine-tuned model on a dedicated GPU. - * - STRATEGY_TFEW: Deprecated: Serve the fine-tuned model on a shared GPU. + * - STRATEGY_UNSPECIFIED: Unspecified strategy. + * - STRATEGY_VANILLA: Deprecated: Serve the fine-tuned model on a dedicated GPU. + * - STRATEGY_TFEW: Deprecated: Serve the fine-tuned model on a shared GPU. */ export type Strategy = "STRATEGY_UNSPECIFIED" | "STRATEGY_VANILLA" | "STRATEGY_TFEW"; export const Strategy = { diff --git a/src/api/resources/models/client/Client.ts b/src/api/resources/models/client/Client.ts index f5e4fcf5..f77527d2 100644 --- a/src/api/resources/models/client/Client.ts +++ b/src/api/resources/models/client/Client.ts @@ -47,7 +47,6 @@ export class Models { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -72,8 +71,8 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -105,21 +104,59 @@ export class Models { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -155,7 +192,6 @@ export class Models { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -201,8 +237,8 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -235,21 +271,59 @@ export class Models { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, diff --git a/src/api/resources/v2/client/Client.ts b/src/api/resources/v2/client/Client.ts index fe60ae83..c01cd441 100644 --- a/src/api/resources/v2/client/Client.ts +++ b/src/api/resources/v2/client/Client.ts @@ -37,14 +37,14 @@ export class V2 { constructor(protected readonly _options: V2.Options = {}) {} /** - * Generates a text response to a user message. To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api). + * Generates a text response to a user message and streams it down, token by token. To learn how to use the Chat API with streaming follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api). * * Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) for instructions on moving from API v1 to API v2. */ public async chatStream( request: Cohere.V2ChatStreamRequest, requestOptions?: V2.RequestOptions - ): Promise> { + ): Promise> { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production, @@ -59,8 +59,8 @@ export class V2 { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -84,7 +84,7 @@ export class V2 { return new core.Stream({ stream: _response.body, parse: async (data) => { - return serializers.StreamedChatResponseV2.parseOrThrow(data, { + return serializers.V2ChatStreamResponse.parseOrThrow(data, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -111,21 +111,59 @@ export class V2 { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -163,7 +201,6 @@ export class V2 { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -172,15 +209,93 @@ export class V2 { * * @example * await client.v2.chat({ - * model: "model", + * model: "command-r", + * messages: [{ + * role: "user", + * content: "Tell me about LLMs" + * }] + * }) + * + * @example + * await client.v2.chat({ + * model: "command-r", + * documents: [{ + * data: { + * "content": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters", + * "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHern\u00E1n Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." + * } + * }, { + * data: { + * "content": "CSPC: NSYNC Popularity Analysis - ChartMasters", + * "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven\u2019t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn\u2019t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." + * } + * }, { + * data: { + * "content": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters", + * "snippet": "1997, 1998, 2000 and 2001 also rank amongst some of the very best years.\nYet the way many music consumers \u2013 especially teenagers and young women\u2019s \u2013 embraced their output deserves its own chapter. If Jonas Brothers and more recently One Direction reached a great level of popularity during the past decade, the type of success achieved by Backstreet Boys is in a completely different level as they really dominated the business for a few years all over the world, including in some countries that were traditionally hard to penetrate for Western artists.\n\nWe will try to analyze the extent of that hegemony with this new article with final results which will more than surprise many readers." + * } + * }, { + * data: { + * "content": "CSPC: NSYNC Popularity Analysis - ChartMasters", + * "snippet": "Was the teen group led by Justin Timberlake really that big? Was it only in the US where they found success? Or were they a global phenomenon?\nAs usual, I\u2019ll be using the Commensurate Sales to Popularity Concept in order to relevantly gauge their results. This concept will not only bring you sales information for all NSYNC\u2018s albums, physical and download singles, as well as audio and video streaming, but it will also determine their true popularity. If you are not yet familiar with the CSPC method, the next page explains it with a short video. I fully recommend watching the video before getting into the sales figures." + * } + * }], + * messages: [{ + * role: "user", + * content: "Who is more popular: Nsync or Backstreet Boys?" + * }] + * }) + * + * @example + * await client.v2.chat({ + * model: "command-r", * messages: [{ - * role: "tool", - * toolCallId: "messages", - * content: "messages" + * role: "user", + * content: "Tell me about LLMs" + * }], + * tools: [{ + * type: "function", + * function: { + * name: "query_daily_sales_report", + * description: "Connects to a database to retrieve overall sales volumes and sales information for a given day.", + * parameters: { + * "type": "object", + * "properties": { + * "day": { + * "description": "Retrieves sales data for this day, formatted as YYYY-MM-DD.", + * "type": "str" + * } + * }, + * "required": [ + * "day" + * ] + * } + * } + * }, { + * type: "function", + * function: { + * name: "query_product_catalog", + * description: "Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.", + * parameters: { + * "type": "object", + * "properties": { + * "category": { + * "description": "Retrieves product information data for all products in this category.", + * "type": "str" + * } + * }, + * "required": [ + * "category" + * ] + * } + * } * }] * }) */ - public async chat(request: Cohere.V2ChatRequest, requestOptions?: V2.RequestOptions): Promise { + public async chat( + request: Cohere.V2ChatRequest, + requestOptions?: V2.RequestOptions + ): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.CohereEnvironment.Production, @@ -195,8 +310,8 @@ export class V2 { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -216,7 +331,7 @@ export class V2 { abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return serializers.ChatResponse.parseOrThrow(_response.body, { + return serializers.V2ChatResponse.parseOrThrow(_response.body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -236,21 +351,59 @@ export class V2 { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -290,7 +443,6 @@ export class V2 { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -299,8 +451,17 @@ export class V2 { * * @example * await client.v2.embed({ - * model: "model", - * inputType: "search_document", + * model: "embed-english-v3.0", + * inputType: "image", + * embeddingTypes: ["float"], + * images: ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29tcHJlc3NlZCBieSBqcGVnLXJlY29tcHJlc3P/2wCEAAQEBAQEBAQEBAQGBgUGBggHBwcHCAwJCQkJCQwTDA4MDA4MExEUEA8QFBEeFxUVFx4iHRsdIiolJSo0MjRERFwBBAQEBAQEBAQEBAYGBQYGCAcHBwcIDAkJCQkJDBMMDgwMDgwTERQQDxAUER4XFRUXHiIdGx0iKiUlKjQyNEREXP/CABEIAZABkAMBIgACEQEDEQH/xAAdAAEAAQQDAQA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YDWSdpPcPLZ6V9HEmikxOxjAlQaUqL9Q7x5+2xgCrrmG8/p9OrIDAg8CKkTQd07iRsdBcPV3ucSkX9H9KP1O8naIBBBG410gsBh2K3MCDKNjrE/2tSLpuqDtIFKAqhRwA6y9GVw/mAdjohEEwK2I4u0jH/Lb6exgXljL2tEwP9pq0GdzF69bfHO4fyAGx0ScPgVpl9JkB/yO309cG6w9O0ROeZq3bQnib/UOsJyBJqV9ZI7952Ogl8DDdYezfEra1B5HcdvpTfC+xicoc44QIl/t4/z7LaUTRK3bwPr1d9PoJqlPxN/A2cOvpsNvIbyA/Eh3jvHaDWHYjbYnapdWzgg/qHap7js9JseTDLZreBwbuVSAB9AP1GiSSSeJ9ltcGB8/pPEUjq6hlOYPU3FykC97dgp3aRi7HMnaw3FbzCptdaSZeJDvVh5isO6aYdcqq3gNvJ25705ikxXDJAGS/gI/5FqfHMIt10pb+H0DBjyGdYr03XRaLCojnw1sg/6FTTSzyPNNIXkc5szHMnYhuJIDmh3doPCo7+F9z5oaE0R4SrzrWR/cXnWsj+4vOtZH9xeYrWx/cXmKe6gTjID6b6lxAnMQrl5mmYsSzEkn92//2Q=="] + * }) + * + * @example + * await client.v2.embed({ + * texts: ["hello", "goodbye"], + * model: "embed-english-v3.0", + * inputType: "classification", * embeddingTypes: ["float"] * }) */ @@ -322,8 +483,8 @@ export class V2 { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -360,21 +521,59 @@ export class V2 { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, @@ -410,7 +609,6 @@ export class V2 { * @throws {@link Cohere.NotFoundError} * @throws {@link Cohere.UnprocessableEntityError} * @throws {@link Cohere.TooManyRequestsError} - * @throws {@link Cohere.InvalidTokenError} * @throws {@link Cohere.ClientClosedRequestError} * @throws {@link Cohere.InternalServerError} * @throws {@link Cohere.NotImplementedError} @@ -419,9 +617,10 @@ export class V2 { * * @example * await client.v2.rerank({ - * model: "model", - * query: "query", - * documents: ["documents"] + * documents: ["Carson City is the capital city of the American state of Nevada.", "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.", "Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.", "Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.", "Capital punishment has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states."], + * query: "What is the capital of the United States?", + * topN: 3, + * model: "rerank-v3.5" * }) */ public async rerank( @@ -442,8 +641,8 @@ export class V2 { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.15.4", - "User-Agent": "cohere-ai/7.15.4", + "X-Fern-SDK-Version": "8.0.0", + "User-Agent": "cohere-ai/8.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, ...requestOptions?.headers, @@ -480,21 +679,59 @@ export class V2 { case 404: throw new Cohere.NotFoundError(_response.error.body); case 422: - throw new Cohere.UnprocessableEntityError(_response.error.body); + throw new Cohere.UnprocessableEntityError( + serializers.UnprocessableEntityErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 429: - throw new Cohere.TooManyRequestsError(_response.error.body); - case 498: - throw new Cohere.InvalidTokenError(_response.error.body); + throw new Cohere.TooManyRequestsError( + serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 499: - throw new Cohere.ClientClosedRequestError(_response.error.body); + throw new Cohere.ClientClosedRequestError( + serializers.ClientClosedRequestErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 500: throw new Cohere.InternalServerError(_response.error.body); case 501: - throw new Cohere.NotImplementedError(_response.error.body); + throw new Cohere.NotImplementedError( + serializers.NotImplementedErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); case 503: throw new Cohere.ServiceUnavailableError(_response.error.body); case 504: - throw new Cohere.GatewayTimeoutError(_response.error.body); + throw new Cohere.GatewayTimeoutError( + serializers.GatewayTimeoutErrorBody.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); default: throw new errors.CohereError({ statusCode: _response.error.statusCode, diff --git a/src/api/resources/v2/client/requests/V2ChatRequest.ts b/src/api/resources/v2/client/requests/V2ChatRequest.ts index 2fbff2e5..70e701aa 100644 --- a/src/api/resources/v2/client/requests/V2ChatRequest.ts +++ b/src/api/resources/v2/client/requests/V2ChatRequest.ts @@ -7,11 +7,86 @@ import * as Cohere from "../../../../index"; /** * @example * { - * model: "model", + * model: "command-r", * messages: [{ - * role: "tool", - * toolCallId: "messages", - * content: "messages" + * role: "user", + * content: "Tell me about LLMs" + * }] + * } + * + * @example + * { + * model: "command-r", + * documents: [{ + * data: { + * "content": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters", + * "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHern\u00E1n Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak." + * } + * }, { + * data: { + * "content": "CSPC: NSYNC Popularity Analysis - ChartMasters", + * "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven\u2019t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn\u2019t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold." + * } + * }, { + * data: { + * "content": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters", + * "snippet": "1997, 1998, 2000 and 2001 also rank amongst some of the very best years.\nYet the way many music consumers \u2013 especially teenagers and young women\u2019s \u2013 embraced their output deserves its own chapter. If Jonas Brothers and more recently One Direction reached a great level of popularity during the past decade, the type of success achieved by Backstreet Boys is in a completely different level as they really dominated the business for a few years all over the world, including in some countries that were traditionally hard to penetrate for Western artists.\n\nWe will try to analyze the extent of that hegemony with this new article with final results which will more than surprise many readers." + * } + * }, { + * data: { + * "content": "CSPC: NSYNC Popularity Analysis - ChartMasters", + * "snippet": "Was the teen group led by Justin Timberlake really that big? Was it only in the US where they found success? Or were they a global phenomenon?\nAs usual, I\u2019ll be using the Commensurate Sales to Popularity Concept in order to relevantly gauge their results. This concept will not only bring you sales information for all NSYNC\u2018s albums, physical and download singles, as well as audio and video streaming, but it will also determine their true popularity. If you are not yet familiar with the CSPC method, the next page explains it with a short video. I fully recommend watching the video before getting into the sales figures." + * } + * }], + * messages: [{ + * role: "user", + * content: "Who is more popular: Nsync or Backstreet Boys?" + * }] + * } + * + * @example + * { + * model: "command-r", + * messages: [{ + * role: "user", + * content: "Tell me about LLMs" + * }], + * tools: [{ + * type: "function", + * function: { + * name: "query_daily_sales_report", + * description: "Connects to a database to retrieve overall sales volumes and sales information for a given day.", + * parameters: { + * "type": "object", + * "properties": { + * "day": { + * "description": "Retrieves sales data for this day, formatted as YYYY-MM-DD.", + * "type": "str" + * } + * }, + * "required": [ + * "day" + * ] + * } + * } + * }, { + * type: "function", + * function: { + * name: "query_product_catalog", + * description: "Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.", + * parameters: { + * "type": "object", + * "properties": { + * "category": { + * "description": "Retrieves product information data for all products in this category.", + * "type": "str" + * } + * }, + * "required": [ + * "category" + * ] + * } + * } * }] * } */ @@ -105,8 +180,6 @@ export interface V2ChatRequest { * */ p?: number; - /** Whether to return the prompt in the response. */ - returnPrompt?: boolean; /** * Defaults to `false`. When set to `true`, the log probabilities of the generated tokens will be included in the response. * diff --git a/src/api/resources/v2/client/requests/V2ChatStreamRequest.ts b/src/api/resources/v2/client/requests/V2ChatStreamRequest.ts index bb6468d2..f33d9b04 100644 --- a/src/api/resources/v2/client/requests/V2ChatStreamRequest.ts +++ b/src/api/resources/v2/client/requests/V2ChatStreamRequest.ts @@ -7,11 +7,10 @@ import * as Cohere from "../../../../index"; /** * @example * { - * model: "model", + * model: "command-r", * messages: [{ - * role: "tool", - * toolCallId: "messages", - * content: "messages" + * role: "user", + * content: "Hello!" * }] * } */ @@ -105,8 +104,6 @@ export interface V2ChatStreamRequest { * */ p?: number; - /** Whether to return the prompt in the response. */ - returnPrompt?: boolean; /** * Defaults to `false`. When set to `true`, the log probabilities of the generated tokens will be included in the response. * diff --git a/src/api/resources/v2/client/requests/V2EmbedRequest.ts b/src/api/resources/v2/client/requests/V2EmbedRequest.ts index 59a133bf..8072310a 100644 --- a/src/api/resources/v2/client/requests/V2EmbedRequest.ts +++ b/src/api/resources/v2/client/requests/V2EmbedRequest.ts @@ -7,8 +7,17 @@ import * as Cohere from "../../../../index"; /** * @example * { - * model: "model", - * inputType: "search_document", + * model: "embed-english-v3.0", + * inputType: "image", + * embeddingTypes: ["float"], + * images: ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAfQ29tcHJlc3NlZCBieSBqcGVnLXJlY29tcHJlc3P/2wCEAAQEBAQEBAQEBAQGBgUGBggHBwcHCAwJCQkJCQwTDA4MDA4MExEUEA8QFBEeFxUVFx4iHRsdIiolJSo0MjRERFwBBAQEBAQEBAQEBAYGBQYGCAcHBwcIDAkJCQkJDBMMDgwMDgwTERQQDxAUER4XFRUXHiIdGx0iKiUlKjQyNEREXP/CABEIAZABkAMBIgACEQEDEQH/xAAdAAEAAQQDAQAAAAAAAAAAAAAABwEFBggCAwQJ/9oACAEBAAAAAN/gAAAAAAAAAAAAAAAAAAAAAAAAAAHTg9j6agAAp23/ADjsAAAPFrlAUYeagAAArdZ12uzcAAKax6jWUAAAAO/bna+oAC1aBxAAAAAAbM7rVABYvnRgYAAAAAbwbIABw+cMYAAAAAAvH1CuwA091RAAAAAAbpbPAGJfMXzAAAAAAJk+hdQGlmsQAAAAABk31JqBx+V1iAAAAAALp9W6gRp826AAAAAAGS/UqoGuGjwAAAAAAl76I1A1K1EAAAAAAG5G1ADUHU0AAAAAAu/1Cu4DVbTgAAAAAA3n2JAIG0IAAAAAArt3toAMV+XfEAAAAAL1uzPlQBT5qR2AAAAAenZDbm/AAa06SgAAAAerYra/LQADp+YmIAAAAC77J7Q5KAACIPnjwAAAAzbZzY24gAAGq+m4AAA7Zo2cmaoAAANWdOOAAAMl2N2TysAAAApEOj2HgAOyYtl5w5jw4zZPJyuGQ5H2AAAdes+suDUAVyfYbZTLajG8HxjgD153n3IAABH8QxxiVo4XPKpGlyTKjowvCbUAF4mD3AAACgqCzYPiPQAA900XAACmN4favRk+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nMQrl5mmYsSzEkn92//2Q=="] + * } + * + * @example + * { + * texts: ["hello", "goodbye"], + * model: "embed-english-v3.0", + * inputType: "classification", * embeddingTypes: ["float"] * } */ diff --git a/src/api/resources/v2/client/requests/V2RerankRequest.ts b/src/api/resources/v2/client/requests/V2RerankRequest.ts index b3dc57bb..331576b3 100644 --- a/src/api/resources/v2/client/requests/V2RerankRequest.ts +++ b/src/api/resources/v2/client/requests/V2RerankRequest.ts @@ -5,9 +5,10 @@ /** * @example * { - * model: "model", - * query: "query", - * documents: ["documents"] + * documents: ["Carson City is the capital city of the American state of Nevada.", "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.", "Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.", "Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.", "Capital punishment has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states."], + * query: "What is the capital of the United States?", + * topN: 3, + * model: "rerank-v3.5" * } */ export interface V2RerankRequest { @@ -26,11 +27,6 @@ export interface V2RerankRequest { documents: string[]; /** Limits the number of returned rerank results to the specified value. If not passed, all the rerank results will be returned. */ topN?: number; - /** - * - If false, returns results without the doc text - the api will return a list of {index, relevance score} where index is inferred from the list passed into the request. - * - If true, returns results with the doc text passed in - the api will return an ordered list of {index, text, relevance score} where index + text refers to the list passed into the request. - */ - returnDocuments?: boolean; /** Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens. */ maxTokensPerDoc?: number; } diff --git a/src/api/types/ChatResponse.ts b/src/api/resources/v2/types/V2ChatResponse.ts similarity index 63% rename from src/api/types/ChatResponse.ts rename to src/api/resources/v2/types/V2ChatResponse.ts index ce6acd33..b1dc2c1d 100644 --- a/src/api/types/ChatResponse.ts +++ b/src/api/resources/v2/types/V2ChatResponse.ts @@ -2,14 +2,12 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Cohere from "../index"; +import * as Cohere from "../../../index"; -export interface ChatResponse { +export interface V2ChatResponse { /** Unique identifier for the generated reply. Useful for submitting feedback. */ id: string; finishReason: Cohere.ChatFinishReason; - /** The prompt that was used. Only present when `return_prompt` in the request is set to true. */ - prompt?: string; message: Cohere.AssistantMessageResponse; usage?: Cohere.Usage; logprobs?: Cohere.LogprobItem[]; diff --git a/src/api/types/StreamedChatResponseV2.ts b/src/api/resources/v2/types/V2ChatStreamResponse.ts similarity index 68% rename from src/api/types/StreamedChatResponseV2.ts rename to src/api/resources/v2/types/V2ChatStreamResponse.ts index dc8a0556..fe8382b5 100644 --- a/src/api/types/StreamedChatResponseV2.ts +++ b/src/api/resources/v2/types/V2ChatStreamResponse.ts @@ -2,26 +2,26 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Cohere from "../index"; +import * as Cohere from "../../../index"; /** * StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request). */ -export type StreamedChatResponseV2 = - | Cohere.StreamedChatResponseV2.MessageStart - | Cohere.StreamedChatResponseV2.ContentStart - | Cohere.StreamedChatResponseV2.ContentDelta - | Cohere.StreamedChatResponseV2.ContentEnd - | Cohere.StreamedChatResponseV2.ToolPlanDelta - | Cohere.StreamedChatResponseV2.ToolCallStart - | Cohere.StreamedChatResponseV2.ToolCallDelta - | Cohere.StreamedChatResponseV2.ToolCallEnd - | Cohere.StreamedChatResponseV2.CitationStart - | Cohere.StreamedChatResponseV2.CitationEnd - | Cohere.StreamedChatResponseV2.MessageEnd - | Cohere.StreamedChatResponseV2.Debug; +export type V2ChatStreamResponse = + | Cohere.V2ChatStreamResponse.MessageStart + | Cohere.V2ChatStreamResponse.ContentStart + | Cohere.V2ChatStreamResponse.ContentDelta + | Cohere.V2ChatStreamResponse.ContentEnd + | Cohere.V2ChatStreamResponse.ToolPlanDelta + | Cohere.V2ChatStreamResponse.ToolCallStart + | Cohere.V2ChatStreamResponse.ToolCallDelta + | Cohere.V2ChatStreamResponse.ToolCallEnd + | Cohere.V2ChatStreamResponse.CitationStart + | Cohere.V2ChatStreamResponse.CitationEnd + | Cohere.V2ChatStreamResponse.MessageEnd + | Cohere.V2ChatStreamResponse.Debug; -export namespace StreamedChatResponseV2 { +export namespace V2ChatStreamResponse { export interface MessageStart extends Cohere.ChatMessageStartEvent { type: "message-start"; } diff --git a/src/api/resources/v2/types/V2RerankResponseResultsItem.ts b/src/api/resources/v2/types/V2RerankResponseResultsItem.ts index 64c5b03b..2abbaa14 100644 --- a/src/api/resources/v2/types/V2RerankResponseResultsItem.ts +++ b/src/api/resources/v2/types/V2RerankResponseResultsItem.ts @@ -2,11 +2,7 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as Cohere from "../../../index"; - export interface V2RerankResponseResultsItem { - /** If `return_documents` is set as `false` this will return none, if `true` it will return the documents passed in */ - document?: Cohere.V2RerankResponseResultsItemDocument; /** Corresponds to the index in the original list of documents to which the ranked document belongs. (i.e. if the first value in the `results` object has an `index` value of 3, it means in the list of documents passed in, the document at `index=3` had the highest relevance) */ index: number; /** Relevance scores are normalized to be in the range `[0, 1]`. Scores close to `1` indicate a high relevance to the query, and scores closer to `0` indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45 */ diff --git a/src/api/resources/v2/types/V2RerankResponseResultsItemDocument.ts b/src/api/resources/v2/types/V2RerankResponseResultsItemDocument.ts deleted file mode 100644 index aba00dbe..00000000 --- a/src/api/resources/v2/types/V2RerankResponseResultsItemDocument.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * If `return_documents` is set as `false` this will return none, if `true` it will return the documents passed in - */ -export interface V2RerankResponseResultsItemDocument { - /** The text of the document to rerank */ - text: string; -} diff --git a/src/api/resources/v2/types/index.ts b/src/api/resources/v2/types/index.ts index 56d3128e..35057865 100644 --- a/src/api/resources/v2/types/index.ts +++ b/src/api/resources/v2/types/index.ts @@ -1,10 +1,11 @@ export * from "./V2ChatStreamRequestDocumentsItem"; export * from "./V2ChatStreamRequestSafetyMode"; export * from "./V2ChatStreamRequestToolChoice"; +export * from "./V2ChatStreamResponse"; export * from "./V2ChatRequestDocumentsItem"; export * from "./V2ChatRequestSafetyMode"; export * from "./V2ChatRequestToolChoice"; +export * from "./V2ChatResponse"; export * from "./V2EmbedRequestTruncate"; -export * from "./V2RerankResponseResultsItemDocument"; export * from "./V2RerankResponseResultsItem"; export * from "./V2RerankResponse"; diff --git a/src/api/types/ChatRequestConnectorsSearchOptions.ts b/src/api/types/ChatRequestConnectorsSearchOptions.ts deleted file mode 100644 index 2312ae73..00000000 --- a/src/api/types/ChatRequestConnectorsSearchOptions.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * (internal) Sets inference and model options for RAG search query and tool use generations. Defaults are used when options are not specified here, meaning that other parameters outside of connectors_search_options are ignored (such as model= or temperature=). - */ -export interface ChatRequestConnectorsSearchOptions { - /** - * If specified, the backend will make a best effort to sample tokens - * deterministically, such that repeated requests with the same - * seed and parameters should return the same result. However, - * determinism cannot be totally guaranteed. - * - * Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments - */ - seed?: number; -} diff --git a/src/api/types/ChatRequestPromptTruncation.ts b/src/api/types/ChatRequestPromptTruncation.ts index c4db05a2..07227bb8 100644 --- a/src/api/types/ChatRequestPromptTruncation.ts +++ b/src/api/types/ChatRequestPromptTruncation.ts @@ -14,8 +14,9 @@ * With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned. * * Compatible Deployments: - * - AUTO: Cohere Platform Only - * - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + * + * - AUTO: Cohere Platform Only + * - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments */ export type ChatRequestPromptTruncation = "OFF" | "AUTO" | "AUTO_PRESERVE_ORDER"; export const ChatRequestPromptTruncation = { diff --git a/src/api/types/ChatStreamRequestConnectorsSearchOptions.ts b/src/api/types/ChatStreamRequestConnectorsSearchOptions.ts deleted file mode 100644 index 741b7e04..00000000 --- a/src/api/types/ChatStreamRequestConnectorsSearchOptions.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -/** - * (internal) Sets inference and model options for RAG search query and tool use generations. Defaults are used when options are not specified here, meaning that other parameters outside of connectors_search_options are ignored (such as model= or temperature=). - */ -export interface ChatStreamRequestConnectorsSearchOptions { - /** - * If specified, the backend will make a best effort to sample tokens - * deterministically, such that repeated requests with the same - * seed and parameters should return the same result. However, - * determinism cannot be totally guaranteed. - * - * Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments - */ - seed?: number; -} diff --git a/src/api/types/ChatStreamRequestPromptTruncation.ts b/src/api/types/ChatStreamRequestPromptTruncation.ts index 72ba8fa2..4cfe1ce7 100644 --- a/src/api/types/ChatStreamRequestPromptTruncation.ts +++ b/src/api/types/ChatStreamRequestPromptTruncation.ts @@ -14,8 +14,9 @@ * With `prompt_truncation` set to "OFF", no elements will be dropped. If the sum of the inputs exceeds the model's context length limit, a `TooManyTokens` error will be returned. * * Compatible Deployments: - * - AUTO: Cohere Platform Only - * - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments + * + * - AUTO: Cohere Platform Only + * - AUTO_PRESERVE_ORDER: Azure, AWS Sagemaker/Bedrock, Private Deployments */ export type ChatStreamRequestPromptTruncation = "OFF" | "AUTO" | "AUTO_PRESERVE_ORDER"; export const ChatStreamRequestPromptTruncation = { diff --git a/src/api/types/ClientClosedRequestErrorBody.ts b/src/api/types/ClientClosedRequestErrorBody.ts new file mode 100644 index 00000000..8c199217 --- /dev/null +++ b/src/api/types/ClientClosedRequestErrorBody.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ClientClosedRequestErrorBody { + data?: string; +} diff --git a/src/api/types/GatewayTimeoutErrorBody.ts b/src/api/types/GatewayTimeoutErrorBody.ts new file mode 100644 index 00000000..b9350446 --- /dev/null +++ b/src/api/types/GatewayTimeoutErrorBody.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface GatewayTimeoutErrorBody { + data?: string; +} diff --git a/src/api/types/JsonResponseFormat.ts b/src/api/types/JsonResponseFormat.ts index 0efa1c49..98651e7f 100644 --- a/src/api/types/JsonResponseFormat.ts +++ b/src/api/types/JsonResponseFormat.ts @@ -6,12 +6,13 @@ export interface JsonResponseFormat { /** * A JSON schema object that the output will adhere to. There are some restrictions we have on the schema, refer to [our guide](https://docs.cohere.com/docs/structured-outputs-json#schema-constraints) for more information. * Example (required name and age object): + * * ```json * { * "type": "object", * "properties": { - * "name": {"type": "string"}, - * "age": {"type": "integer"} + * "name": { "type": "string" }, + * "age": { "type": "integer" } * }, * "required": ["name", "age"] * } diff --git a/src/api/types/JsonResponseFormatV2.ts b/src/api/types/JsonResponseFormatV2.ts index ebfa3354..3e80d85b 100644 --- a/src/api/types/JsonResponseFormatV2.ts +++ b/src/api/types/JsonResponseFormatV2.ts @@ -6,12 +6,13 @@ export interface JsonResponseFormatV2 { /** * A [JSON schema](https://json-schema.org/overview/what-is-jsonschema) object that the output will adhere to. There are some restrictions we have on the schema, refer to [our guide](https://docs.cohere.com/docs/structured-outputs-json#schema-constraints) for more information. * Example (required name and age object): + * * ```json * { * "type": "object", * "properties": { - * "name": {"type": "string"}, - * "age": {"type": "integer"} + * "name": { "type": "string" }, + * "age": { "type": "integer" } * }, * "required": ["name", "age"] * } diff --git a/src/api/types/Metrics.ts b/src/api/types/Metrics.ts index 954f6a70..a7414812 100644 --- a/src/api/types/Metrics.ts +++ b/src/api/types/Metrics.ts @@ -6,5 +6,4 @@ import * as Cohere from "../index"; export interface Metrics { finetuneDatasetMetrics?: Cohere.FinetuneDatasetMetrics; - embedData?: Cohere.MetricsEmbedData; } diff --git a/src/api/types/MetricsEmbedData.ts b/src/api/types/MetricsEmbedData.ts deleted file mode 100644 index 8cba241a..00000000 --- a/src/api/types/MetricsEmbedData.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Cohere from "../index"; - -export interface MetricsEmbedData { - /** the fields in the dataset */ - fields?: Cohere.MetricsEmbedDataFieldsItem[]; -} diff --git a/src/api/types/MetricsEmbedDataFieldsItem.ts b/src/api/types/MetricsEmbedDataFieldsItem.ts deleted file mode 100644 index 1f1fdb8e..00000000 --- a/src/api/types/MetricsEmbedDataFieldsItem.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export interface MetricsEmbedDataFieldsItem { - /** the name of the field */ - name?: string; - /** the number of times the field appears in the dataset */ - count?: number; -} diff --git a/src/api/types/NonStreamedChatResponse.ts b/src/api/types/NonStreamedChatResponse.ts index f9bbec28..5b2d9b14 100644 --- a/src/api/types/NonStreamedChatResponse.ts +++ b/src/api/types/NonStreamedChatResponse.ts @@ -25,7 +25,5 @@ export interface NonStreamedChatResponse { toolCalls?: Cohere.ToolCall[]; /** A list of previous messages between the user and the model, meant to give the model conversational context for responding to the user's `message`. */ chatHistory?: Cohere.Message[]; - /** The prompt that was used. Only present when `return_prompt` in the request is set to true. */ - prompt?: string; meta?: Cohere.ApiMeta; } diff --git a/src/api/types/NotImplementedErrorBody.ts b/src/api/types/NotImplementedErrorBody.ts new file mode 100644 index 00000000..f4088a4b --- /dev/null +++ b/src/api/types/NotImplementedErrorBody.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface NotImplementedErrorBody { + data?: string; +} diff --git a/src/api/types/ResponseFormat.ts b/src/api/types/ResponseFormat.ts index 7c8f4912..e2ae5440 100644 --- a/src/api/types/ResponseFormat.ts +++ b/src/api/types/ResponseFormat.ts @@ -11,7 +11,7 @@ import * as Cohere from "../index"; * * A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure. * - * **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length. + * **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length. * **Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided). */ export type ResponseFormat = Cohere.ResponseFormat.Text | Cohere.ResponseFormat.JsonObject; diff --git a/src/api/types/ResponseFormatV2.ts b/src/api/types/ResponseFormatV2.ts index 2f891a82..eeca6662 100644 --- a/src/api/types/ResponseFormatV2.ts +++ b/src/api/types/ResponseFormatV2.ts @@ -11,7 +11,7 @@ import * as Cohere from "../index"; * * A [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure. * - * **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length. + * **Note**: When using `{ "type": "json_object" }` your `message` should always explicitly instruct the model to generate a JSON (eg: _"Generate a JSON ..."_) . Otherwise the model may end up getting stuck generating an infinite stream of characters and eventually run out of context length. * * **Note**: When `json_schema` is not specified, the generated object can have up to 5 layers of nesting. * diff --git a/src/api/types/TooManyRequestsErrorBody.ts b/src/api/types/TooManyRequestsErrorBody.ts new file mode 100644 index 00000000..5bc99045 --- /dev/null +++ b/src/api/types/TooManyRequestsErrorBody.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface TooManyRequestsErrorBody { + data?: string; +} diff --git a/src/api/types/Tool.ts b/src/api/types/Tool.ts index e43ede9a..75761f06 100644 --- a/src/api/types/Tool.ts +++ b/src/api/types/Tool.ts @@ -11,6 +11,7 @@ export interface Tool { description: string; /** * The input parameters of the tool. Accepts a dictionary where the key is the name of the parameter and the value is the parameter spec. Valid parameter names contain only the characters `a-z`, `A-Z`, `0-9`, `_` and must not begin with a digit. + * * ``` * { * "my_param": { diff --git a/src/api/types/UnprocessableEntityErrorBody.ts b/src/api/types/UnprocessableEntityErrorBody.ts new file mode 100644 index 00000000..79aa4af5 --- /dev/null +++ b/src/api/types/UnprocessableEntityErrorBody.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface UnprocessableEntityErrorBody { + data?: string; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 3e242408..ceb71d85 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,15 +1,22 @@ export * from "./ChatStreamRequestPromptTruncation"; export * from "./ChatStreamRequestCitationQuality"; -export * from "./ChatStreamRequestConnectorsSearchOptions"; export * from "./ChatStreamRequestSafetyMode"; +export * from "./StreamedChatResponse"; +export * from "./UnprocessableEntityErrorBody"; +export * from "./TooManyRequestsErrorBody"; +export * from "./ClientClosedRequestErrorBody"; +export * from "./NotImplementedErrorBody"; +export * from "./GatewayTimeoutErrorBody"; export * from "./ChatRequestPromptTruncation"; export * from "./ChatRequestCitationQuality"; -export * from "./ChatRequestConnectorsSearchOptions"; export * from "./ChatRequestSafetyMode"; +export * from "./NonStreamedChatResponse"; export * from "./GenerateStreamRequestTruncate"; export * from "./GenerateStreamRequestReturnLikelihoods"; +export * from "./GenerateStreamedResponse"; export * from "./GenerateRequestTruncate"; export * from "./GenerateRequestReturnLikelihoods"; +export * from "./Generation"; export * from "./EmbedRequestTruncate"; export * from "./EmbedResponse"; export * from "./RerankRequestDocumentsItem"; @@ -49,7 +56,6 @@ export * from "./ApiMetaApiVersion"; export * from "./ApiMetaBilledUnits"; export * from "./ApiMetaTokens"; export * from "./ApiMeta"; -export * from "./NonStreamedChatResponse"; export * from "./ChatStreamEvent"; export * from "./ChatStreamStartEvent"; export * from "./ChatSearchQueriesGenerationEvent"; @@ -62,7 +68,6 @@ export * from "./ChatStreamEndEvent"; export * from "./ToolCallDelta"; export * from "./ChatToolCallsChunkEvent"; export * from "./ChatDebugEvent"; -export * from "./StreamedChatResponse"; export * from "./TextContent"; export * from "./Content"; export * from "./UserMessageContent"; @@ -100,7 +105,6 @@ export * from "./UsageBilledUnits"; export * from "./UsageTokens"; export * from "./Usage"; export * from "./LogprobItem"; -export * from "./ChatResponse"; export * from "./ChatStreamEventType"; export * from "./ChatMessageStartEventDeltaMessage"; export * from "./ChatMessageStartEventDelta"; @@ -132,17 +136,14 @@ export * from "./CitationStartEvent"; export * from "./CitationEndEvent"; export * from "./ChatMessageEndEventDelta"; export * from "./ChatMessageEndEvent"; -export * from "./StreamedChatResponseV2"; export * from "./SingleGenerationTokenLikelihoodsItem"; export * from "./SingleGeneration"; -export * from "./Generation"; export * from "./GenerateStreamEvent"; export * from "./GenerateStreamText"; export * from "./SingleGenerationInStream"; export * from "./GenerateStreamEndResponse"; export * from "./GenerateStreamEnd"; export * from "./GenerateStreamError"; -export * from "./GenerateStreamedResponse"; export * from "./EmbedInputType"; export * from "./EmbeddingType"; export * from "./Image"; @@ -165,8 +166,6 @@ export * from "./ChatDataMetrics"; export * from "./LabelMetric"; export * from "./ClassifyDataMetrics"; export * from "./FinetuneDatasetMetrics"; -export * from "./MetricsEmbedDataFieldsItem"; -export * from "./MetricsEmbedData"; export * from "./Metrics"; export * from "./Dataset"; export * from "./ConnectorOAuth"; diff --git a/src/serialization/client/requests/ChatRequest.ts b/src/serialization/client/requests/ChatRequest.ts index 4e2084b1..820e5757 100644 --- a/src/serialization/client/requests/ChatRequest.ts +++ b/src/serialization/client/requests/ChatRequest.ts @@ -41,8 +41,6 @@ export const ChatRequest: core.serialization.Schema< ), frequencyPenalty: core.serialization.property("frequency_penalty", core.serialization.number().optional()), presencePenalty: core.serialization.property("presence_penalty", core.serialization.number().optional()), - rawPrompting: core.serialization.property("raw_prompting", core.serialization.boolean().optional()), - returnPrompt: core.serialization.property("return_prompt", core.serialization.boolean().optional()), tools: core.serialization.list(Tool).optional(), toolResults: core.serialization.property("tool_results", core.serialization.list(ToolResult).optional()), forceSingleStep: core.serialization.property("force_single_step", core.serialization.boolean().optional()), @@ -71,8 +69,6 @@ export declare namespace ChatRequest { stop_sequences?: string[] | null; frequency_penalty?: number | null; presence_penalty?: number | null; - raw_prompting?: boolean | null; - return_prompt?: boolean | null; tools?: Tool.Raw[] | null; tool_results?: ToolResult.Raw[] | null; force_single_step?: boolean | null; diff --git a/src/serialization/client/requests/ChatStreamRequest.ts b/src/serialization/client/requests/ChatStreamRequest.ts index 70f53971..058962ff 100644 --- a/src/serialization/client/requests/ChatStreamRequest.ts +++ b/src/serialization/client/requests/ChatStreamRequest.ts @@ -41,8 +41,6 @@ export const ChatStreamRequest: core.serialization.Schema< ), frequencyPenalty: core.serialization.property("frequency_penalty", core.serialization.number().optional()), presencePenalty: core.serialization.property("presence_penalty", core.serialization.number().optional()), - rawPrompting: core.serialization.property("raw_prompting", core.serialization.boolean().optional()), - returnPrompt: core.serialization.property("return_prompt", core.serialization.boolean().optional()), tools: core.serialization.list(Tool).optional(), toolResults: core.serialization.property("tool_results", core.serialization.list(ToolResult).optional()), forceSingleStep: core.serialization.property("force_single_step", core.serialization.boolean().optional()), @@ -71,8 +69,6 @@ export declare namespace ChatStreamRequest { stop_sequences?: string[] | null; frequency_penalty?: number | null; presence_penalty?: number | null; - raw_prompting?: boolean | null; - return_prompt?: boolean | null; tools?: Tool.Raw[] | null; tool_results?: ToolResult.Raw[] | null; force_single_step?: boolean | null; diff --git a/src/serialization/resources/datasets/types/DatasetsCreateResponseDatasetPartsItem.ts b/src/serialization/resources/datasets/types/DatasetsCreateResponseDatasetPartsItem.ts deleted file mode 100644 index ab772281..00000000 --- a/src/serialization/resources/datasets/types/DatasetsCreateResponseDatasetPartsItem.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../index"; -import * as Cohere from "../../../../api/index"; -import * as core from "../../../../core"; - -export const DatasetsCreateResponseDatasetPartsItem: core.serialization.ObjectSchema< - serializers.DatasetsCreateResponseDatasetPartsItem.Raw, - Cohere.DatasetsCreateResponseDatasetPartsItem -> = core.serialization.object({ - name: core.serialization.string().optional(), - numRows: core.serialization.property("num_rows", core.serialization.number().optional()), - samples: core.serialization.list(core.serialization.string()).optional(), - partKind: core.serialization.property("part_kind", core.serialization.string().optional()), -}); - -export declare namespace DatasetsCreateResponseDatasetPartsItem { - interface Raw { - name?: string | null; - num_rows?: number | null; - samples?: string[] | null; - part_kind?: string | null; - } -} diff --git a/src/serialization/resources/datasets/types/index.ts b/src/serialization/resources/datasets/types/index.ts index cc2e2520..54dc414b 100644 --- a/src/serialization/resources/datasets/types/index.ts +++ b/src/serialization/resources/datasets/types/index.ts @@ -1,5 +1,4 @@ export * from "./DatasetsListResponse"; -export * from "./DatasetsCreateResponseDatasetPartsItem"; export * from "./DatasetsCreateResponse"; export * from "./DatasetsGetUsageResponse"; export * from "./DatasetsGetResponse"; diff --git a/src/serialization/resources/v2/client/requests/V2ChatRequest.ts b/src/serialization/resources/v2/client/requests/V2ChatRequest.ts index 0c8df01f..a95076ac 100644 --- a/src/serialization/resources/v2/client/requests/V2ChatRequest.ts +++ b/src/serialization/resources/v2/client/requests/V2ChatRequest.ts @@ -35,7 +35,6 @@ export const V2ChatRequest: core.serialization.Schema = +export const V2ChatResponse: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string(), finishReason: core.serialization.property("finish_reason", ChatFinishReason), - prompt: core.serialization.string().optional(), message: AssistantMessageResponse, usage: Usage.optional(), logprobs: core.serialization.list(LogprobItem).optional(), }); -export declare namespace ChatResponse { +export declare namespace V2ChatResponse { interface Raw { id: string; finish_reason: ChatFinishReason.Raw; - prompt?: string | null; message: AssistantMessageResponse.Raw; usage?: Usage.Raw | null; logprobs?: LogprobItem.Raw[] | null; diff --git a/src/serialization/types/StreamedChatResponseV2.ts b/src/serialization/resources/v2/types/V2ChatStreamResponse.ts similarity index 52% rename from src/serialization/types/StreamedChatResponseV2.ts rename to src/serialization/resources/v2/types/V2ChatStreamResponse.ts index 43023467..f825c88d 100644 --- a/src/serialization/types/StreamedChatResponseV2.ts +++ b/src/serialization/resources/v2/types/V2ChatStreamResponse.ts @@ -2,25 +2,25 @@ * This file was auto-generated by Fern from our API Definition. */ -import * as serializers from "../index"; -import * as Cohere from "../../api/index"; -import * as core from "../../core"; -import { ChatMessageStartEvent } from "./ChatMessageStartEvent"; -import { ChatContentStartEvent } from "./ChatContentStartEvent"; -import { ChatContentDeltaEvent } from "./ChatContentDeltaEvent"; -import { ChatContentEndEvent } from "./ChatContentEndEvent"; -import { ChatToolPlanDeltaEvent } from "./ChatToolPlanDeltaEvent"; -import { ChatToolCallStartEvent } from "./ChatToolCallStartEvent"; -import { ChatToolCallDeltaEvent } from "./ChatToolCallDeltaEvent"; -import { ChatToolCallEndEvent } from "./ChatToolCallEndEvent"; -import { CitationStartEvent } from "./CitationStartEvent"; -import { CitationEndEvent } from "./CitationEndEvent"; -import { ChatMessageEndEvent } from "./ChatMessageEndEvent"; -import { ChatDebugEvent } from "./ChatDebugEvent"; +import * as serializers from "../../../index"; +import * as Cohere from "../../../../api/index"; +import * as core from "../../../../core"; +import { ChatMessageStartEvent } from "../../../types/ChatMessageStartEvent"; +import { ChatContentStartEvent } from "../../../types/ChatContentStartEvent"; +import { ChatContentDeltaEvent } from "../../../types/ChatContentDeltaEvent"; +import { ChatContentEndEvent } from "../../../types/ChatContentEndEvent"; +import { ChatToolPlanDeltaEvent } from "../../../types/ChatToolPlanDeltaEvent"; +import { ChatToolCallStartEvent } from "../../../types/ChatToolCallStartEvent"; +import { ChatToolCallDeltaEvent } from "../../../types/ChatToolCallDeltaEvent"; +import { ChatToolCallEndEvent } from "../../../types/ChatToolCallEndEvent"; +import { CitationStartEvent } from "../../../types/CitationStartEvent"; +import { CitationEndEvent } from "../../../types/CitationEndEvent"; +import { ChatMessageEndEvent } from "../../../types/ChatMessageEndEvent"; +import { ChatDebugEvent } from "../../../types/ChatDebugEvent"; -export const StreamedChatResponseV2: core.serialization.Schema< - serializers.StreamedChatResponseV2.Raw, - Cohere.StreamedChatResponseV2 +export const V2ChatStreamResponse: core.serialization.Schema< + serializers.V2ChatStreamResponse.Raw, + Cohere.V2ChatStreamResponse > = core.serialization .union("type", { "message-start": ChatMessageStartEvent, @@ -36,25 +36,25 @@ export const StreamedChatResponseV2: core.serialization.Schema< "message-end": ChatMessageEndEvent, debug: ChatDebugEvent, }) - .transform({ + .transform({ transform: (value) => value, untransform: (value) => value, }); -export declare namespace StreamedChatResponseV2 { +export declare namespace V2ChatStreamResponse { type Raw = - | StreamedChatResponseV2.MessageStart - | StreamedChatResponseV2.ContentStart - | StreamedChatResponseV2.ContentDelta - | StreamedChatResponseV2.ContentEnd - | StreamedChatResponseV2.ToolPlanDelta - | StreamedChatResponseV2.ToolCallStart - | StreamedChatResponseV2.ToolCallDelta - | StreamedChatResponseV2.ToolCallEnd - | StreamedChatResponseV2.CitationStart - | StreamedChatResponseV2.CitationEnd - | StreamedChatResponseV2.MessageEnd - | StreamedChatResponseV2.Debug; + | V2ChatStreamResponse.MessageStart + | V2ChatStreamResponse.ContentStart + | V2ChatStreamResponse.ContentDelta + | V2ChatStreamResponse.ContentEnd + | V2ChatStreamResponse.ToolPlanDelta + | V2ChatStreamResponse.ToolCallStart + | V2ChatStreamResponse.ToolCallDelta + | V2ChatStreamResponse.ToolCallEnd + | V2ChatStreamResponse.CitationStart + | V2ChatStreamResponse.CitationEnd + | V2ChatStreamResponse.MessageEnd + | V2ChatStreamResponse.Debug; interface MessageStart extends ChatMessageStartEvent.Raw { type: "message-start"; diff --git a/src/serialization/resources/v2/types/V2RerankResponseResultsItem.ts b/src/serialization/resources/v2/types/V2RerankResponseResultsItem.ts index 4eaad344..2c7eb02b 100644 --- a/src/serialization/resources/v2/types/V2RerankResponseResultsItem.ts +++ b/src/serialization/resources/v2/types/V2RerankResponseResultsItem.ts @@ -5,20 +5,17 @@ import * as serializers from "../../../index"; import * as Cohere from "../../../../api/index"; import * as core from "../../../../core"; -import { V2RerankResponseResultsItemDocument } from "./V2RerankResponseResultsItemDocument"; export const V2RerankResponseResultsItem: core.serialization.ObjectSchema< serializers.V2RerankResponseResultsItem.Raw, Cohere.V2RerankResponseResultsItem > = core.serialization.object({ - document: V2RerankResponseResultsItemDocument.optional(), index: core.serialization.number(), relevanceScore: core.serialization.property("relevance_score", core.serialization.number()), }); export declare namespace V2RerankResponseResultsItem { interface Raw { - document?: V2RerankResponseResultsItemDocument.Raw | null; index: number; relevance_score: number; } diff --git a/src/serialization/resources/v2/types/V2RerankResponseResultsItemDocument.ts b/src/serialization/resources/v2/types/V2RerankResponseResultsItemDocument.ts deleted file mode 100644 index 360f3b58..00000000 --- a/src/serialization/resources/v2/types/V2RerankResponseResultsItemDocument.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../index"; -import * as Cohere from "../../../../api/index"; -import * as core from "../../../../core"; - -export const V2RerankResponseResultsItemDocument: core.serialization.ObjectSchema< - serializers.V2RerankResponseResultsItemDocument.Raw, - Cohere.V2RerankResponseResultsItemDocument -> = core.serialization.object({ - text: core.serialization.string(), -}); - -export declare namespace V2RerankResponseResultsItemDocument { - interface Raw { - text: string; - } -} diff --git a/src/serialization/resources/v2/types/index.ts b/src/serialization/resources/v2/types/index.ts index 56d3128e..35057865 100644 --- a/src/serialization/resources/v2/types/index.ts +++ b/src/serialization/resources/v2/types/index.ts @@ -1,10 +1,11 @@ export * from "./V2ChatStreamRequestDocumentsItem"; export * from "./V2ChatStreamRequestSafetyMode"; export * from "./V2ChatStreamRequestToolChoice"; +export * from "./V2ChatStreamResponse"; export * from "./V2ChatRequestDocumentsItem"; export * from "./V2ChatRequestSafetyMode"; export * from "./V2ChatRequestToolChoice"; +export * from "./V2ChatResponse"; export * from "./V2EmbedRequestTruncate"; -export * from "./V2RerankResponseResultsItemDocument"; export * from "./V2RerankResponseResultsItem"; export * from "./V2RerankResponse"; diff --git a/src/serialization/types/ChatRequestConnectorsSearchOptions.ts b/src/serialization/types/ChatRequestConnectorsSearchOptions.ts deleted file mode 100644 index db5f7247..00000000 --- a/src/serialization/types/ChatRequestConnectorsSearchOptions.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Cohere from "../../api/index"; -import * as core from "../../core"; - -export const ChatRequestConnectorsSearchOptions: core.serialization.ObjectSchema< - serializers.ChatRequestConnectorsSearchOptions.Raw, - Cohere.ChatRequestConnectorsSearchOptions -> = core.serialization.object({ - seed: core.serialization.number().optional(), -}); - -export declare namespace ChatRequestConnectorsSearchOptions { - interface Raw { - seed?: number | null; - } -} diff --git a/src/serialization/types/ChatStreamRequestConnectorsSearchOptions.ts b/src/serialization/types/ChatStreamRequestConnectorsSearchOptions.ts deleted file mode 100644 index 5cc02bcf..00000000 --- a/src/serialization/types/ChatStreamRequestConnectorsSearchOptions.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Cohere from "../../api/index"; -import * as core from "../../core"; - -export const ChatStreamRequestConnectorsSearchOptions: core.serialization.ObjectSchema< - serializers.ChatStreamRequestConnectorsSearchOptions.Raw, - Cohere.ChatStreamRequestConnectorsSearchOptions -> = core.serialization.object({ - seed: core.serialization.number().optional(), -}); - -export declare namespace ChatStreamRequestConnectorsSearchOptions { - interface Raw { - seed?: number | null; - } -} diff --git a/src/serialization/types/ClientClosedRequestErrorBody.ts b/src/serialization/types/ClientClosedRequestErrorBody.ts new file mode 100644 index 00000000..84fb4f3b --- /dev/null +++ b/src/serialization/types/ClientClosedRequestErrorBody.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Cohere from "../../api/index"; +import * as core from "../../core"; + +export const ClientClosedRequestErrorBody: core.serialization.ObjectSchema< + serializers.ClientClosedRequestErrorBody.Raw, + Cohere.ClientClosedRequestErrorBody +> = core.serialization.object({ + data: core.serialization.string().optional(), +}); + +export declare namespace ClientClosedRequestErrorBody { + interface Raw { + data?: string | null; + } +} diff --git a/src/serialization/types/GatewayTimeoutErrorBody.ts b/src/serialization/types/GatewayTimeoutErrorBody.ts new file mode 100644 index 00000000..b539b08c --- /dev/null +++ b/src/serialization/types/GatewayTimeoutErrorBody.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Cohere from "../../api/index"; +import * as core from "../../core"; + +export const GatewayTimeoutErrorBody: core.serialization.ObjectSchema< + serializers.GatewayTimeoutErrorBody.Raw, + Cohere.GatewayTimeoutErrorBody +> = core.serialization.object({ + data: core.serialization.string().optional(), +}); + +export declare namespace GatewayTimeoutErrorBody { + interface Raw { + data?: string | null; + } +} diff --git a/src/serialization/types/Metrics.ts b/src/serialization/types/Metrics.ts index a8842311..646a4af7 100644 --- a/src/serialization/types/Metrics.ts +++ b/src/serialization/types/Metrics.ts @@ -6,7 +6,6 @@ import * as serializers from "../index"; import * as Cohere from "../../api/index"; import * as core from "../../core"; import { FinetuneDatasetMetrics } from "./FinetuneDatasetMetrics"; -import { MetricsEmbedData } from "./MetricsEmbedData"; export const Metrics: core.serialization.ObjectSchema = core.serialization.object({ @@ -14,12 +13,10 @@ export const Metrics: core.serialization.ObjectSchema = core.serialization.object({ - fields: core.serialization.list(MetricsEmbedDataFieldsItem).optional(), -}); - -export declare namespace MetricsEmbedData { - interface Raw { - fields?: MetricsEmbedDataFieldsItem.Raw[] | null; - } -} diff --git a/src/serialization/types/MetricsEmbedDataFieldsItem.ts b/src/serialization/types/MetricsEmbedDataFieldsItem.ts deleted file mode 100644 index 05432092..00000000 --- a/src/serialization/types/MetricsEmbedDataFieldsItem.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Cohere from "../../api/index"; -import * as core from "../../core"; - -export const MetricsEmbedDataFieldsItem: core.serialization.ObjectSchema< - serializers.MetricsEmbedDataFieldsItem.Raw, - Cohere.MetricsEmbedDataFieldsItem -> = core.serialization.object({ - name: core.serialization.string().optional(), - count: core.serialization.number().optional(), -}); - -export declare namespace MetricsEmbedDataFieldsItem { - interface Raw { - name?: string | null; - count?: number | null; - } -} diff --git a/src/serialization/types/NonStreamedChatResponse.ts b/src/serialization/types/NonStreamedChatResponse.ts index ffe4486d..6dc23dab 100644 --- a/src/serialization/types/NonStreamedChatResponse.ts +++ b/src/serialization/types/NonStreamedChatResponse.ts @@ -29,7 +29,6 @@ export const NonStreamedChatResponse: core.serialization.ObjectSchema< finishReason: core.serialization.property("finish_reason", FinishReason.optional()), toolCalls: core.serialization.property("tool_calls", core.serialization.list(ToolCall).optional()), chatHistory: core.serialization.property("chat_history", core.serialization.list(Message).optional()), - prompt: core.serialization.string().optional(), meta: ApiMeta.optional(), }); @@ -46,7 +45,6 @@ export declare namespace NonStreamedChatResponse { finish_reason?: FinishReason.Raw | null; tool_calls?: ToolCall.Raw[] | null; chat_history?: Message.Raw[] | null; - prompt?: string | null; meta?: ApiMeta.Raw | null; } } diff --git a/src/serialization/types/NotImplementedErrorBody.ts b/src/serialization/types/NotImplementedErrorBody.ts new file mode 100644 index 00000000..66df27aa --- /dev/null +++ b/src/serialization/types/NotImplementedErrorBody.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Cohere from "../../api/index"; +import * as core from "../../core"; + +export const NotImplementedErrorBody: core.serialization.ObjectSchema< + serializers.NotImplementedErrorBody.Raw, + Cohere.NotImplementedErrorBody +> = core.serialization.object({ + data: core.serialization.string().optional(), +}); + +export declare namespace NotImplementedErrorBody { + interface Raw { + data?: string | null; + } +} diff --git a/src/serialization/types/TooManyRequestsErrorBody.ts b/src/serialization/types/TooManyRequestsErrorBody.ts new file mode 100644 index 00000000..d36cdd4e --- /dev/null +++ b/src/serialization/types/TooManyRequestsErrorBody.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Cohere from "../../api/index"; +import * as core from "../../core"; + +export const TooManyRequestsErrorBody: core.serialization.ObjectSchema< + serializers.TooManyRequestsErrorBody.Raw, + Cohere.TooManyRequestsErrorBody +> = core.serialization.object({ + data: core.serialization.string().optional(), +}); + +export declare namespace TooManyRequestsErrorBody { + interface Raw { + data?: string | null; + } +} diff --git a/src/serialization/types/UnprocessableEntityErrorBody.ts b/src/serialization/types/UnprocessableEntityErrorBody.ts new file mode 100644 index 00000000..bb7dc161 --- /dev/null +++ b/src/serialization/types/UnprocessableEntityErrorBody.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Cohere from "../../api/index"; +import * as core from "../../core"; + +export const UnprocessableEntityErrorBody: core.serialization.ObjectSchema< + serializers.UnprocessableEntityErrorBody.Raw, + Cohere.UnprocessableEntityErrorBody +> = core.serialization.object({ + data: core.serialization.string().optional(), +}); + +export declare namespace UnprocessableEntityErrorBody { + interface Raw { + data?: string | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 3e242408..ceb71d85 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,15 +1,22 @@ export * from "./ChatStreamRequestPromptTruncation"; export * from "./ChatStreamRequestCitationQuality"; -export * from "./ChatStreamRequestConnectorsSearchOptions"; export * from "./ChatStreamRequestSafetyMode"; +export * from "./StreamedChatResponse"; +export * from "./UnprocessableEntityErrorBody"; +export * from "./TooManyRequestsErrorBody"; +export * from "./ClientClosedRequestErrorBody"; +export * from "./NotImplementedErrorBody"; +export * from "./GatewayTimeoutErrorBody"; export * from "./ChatRequestPromptTruncation"; export * from "./ChatRequestCitationQuality"; -export * from "./ChatRequestConnectorsSearchOptions"; export * from "./ChatRequestSafetyMode"; +export * from "./NonStreamedChatResponse"; export * from "./GenerateStreamRequestTruncate"; export * from "./GenerateStreamRequestReturnLikelihoods"; +export * from "./GenerateStreamedResponse"; export * from "./GenerateRequestTruncate"; export * from "./GenerateRequestReturnLikelihoods"; +export * from "./Generation"; export * from "./EmbedRequestTruncate"; export * from "./EmbedResponse"; export * from "./RerankRequestDocumentsItem"; @@ -49,7 +56,6 @@ export * from "./ApiMetaApiVersion"; export * from "./ApiMetaBilledUnits"; export * from "./ApiMetaTokens"; export * from "./ApiMeta"; -export * from "./NonStreamedChatResponse"; export * from "./ChatStreamEvent"; export * from "./ChatStreamStartEvent"; export * from "./ChatSearchQueriesGenerationEvent"; @@ -62,7 +68,6 @@ export * from "./ChatStreamEndEvent"; export * from "./ToolCallDelta"; export * from "./ChatToolCallsChunkEvent"; export * from "./ChatDebugEvent"; -export * from "./StreamedChatResponse"; export * from "./TextContent"; export * from "./Content"; export * from "./UserMessageContent"; @@ -100,7 +105,6 @@ export * from "./UsageBilledUnits"; export * from "./UsageTokens"; export * from "./Usage"; export * from "./LogprobItem"; -export * from "./ChatResponse"; export * from "./ChatStreamEventType"; export * from "./ChatMessageStartEventDeltaMessage"; export * from "./ChatMessageStartEventDelta"; @@ -132,17 +136,14 @@ export * from "./CitationStartEvent"; export * from "./CitationEndEvent"; export * from "./ChatMessageEndEventDelta"; export * from "./ChatMessageEndEvent"; -export * from "./StreamedChatResponseV2"; export * from "./SingleGenerationTokenLikelihoodsItem"; export * from "./SingleGeneration"; -export * from "./Generation"; export * from "./GenerateStreamEvent"; export * from "./GenerateStreamText"; export * from "./SingleGenerationInStream"; export * from "./GenerateStreamEndResponse"; export * from "./GenerateStreamEnd"; export * from "./GenerateStreamError"; -export * from "./GenerateStreamedResponse"; export * from "./EmbedInputType"; export * from "./EmbeddingType"; export * from "./Image"; @@ -165,8 +166,6 @@ export * from "./ChatDataMetrics"; export * from "./LabelMetric"; export * from "./ClassifyDataMetrics"; export * from "./FinetuneDatasetMetrics"; -export * from "./MetricsEmbedDataFieldsItem"; -export * from "./MetricsEmbedData"; export * from "./Metrics"; export * from "./Dataset"; export * from "./ConnectorOAuth"; diff --git a/src/version.ts b/src/version.ts index e850836c..2707c0ff 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "7.15.4"; +export const SDK_VERSION = "8.0.0"; diff --git a/yarn.lock b/yarn.lock index d53cc1ff..9f37f544 100644 --- a/yarn.lock +++ b/yarn.lock @@ -66,10 +66,10 @@ "@smithy/util-utf8" "^2.0.0" tslib "^2.6.2" -"@aws-sdk/client-cognito-identity@3.726.1": - version "3.726.1" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.726.1.tgz#b6c7359b904f0cf59e62e2df7155211ccc883b62" - integrity sha512-ry0LrRm1/uo2EcPvjN38gQe2YhbnOXDhOw01j4e+aSbsBm2VumvY7d5DOLODC4i+95bxZq0pGvojqgHWM9oS0Q== +"@aws-sdk/client-cognito-identity@3.729.0": + version "3.729.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.729.0.tgz#77f995765a9fd21baf2805832c281c3e1ae5c393" + integrity sha512-+CjWJg3oQXl0utGfHV9yu8AE65ttTYPdZFSJaWqF2/4H/vEOYd59BpRt+nDjDlVhJWbcqHoXh/xkzPFDIQigXQ== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" @@ -315,12 +315,12 @@ fast-xml-parser "4.4.1" tslib "^2.6.2" -"@aws-sdk/credential-provider-cognito-identity@3.726.1": - version "3.726.1" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.726.1.tgz#3ef12bbbe5040561dd06cdcc5a603e6f9192c59a" - integrity sha512-/ZvcmEscWYHT0935QN1B1crz4RJzy0tXf20ViH9ShsC5e08jBn3qrjYhO4gUGjNDCwrWe3US8Mg6l1vrRrN1Og== +"@aws-sdk/credential-provider-cognito-identity@3.729.0": + version "3.729.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.729.0.tgz#ab0004cbb4903dac39bbd006894a7ca11e20d616" + integrity sha512-MUvJa8ehQGJlkDL0M5Dqkiwzw27p0vfIVteevqWd5FqmgEmD4f04sEHbPPqcgI6KZSNc7G6dDKwD32gPf0GYrw== dependencies: - "@aws-sdk/client-cognito-identity" "3.726.1" + "@aws-sdk/client-cognito-identity" "3.729.0" "@aws-sdk/types" "3.723.0" "@smithy/property-provider" "^4.0.0" "@smithy/types" "^4.0.0" @@ -427,15 +427,15 @@ tslib "^2.6.2" "@aws-sdk/credential-providers@^3.583.0": - version "3.726.1" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-providers/-/credential-providers-3.726.1.tgz#6a357c3f20ea8a641f63b68bf89025171fb06bc0" - integrity sha512-hfRjdKYe65ioT1L9NZsDiRRoE4hPWacamUwsN/DjyMzctuCaL4vHkc5VXMfZj/s+17eUa+lyQFrLwel/zYpmgg== + version "3.729.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-providers/-/credential-providers-3.729.0.tgz#d6fcdfc93efc6a9cec9aa8f696bd441e46552626" + integrity sha512-owibWu4jQron47zuwa+AyIskYx9ydmjPt6myKmA2SM43VYXOYeHEvyzjpGzwYdSqi9RKSFRfYF0l09Mepbo2sA== dependencies: - "@aws-sdk/client-cognito-identity" "3.726.1" + "@aws-sdk/client-cognito-identity" "3.729.0" "@aws-sdk/client-sso" "3.726.0" "@aws-sdk/client-sts" "3.726.1" "@aws-sdk/core" "3.723.0" - "@aws-sdk/credential-provider-cognito-identity" "3.726.1" + "@aws-sdk/credential-provider-cognito-identity" "3.729.0" "@aws-sdk/credential-provider-env" "3.723.0" "@aws-sdk/credential-provider-http" "3.723.0" "@aws-sdk/credential-provider-ini" "3.726.0" @@ -1132,17 +1132,17 @@ "@smithy/util-middleware" "^4.0.1" tslib "^2.6.2" -"@smithy/core@^3.0.0", "@smithy/core@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@smithy/core/-/core-3.1.0.tgz#7af3f2f06ffd84e98e402da21dd9a40c2abb58ff" - integrity sha512-swFv0wQiK7TGHeuAp6lfF5Kw1dHWsTrCuc+yh4Kh05gEShjsE2RUxHucEerR9ih9JITNtaHcSpUThn5Y/vDw0A== +"@smithy/core@^3.0.0", "@smithy/core@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@smithy/core/-/core-3.1.1.tgz#e82e526ba2dbec8e740a86c5c14b97a46e5a5128" + integrity sha512-hhUZlBWYuh9t6ycAcN90XOyG76C1AzwxZZgaCVPMYpWqqk9uMFo7HGG5Zu2cEhCJn7DdOi5krBmlibWWWPgdsw== dependencies: "@smithy/middleware-serde" "^4.0.1" "@smithy/protocol-http" "^5.0.1" "@smithy/types" "^4.1.0" "@smithy/util-body-length-browser" "^4.0.0" "@smithy/util-middleware" "^4.0.1" - "@smithy/util-stream" "^4.0.1" + "@smithy/util-stream" "^4.0.2" "@smithy/util-utf8" "^4.0.0" tslib "^2.6.2" @@ -1226,12 +1226,12 @@ "@smithy/types" "^4.1.0" tslib "^2.6.2" -"@smithy/middleware-endpoint@^4.0.0", "@smithy/middleware-endpoint@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@smithy/middleware-endpoint/-/middleware-endpoint-4.0.1.tgz#a80ee5b7d2ba3f735e7cc77864f8211db1c63ccb" - integrity sha512-hCCOPu9+sRI7Wj0rZKKnGylKXBEd9cQJetzjQqe8cT4PWvtQAbvNVa6cgAONiZg9m8LaXtP9/waxm3C3eO4hiw== +"@smithy/middleware-endpoint@^4.0.0", "@smithy/middleware-endpoint@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@smithy/middleware-endpoint/-/middleware-endpoint-4.0.2.tgz#f433dcd214e89f17bdf21b3af5fbdd3810bebf6d" + integrity sha512-Z9m67CXizGpj8CF/AW/7uHqYNh1VXXOn9Ap54fenWsCa0HnT4cJuE61zqG3cBkTZJDCy0wHJphilI41co/PE5g== dependencies: - "@smithy/core" "^3.1.0" + "@smithy/core" "^3.1.1" "@smithy/middleware-serde" "^4.0.1" "@smithy/node-config-provider" "^4.0.1" "@smithy/shared-ini-file-loader" "^4.0.1" @@ -1241,14 +1241,14 @@ tslib "^2.6.2" "@smithy/middleware-retry@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@smithy/middleware-retry/-/middleware-retry-4.0.1.tgz#1f7fb3086f80d49a5990ffeafade0a264d230146" - integrity sha512-n3g2zZFgOWaz2ZYCy8+4wxSmq+HSTD8QKkRhFDv+nkxY1o7gzyp4PDz/+tOdcNPMPZ/A6Mt4aVECYNjQNiaHJw== + version "4.0.3" + resolved "https://registry.yarnpkg.com/@smithy/middleware-retry/-/middleware-retry-4.0.3.tgz#4073369e54c1beb7a764633ca218a6e39b9da688" + integrity sha512-TiKwwQTwUDeDtwWW8UWURTqu7s6F3wN2pmziLU215u7bqpVT9Mk2oEvURjpRLA+5XeQhM68R5BpAGzVtomsqgA== dependencies: "@smithy/node-config-provider" "^4.0.1" "@smithy/protocol-http" "^5.0.1" "@smithy/service-error-classification" "^4.0.1" - "@smithy/smithy-client" "^4.1.0" + "@smithy/smithy-client" "^4.1.2" "@smithy/types" "^4.1.0" "@smithy/util-middleware" "^4.0.1" "@smithy/util-retry" "^4.0.1" @@ -1281,10 +1281,10 @@ "@smithy/types" "^4.1.0" tslib "^2.6.2" -"@smithy/node-http-handler@^4.0.0", "@smithy/node-http-handler@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@smithy/node-http-handler/-/node-http-handler-4.0.1.tgz#3673102f9d719ccbbe18183f59cee368b3881b2c" - integrity sha512-ddQc7tvXiVLC5c3QKraGWde761KSk+mboCheZoWtuqnXh5l0WKyFy3NfDIM/dsKrI9HlLVH/21pi9wWK2gUFFA== +"@smithy/node-http-handler@^4.0.0", "@smithy/node-http-handler@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@smithy/node-http-handler/-/node-http-handler-4.0.2.tgz#48d47a046cf900ab86bfbe7f5fd078b52c82fab6" + integrity sha512-X66H9aah9hisLLSnGuzRYba6vckuFtGE+a5DcHLliI/YlqKrGoxhisD5XbX44KyoeRzoNlGr94eTsMVHFAzPOw== dependencies: "@smithy/abort-controller" "^4.0.1" "@smithy/protocol-http" "^5.0.1" @@ -1376,17 +1376,17 @@ "@smithy/util-utf8" "^4.0.0" tslib "^2.6.2" -"@smithy/smithy-client@^4.0.0", "@smithy/smithy-client@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@smithy/smithy-client/-/smithy-client-4.1.0.tgz#066ddfb5214a75e619e43c657dcfe531fd757d43" - integrity sha512-NiboZnrsrZY+Cy5hQNbYi+nVNssXVi2I+yL4CIKNIanOhH8kpC5PKQ2jx/MQpwVr21a3XcVoQBArlpRF36OeEQ== +"@smithy/smithy-client@^4.0.0", "@smithy/smithy-client@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@smithy/smithy-client/-/smithy-client-4.1.2.tgz#1bf707d48998a559d3e91e30c20eec243e16d45b" + integrity sha512-0yApeHWBqocelHGK22UivZyShNxFbDNrgREBllGh5Ws0D0rg/yId/CJfeoKKpjbfY2ju8j6WgDUGZHYQmINZ5w== dependencies: - "@smithy/core" "^3.1.0" - "@smithy/middleware-endpoint" "^4.0.1" + "@smithy/core" "^3.1.1" + "@smithy/middleware-endpoint" "^4.0.2" "@smithy/middleware-stack" "^4.0.1" "@smithy/protocol-http" "^5.0.1" "@smithy/types" "^4.1.0" - "@smithy/util-stream" "^4.0.1" + "@smithy/util-stream" "^4.0.2" tslib "^2.6.2" "@smithy/types@^1.2.0": @@ -1467,26 +1467,26 @@ tslib "^2.6.2" "@smithy/util-defaults-mode-browser@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.1.tgz#ace4442dbc73a144e686097a2855c3dfa9d8fb2f" - integrity sha512-nkQifWzWUHw/D0aLPgyKut+QnJ5X+5E8wBvGfvrYLLZ86xPfVO6MoqfQo/9s4bF3Xscefua1M6KLZtobHMWrBg== + version "4.0.3" + resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.0.3.tgz#52a5a22e6a4eecbc0e2ebdeee0979081ec99667a" + integrity sha512-7c5SF1fVK0EOs+2EOf72/qF199zwJflU1d02AevwKbAUPUZyE9RUZiyJxeUmhVxfKDWdUKaaVojNiaDQgnHL9g== dependencies: "@smithy/property-provider" "^4.0.1" - "@smithy/smithy-client" "^4.1.0" + "@smithy/smithy-client" "^4.1.2" "@smithy/types" "^4.1.0" bowser "^2.11.0" tslib "^2.6.2" "@smithy/util-defaults-mode-node@^4.0.0": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.1.tgz#c18f0014852b947aa54013e437da13a10a04c8e6" - integrity sha512-LeAx2faB83litC9vaOdwFaldtto2gczUHxfFf8yoRwDU3cwL4/pDm7i0hxsuBCRk5mzHsrVGw+3EVCj32UZMdw== + version "4.0.3" + resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.0.3.tgz#2dc140363dc35366c21c93939f61e4514f9a2fa6" + integrity sha512-CVnD42qYD3JKgDlImZ9+On+MqJHzq9uJgPbMdeBE8c2x8VJ2kf2R3XO/yVFx+30ts5lD/GlL0eFIShY3x9ROgQ== dependencies: "@smithy/config-resolver" "^4.0.1" "@smithy/credential-provider-imds" "^4.0.1" "@smithy/node-config-provider" "^4.0.1" "@smithy/property-provider" "^4.0.1" - "@smithy/smithy-client" "^4.1.0" + "@smithy/smithy-client" "^4.1.2" "@smithy/types" "^4.1.0" tslib "^2.6.2" @@ -1537,13 +1537,13 @@ "@smithy/types" "^4.1.0" tslib "^2.6.2" -"@smithy/util-stream@^4.0.0", "@smithy/util-stream@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@smithy/util-stream/-/util-stream-4.0.1.tgz#cbbaf4a73ca5a6292074cd83682c0c401321e863" - integrity sha512-Js16gOgU6Qht6qTPfuJgb+1YD4AEO+5Y1UPGWKSp3BNo8ONl/qhXSYDhFKJtwybRJynlCqvP5IeiaBsUmkSPTQ== +"@smithy/util-stream@^4.0.0", "@smithy/util-stream@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@smithy/util-stream/-/util-stream-4.0.2.tgz#63495d3f7fba9d78748d540921136dc4a8d4c067" + integrity sha512-0eZ4G5fRzIoewtHtwaYyl8g2C+osYOT4KClXgfdNEDAgkbe2TYPqcnw4GAWabqkZCax2ihRGPe9LZnsPdIUIHA== dependencies: "@smithy/fetch-http-handler" "^5.0.1" - "@smithy/node-http-handler" "^4.0.1" + "@smithy/node-http-handler" "^4.0.2" "@smithy/types" "^4.1.0" "@smithy/util-base64" "^4.0.0" "@smithy/util-buffer-from" "^4.0.0" @@ -1721,9 +1721,9 @@ form-data "^4.0.0" "@types/node@*": - version "22.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.5.tgz#95af89a3fb74a2bb41ef9927f206e6472026e48b" - integrity sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ== + version "22.10.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.7.tgz#14a1ca33fd0ebdd9d63593ed8d3fbc882a6d28d7" + integrity sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg== dependencies: undici-types "~6.20.0" @@ -2406,9 +2406,9 @@ ejs@^3.1.10: jake "^10.8.5" electron-to-chromium@^1.5.73: - version "1.5.80" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.80.tgz#ca7a8361d7305f0ec9e203ce4e633cbb8a8ef1b1" - integrity sha512-LTrKpW0AqIuHwmlVNV+cjFYTnXtM9K37OGhpe0ZI10ScPSxqVSryZHIY3WnCS5NSYbBODRTZyhRMS2h5FAEqAw== + version "1.5.83" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.83.tgz#3f74078f0c83e24bf7e692eaa855a998d1bec34f" + integrity sha512-LcUDPqSt+V0QmI47XLzZrz5OqILSMGsPFkDYus22rIbgorSvBYEFqq854ltTmUdHkY92FSdAAvsh4jWEULMdfQ== emittery@^0.13.1: version "0.13.1" @@ -2456,9 +2456,9 @@ es-module-lexer@^1.2.1: integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== es-object-atoms@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.0.0.tgz#ddb55cd47ac2e240701260bc2a8e31ecb643d941" - integrity sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw== + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== dependencies: es-errors "^1.3.0"