From 77dd1697895ebb5c7ee5bed8a2f461f47a03f54c Mon Sep 17 00:00:00 2001 From: Rohin Bhargava Date: Wed, 27 Nov 2024 15:52:37 -0700 Subject: [PATCH] cohere generating, errors also generating properly with default --- .../__snapshots__/openapi/cohere.json | 12902 +++++++++++++--- .../__snapshots__/openapi/petstore.json | 27 +- .../src/openapi/3.1/guards/isObjectSchema.ts | 2 +- .../response/ResponsesObjectConverter.node.ts | 11 +- .../3.1/schemas/ObjectConverter.node.ts | 2 +- .../3.1/schemas/OneOfConverter.node.ts | 15 +- .../3.1/schemas/SchemaConverter.node.ts | 10 +- 7 files changed, 11061 insertions(+), 1908 deletions(-) diff --git a/packages/parsers/src/__test__/__snapshots__/openapi/cohere.json b/packages/parsers/src/__test__/__snapshots__/openapi/cohere.json index 65b628d9bb..d99340bc5d 100644 --- a/packages/parsers/src/__test__/__snapshots__/openapi/cohere.json +++ b/packages/parsers/src/__test__/__snapshots__/openapi/cohere.json @@ -409,11 +409,294 @@ "id": "ResponseFormat" } } + }, + { + "key": "safety_mode", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "CONTEXTUAL" + }, + { + "value": "STRICT" + }, + { + "value": "NONE" + } + ] + }, + "description": "Used to select the [safety instruction](https://docs.cohere.com/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.\nWhen `NONE` is specified, the safety instruction will be omitted.\n\nSafety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.\n\n**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/docs/command-r-plus#august-2024-release) and newer.\n\nCompatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments\n" } ] } }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { @@ -511,6 +794,20 @@ }, "description": "When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Strict Tools guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).\n\n**Note**: The first few requests with a new set of tools will take longer to process.\n" }, + { + "key": "documents", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "undiscriminatedUnion", + "variants": [] + } + } + }, + "description": "A list of relevant documents that the model can cite to generate a more accurate reply. Each document is either a string or document object with content and metadata.\n" + }, { "key": "citation_options", "valueShape": { @@ -531,6 +828,24 @@ } } }, + { + "key": "safety_mode", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "CONTEXTUAL" + }, + { + "value": "STRICT" + }, + { + "value": "OFF" + } + ] + }, + "description": "Used to select the [safety instruction](https://docs.cohere.com/v2/docs/safety-modes) inserted into the prompt. Defaults to `CONTEXTUAL`.\nWhen `OFF` is specified, the safety instruction will be omitted.\n\nSafety modes are not yet configurable in combination with `tools`, `tool_results` and `documents` parameters.\n\n**Note**: This parameter is only compatible with models [Command R 08-2024](https://docs.cohere.com/v2/docs/command-r#august-2024-release), [Command R+ 08-2024](https://docs.cohere.com/v2/docs/command-r-plus#august-2024-release) and newer.\n" + }, { "key": "max_tokens", "valueShape": { @@ -667,48 +982,313 @@ ] } }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "\nThis API is marked as \"Legacy\" and is no longer maintained. Follow the [migration guide](https://docs.cohere.com/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.\n\nGenerates realistic text conditioned on a given input.\n", - "id": "/v1/generate", - "method": "POST", - "path": [ - { - "type": "literal", - "value": "v1" - }, - { - "type": "literal", - "value": "generate" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "requestHeaders": [ + "errors": [ { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "The name of the project that is making the request.\n" - } - ], - "responseHeaders": [ + "name": "dummy error" + }, { - "key": "X-API-Warning", + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "\nThis API is marked as \"Legacy\" and is no longer maintained. Follow the [migration guide](https://docs.cohere.com/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.\n\nGenerates realistic text conditioned on a given input.\n", + "id": "/v1/generate", + "method": "POST", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "generate" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "responseHeaders": [ + { + "key": "X-API-Warning", "valueShape": { "type": "alias", "value": { @@ -988,162 +1568,282 @@ }, "description": "OK" }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "This endpoint returns text and image embeddings. An embedding is a list of floating point numbers that captures semantic information about the content that it represents.\n\nEmbeddings can be used to create classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.\n\nIf you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search).", - "id": "/v1/embed", - "method": "POST", - "path": [ - { - "type": "literal", - "value": "v1" - }, - { - "type": "literal", - "value": "embed" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "requestHeaders": [ + "errors": [ { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The name of the project that is making the request.\n" - } - ], - "request": { - "contentType": "application/json", - "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "texts", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "primitive", - "value": { - "type": "string" - } + "type": "string" } } } - }, - "description": "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." - }, - { - "key": "images", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "primitive", - "value": { - "type": "string" - } + "type": "string" } } } - }, - "description": "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg` or `image/png` format and has a maximum size of 5MB." - }, - { - "key": "model", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "Defaults to embed-english-v2.0\n\nThe identifier of the model. Smaller \"light\" models are faster, while larger models will perform better. [Custom models](https://docs.cohere.com/docs/training-custom-models) can also be supplied with their full ID.\n\nAvailable models and corresponding embedding dimensions:\n\n* `embed-english-v3.0` 1024\n* `embed-multilingual-v3.0` 1024\n* `embed-english-light-v3.0` 384\n* `embed-multilingual-light-v3.0` 384\n\n* `embed-english-v2.0` 4096\n* `embed-english-light-v2.0` 1024\n* `embed-multilingual-v2.0` 768" - }, - { - "key": "input_type", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "EmbedInputType" + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } } } - }, - { - "key": "embedding_types", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "id", - "id": "EmbeddingType" + "type": "string" } } } - }, - "description": "Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.\n\n* `\"float\"`: Use this when you want to get back the default float embeddings. Valid for all models.\n* `\"int8\"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.\n* `\"uint8\"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.\n* `\"binary\"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.\n* `\"ubinary\"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models." - }, - { - "key": "truncate", - "valueShape": { - "type": "enum", - "values": [ - { - "value": "NONE" - }, - { - "value": "START" - }, - { - "value": "END" + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } } - ], - "default": "END" - }, - "description": "One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.\n\nPassing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.\n\nIf `NONE` is selected, when the input exceeds the maximum input token length an error will be returned." - } - ] + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" } - }, - "errors": [], + ], "examples": [] }, "test-uuid-replacement": { - "description": "This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.\n\nEmbeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.\n\nIf you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search).", - "id": "/v2/embed", + "description": "This endpoint returns text and image embeddings. An embedding is a list of floating point numbers that captures semantic information about the content that it represents.\n\nEmbeddings can be used to create classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.\n\nIf you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search).", + "id": "/v1/embed", "method": "POST", "path": [ { "type": "literal", - "value": "v2" + "value": "v1" }, { "type": "literal", @@ -1172,21 +1872,6 @@ "description": "The name of the project that is making the request.\n" } ], - "responseHeaders": [ - { - "key": "X-API-Warning", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "Warning description for incorrect usage of the API" - } - ], "request": { "contentType": "application/json", "body": { @@ -1293,97 +1978,286 @@ ] } }, - "response": { - "statusCode": 200, - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "EmbedByTypeResponse" - } - }, - "description": "OK" - }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "The list embed job endpoint allows users to view all embed jobs history for that specific user.", - "id": "/v1/embed-jobs", - "method": "GET", - "path": [ - { - "type": "literal", - "value": "v1" - }, + "errors": [ { - "type": "literal", - "value": "embed-jobs" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "requestHeaders": [ + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "The name of the project that is making the request.\n" - } - ], - "responseHeaders": [ + "name": "dummy error" + }, { - "key": "X-API-Warning", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "Warning description for incorrect usage of the API" + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" } ], - "response": { - "statusCode": 200, - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "ListEmbedJobResponse" - } - }, - "description": "OK" - }, - "errors": [], "examples": [] }, "test-uuid-replacement": { - "description": "This API launches an async Embed job for a [Dataset](https://docs.cohere.com/docs/datasets) of type `embed-input`. The result of a completed embed job is new Dataset of type `embed-output`, which contains the original text entries and the corresponding embeddings.", - "id": "/v1/embed-jobs", + "description": "This endpoint returns text embeddings. An embedding is a list of floating point numbers that captures semantic information about the text that it represents.\n\nEmbeddings can be used to create text classifiers as well as empower semantic search. To learn more about embeddings, see the embedding page.\n\nIf you want to learn more how to use the embedding model, have a look at the [Semantic Search Guide](https://docs.cohere.com/docs/semantic-search).", + "id": "/v2/embed", "method": "POST", "path": [ { "type": "literal", - "value": "v1" + "value": "v2" }, { "type": "literal", - "value": "embed-jobs" + "value": "embed" } ], "defaultEnvironment": "x-fern-server-name", @@ -1423,212 +2297,6 @@ "description": "Warning description for incorrect usage of the API" } ], - "request": { - "contentType": "application/json", - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "CreateEmbedJobRequest" - } - } - }, - "response": { - "statusCode": 200, - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "CreateEmbedJobResponse" - } - }, - "description": "OK" - }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "This API retrieves the details about an embed job started by the same user.", - "id": "/v1/embed-jobs/{id}", - "method": "GET", - "path": [ - { - "type": "literal", - "value": "v1" - }, - { - "type": "literal", - "value": "embed-jobs" - }, - { - "type": "pathParameter", - "value": "id" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "pathParameters": [ - { - "key": "id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The ID of the embed job to retrieve." - } - ], - "requestHeaders": [ - { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The name of the project that is making the request.\n" - } - ], - "responseHeaders": [ - { - "key": "X-API-Warning", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "Warning message for potentially incorrect usage of the API" - } - ], - "response": { - "statusCode": 200, - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "EmbedJob" - } - }, - "description": "OK" - }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "This API allows users to cancel an active embed job. Once invoked, the embedding process will be terminated, and users will be charged for the embeddings processed up to the cancellation point. It's important to note that partial results will not be available to users after cancellation.", - "id": "/v1/embed-jobs/{id}/cancel", - "method": "POST", - "path": [ - { - "type": "literal", - "value": "v1" - }, - { - "type": "literal", - "value": "embed-jobs" - }, - { - "type": "pathParameter", - "value": "id" - }, - { - "type": "literal", - "value": "cancel" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "pathParameters": [ - { - "key": "id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The ID of the embed job to cancel." - } - ], - "requestHeaders": [ - { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The name of the project that is making the request.\n" - } - ], - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score.", - "id": "/v1/rerank", - "method": "POST", - "path": [ - { - "type": "literal", - "value": "v1" - }, - { - "type": "literal", - "value": "rerank" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "requestHeaders": [ - { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The name of the project that is making the request.\n" - } - ], "request": { "contentType": "application/json", "body": { @@ -1636,91 +2304,101 @@ "extends": [], "properties": [ { - "key": "model", + "key": "texts", "valueShape": { "type": "alias", "value": { - "type": "primitive", - "value": { - "type": "string" + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } } } }, - "description": "The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0`" + "description": "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." }, { - "key": "query", + "key": "images", "valueShape": { "type": "alias", "value": { - "type": "primitive", - "value": { - "type": "string" + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } } } }, - "description": "The search query" + "description": "An array of image data URIs for the model to embed. Maximum number of images per call is `1`.\n\nThe image must be a valid [data URI](https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data). The image must be in either `image/jpeg` or `image/png` format and has a maximum size of 5MB." }, { - "key": "top_n", + "key": "model", "valueShape": { "type": "alias", "value": { "type": "primitive", "value": { - "type": "integer", - "minimum": 1 + "type": "string" } } }, - "description": "The number of most relevant documents or indices to return, defaults to the length of the documents" + "description": "Defaults to embed-english-v2.0\n\nThe identifier of the model. Smaller \"light\" models are faster, while larger models will perform better. [Custom models](https://docs.cohere.com/docs/training-custom-models) can also be supplied with their full ID.\n\nAvailable models and corresponding embedding dimensions:\n\n* `embed-english-v3.0` 1024\n* `embed-multilingual-v3.0` 1024\n* `embed-english-light-v3.0` 384\n* `embed-multilingual-light-v3.0` 384\n\n* `embed-english-v2.0` 4096\n* `embed-english-light-v2.0` 1024\n* `embed-multilingual-v2.0` 768" }, { - "key": "rank_fields", + "key": "input_type", "valueShape": { "type": "alias", "value": { - "type": "list", - "itemShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - } + "type": "id", + "id": "EmbedInputType" } - }, - "description": "If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking." + } }, { - "key": "return_documents", + "key": "embedding_types", "valueShape": { "type": "alias", "value": { - "type": "primitive", - "value": { - "type": "boolean", - "default": false + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "EmbeddingType" + } } } }, - "description": "- 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.\n- 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." + "description": "Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.\n\n* `\"float\"`: Use this when you want to get back the default float embeddings. Valid for all models.\n* `\"int8\"`: Use this when you want to get back signed int8 embeddings. Valid for only v3 models.\n* `\"uint8\"`: Use this when you want to get back unsigned int8 embeddings. Valid for only v3 models.\n* `\"binary\"`: Use this when you want to get back signed binary embeddings. Valid for only v3 models.\n* `\"ubinary\"`: Use this when you want to get back unsigned binary embeddings. Valid for only v3 models." }, { - "key": "max_chunks_per_doc", + "key": "truncate", "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "integer", - "default": 10 + "type": "enum", + "values": [ + { + "value": "NONE" + }, + { + "value": "START" + }, + { + "value": "END" } - } + ], + "default": "END" }, - "description": "The maximum number of chunks to produce internally from a document" + "description": "One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.\n\nPassing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.\n\nIf `NONE` is selected, when the input exceeds the maximum input token length an error will be returned." } ] } @@ -1728,301 +2406,286 @@ "response": { "statusCode": 200, "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + "type": "alias", + "value": { + "type": "id", + "id": "EmbedByTypeResponse" + } + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } } - }, - { - "key": "results", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "document", - "valueShape": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "text", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The text of the document to rerank" - } - ] - }, - "description": "If `return_documents` is set as `false` this will return none, if `true` it will return the documents passed in" - }, - { - "key": "index", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "integer" - } - } - }, - "description": "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)" - }, - { - "key": "relevance_score", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "double" - } - } - }, - "description": "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" - } - ] + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "An ordered list of ranked documents" - }, - { - "key": "meta", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "ApiMeta" - } } - } - ] + ] + }, + "name": "dummy error" }, - "description": "OK" - }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score.", - "id": "/v2/rerank", - "method": "POST", - "path": [ { - "type": "literal", - "value": "v2" + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" }, { - "type": "literal", - "value": "rerank" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "requestHeaders": [ - { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "The name of the project that is making the request.\n" - } - ], - "request": { - "contentType": "application/json", - "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "model", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "The identifier of the model to use.\n\nSupported models:\n - `rerank-english-v3.0`\n - `rerank-multilingual-v3.0`\n - `rerank-english-v2.0`\n - `rerank-multilingual-v2.0`" - }, - { - "key": "query", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "The search query" - }, - { - "key": "documents", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "primitive", - "value": { - "type": "string" - } + "type": "string" } } } - }, - "description": "A list of texts that will be compared to the `query`.\nFor optimal performance we recommend against sending more than 1,000 documents in a single request.\n\n**Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.\n\n**Note**: structured data should be formatted as YAML strings for best performance." - }, - { - "key": "top_n", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "integer", - "minimum": 1 + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "Limits the number of returned rerank results to the specified value. If not passed, all the rerank results will be returned." - }, - { - "key": "max_tokens_per_doc", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "integer" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens." - } - ] - } - }, - "response": { - "statusCode": 200, - "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } } - }, - { - "key": "results", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "index", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "integer" - } - } - }, - "description": "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)" - }, - { - "key": "relevance_score", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "double" - } - } - }, - "description": "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" - } - ] + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "An ordered list of ranked documents" - }, - { - "key": "meta", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "ApiMeta" - } } - } - ] + ] + }, + "name": "dummy error" }, - "description": "OK" - }, - "errors": [], + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { - "description": "This endpoint makes a prediction about which label fits the specified text inputs best. To make a prediction, Classify uses the provided `examples` of text + label pairs as a reference.\nNote: [Fine-tuned models](https://docs.cohere.com/docs/classify-fine-tuning) trained on classification examples don't require the `examples` parameter to be passed in explicitly.", - "id": "/v1/classify", - "method": "POST", + "description": "The list embed job endpoint allows users to view all embed jobs history for that specific user.", + "id": "/v1/embed-jobs", + "method": "GET", "path": [ { "type": "literal", @@ -2030,7 +2693,7 @@ }, { "type": "literal", - "value": "classify" + "value": "embed-jobs" } ], "defaultEnvironment": "x-fern-server-name", @@ -2070,165 +2733,2481 @@ "description": "Warning description for incorrect usage of the API" } ], - "request": { - "contentType": "application/json", + "response": { + "statusCode": 200, "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "inputs", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", + "type": "alias", + "value": { + "type": "id", + "id": "ListEmbedJobResponse" + } + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "primitive", - "value": { - "type": "string" - } + "type": "string" } } } - }, - "description": "A list of up to 96 texts to be classified. Each one must be a non-empty string.\nThere is, however, no consistent, universal limit to the length a particular input can be. We perform classification on the first `x` tokens of each input, and `x` varies depending on which underlying model is powering classification. The maximum token length for each model is listed in the \"max tokens\" column [here](https://docs.cohere.com/docs/models).\nNote: by default the `truncate` parameter is set to `END`, so tokens exceeding the limit will be automatically dropped. This behavior can be disabled by setting `truncate` to `NONE`, which will result in validation errors for longer texts." - }, - { - "key": "examples", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "id", - "id": "ClassifyExample" + "type": "string" } } } - }, - "description": "An array of examples to provide context to the model. Each example is a text string and its associated label/class. Each unique label requires at least 2 examples associated with it; the maximum number of examples is 2500, and each example has a maximum length of 512 tokens. The values should be structured as `{text: \"...\",label: \"...\"}`.\nNote: [Fine-tuned Models](https://docs.cohere.com/docs/classify-fine-tuning) trained on classification examples don't require the `examples` parameter to be passed in explicitly." - }, - { - "key": "model", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "The identifier of the model. Currently available models are `embed-multilingual-v2.0`, `embed-english-light-v2.0`, and `embed-english-v2.0` (default). Smaller \"light\" models are faster, while larger models will perform better. [Fine-tuned models](https://docs.cohere.com/docs/fine-tuning) can also be supplied with their full ID." - }, - { - "key": "preset", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "The ID of a custom playground preset. You can create presets in the [playground](https://dashboard.cohere.com/playground/classify?model=large). If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters." - }, - { - "key": "truncate", - "valueShape": { - "type": "enum", - "values": [ - { - "value": "NONE" - }, - { - "value": "START" - }, - { - "value": "END" - } - ], - "default": "END" - }, - "description": "One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.\nPassing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.\nIf `NONE` is selected, when the input exceeds the maximum input token length an error will be returned." - } - ] + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "This API launches an async Embed job for a [Dataset](https://docs.cohere.com/docs/datasets) of type `embed-input`. The result of a completed embed job is new Dataset of type `embed-output`, which contains the original text entries and the corresponding embeddings.", + "id": "/v1/embed-jobs", + "method": "POST", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "embed-jobs" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "responseHeaders": [ + { + "key": "X-API-Warning", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Warning description for incorrect usage of the API" + } + ], + "request": { + "contentType": "application/json", + "body": { + "type": "alias", + "value": { + "type": "id", + "id": "CreateEmbedJobRequest" + } } }, "response": { "statusCode": 200, "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + "type": "alias", + "value": { + "type": "id", + "id": "CreateEmbedJobResponse" + } + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } } - }, - { - "key": "classifications", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - } - }, - { - "key": "input", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The input text that was classified" - }, - { - "key": "prediction", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The predicted label for the associated query (only filled for single-label models)", - "availability": "Deprecated" - }, - { - "key": "predictions", + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "This API retrieves the details about an embed job started by the same user.", + "id": "/v1/embed-jobs/{id}", + "method": "GET", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "embed-jobs" + }, + { + "type": "pathParameter", + "value": "id" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "pathParameters": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The ID of the embed job to retrieve." + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "responseHeaders": [ + { + "key": "X-API-Warning", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Warning message for potentially incorrect usage of the API" + } + ], + "response": { + "statusCode": 200, + "body": { + "type": "alias", + "value": { + "type": "id", + "id": "EmbedJob" + } + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "This API allows users to cancel an active embed job. Once invoked, the embedding process will be terminated, and users will be charged for the embeddings processed up to the cancellation point. It's important to note that partial results will not be available to users after cancellation.", + "id": "/v1/embed-jobs/{id}/cancel", + "method": "POST", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "embed-jobs" + }, + { + "type": "pathParameter", + "value": "id" + }, + { + "type": "literal", + "value": "cancel" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "pathParameters": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The ID of the embed job to cancel." + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score.", + "id": "/v1/rerank", + "method": "POST", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "rerank" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "request": { + "contentType": "application/json", + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "model", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0`" + }, + { + "key": "query", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The search query" + }, + { + "key": "documents", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "undiscriminatedUnion", + "variants": [] + } + } + }, + "description": "A list of document objects or strings to rerank.\nIf a document is provided the text fields is required and all other fields will be preserved in the response.\n\nThe total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.\n\nWe recommend a maximum of 1,000 documents for optimal endpoint performance." + }, + { + "key": "top_n", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "integer", + "minimum": 1 + } + } + }, + "description": "The number of most relevant documents or indices to return, defaults to the length of the documents" + }, + { + "key": "rank_fields", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + }, + "description": "If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking." + }, + { + "key": "return_documents", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "boolean", + "default": false + } + } + }, + "description": "- 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.\n- 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." + }, + { + "key": "max_chunks_per_doc", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "integer", + "default": 10 + } + } + }, + "description": "The maximum number of chunks to produce internally from a document" + } + ] + } + }, + "response": { + "statusCode": 200, + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + }, + { + "key": "results", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "document", + "valueShape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "text", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The text of the document to rerank" + } + ] + }, + "description": "If `return_documents` is set as `false` this will return none, if `true` it will return the documents passed in" + }, + { + "key": "index", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "integer" + } + } + }, + "description": "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)" + }, + { + "key": "relevance_score", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "double" + } + } + }, + "description": "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" + } + ] + } + } + }, + "description": "An ordered list of ranked documents" + }, + { + "key": "meta", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ApiMeta" + } + } + } + ] + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "This endpoint takes in a query and a list of texts and produces an ordered array with each text assigned a relevance score.", + "id": "/v2/rerank", + "method": "POST", + "path": [ + { + "type": "literal", + "value": "v2" + }, + { + "type": "literal", + "value": "rerank" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "request": { + "contentType": "application/json", + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "model", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The identifier of the model to use.\n\nSupported models:\n - `rerank-english-v3.0`\n - `rerank-multilingual-v3.0`\n - `rerank-english-v2.0`\n - `rerank-multilingual-v2.0`" + }, + { + "key": "query", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The search query" + }, + { + "key": "documents", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + }, + "description": "A list of texts that will be compared to the `query`.\nFor optimal performance we recommend against sending more than 1,000 documents in a single request.\n\n**Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.\n\n**Note**: structured data should be formatted as YAML strings for best performance." + }, + { + "key": "top_n", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "integer", + "minimum": 1 + } + } + }, + "description": "Limits the number of returned rerank results to the specified value. If not passed, all the rerank results will be returned." + }, + { + "key": "max_tokens_per_doc", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "integer" + } + } + }, + "description": "Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens." + } + ] + } + }, + "response": { + "statusCode": 200, + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + }, + { + "key": "results", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "index", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "integer" + } + } + }, + "description": "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)" + }, + { + "key": "relevance_score", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "double" + } + } + }, + "description": "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" + } + ] + } + } + }, + "description": "An ordered list of ranked documents" + }, + { + "key": "meta", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ApiMeta" + } + } + } + ] + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "This endpoint makes a prediction about which label fits the specified text inputs best. To make a prediction, Classify uses the provided `examples` of text + label pairs as a reference.\nNote: [Fine-tuned models](https://docs.cohere.com/docs/classify-fine-tuning) trained on classification examples don't require the `examples` parameter to be passed in explicitly.", + "id": "/v1/classify", + "method": "POST", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "classify" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "responseHeaders": [ + { + "key": "X-API-Warning", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Warning description for incorrect usage of the API" + } + ], + "request": { + "contentType": "application/json", + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "inputs", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + }, + "description": "A list of up to 96 texts to be classified. Each one must be a non-empty string.\nThere is, however, no consistent, universal limit to the length a particular input can be. We perform classification on the first `x` tokens of each input, and `x` varies depending on which underlying model is powering classification. The maximum token length for each model is listed in the \"max tokens\" column [here](https://docs.cohere.com/docs/models).\nNote: by default the `truncate` parameter is set to `END`, so tokens exceeding the limit will be automatically dropped. This behavior can be disabled by setting `truncate` to `NONE`, which will result in validation errors for longer texts." + }, + { + "key": "examples", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ClassifyExample" + } + } + } + }, + "description": "An array of examples to provide context to the model. Each example is a text string and its associated label/class. Each unique label requires at least 2 examples associated with it; the maximum number of examples is 2500, and each example has a maximum length of 512 tokens. The values should be structured as `{text: \"...\",label: \"...\"}`.\nNote: [Fine-tuned Models](https://docs.cohere.com/docs/classify-fine-tuning) trained on classification examples don't require the `examples` parameter to be passed in explicitly." + }, + { + "key": "model", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The identifier of the model. Currently available models are `embed-multilingual-v2.0`, `embed-english-light-v2.0`, and `embed-english-v2.0` (default). Smaller \"light\" models are faster, while larger models will perform better. [Fine-tuned models](https://docs.cohere.com/docs/fine-tuning) can also be supplied with their full ID." + }, + { + "key": "preset", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The ID of a custom playground preset. You can create presets in the [playground](https://dashboard.cohere.com/playground/classify?model=large). If you use a preset, all other parameters become optional, and any included parameters will override the preset's parameters." + }, + { + "key": "truncate", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "NONE" + }, + { + "value": "START" + }, + { + "value": "END" + } + ], + "default": "END" + }, + "description": "One of `NONE|START|END` to specify how the API will handle inputs longer than the maximum token length.\nPassing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.\nIf `NONE` is selected, when the input exceeds the maximum input token length an error will be returned." + } + ] + } + }, + "response": { + "statusCode": 200, + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + }, + { + "key": "classifications", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + }, + { + "key": "input", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The input text that was classified" + }, + { + "key": "prediction", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The predicted label for the associated query (only filled for single-label models)", + "availability": "Deprecated" + }, + { + "key": "predictions", "valueShape": { "type": "alias", "value": { @@ -2307,28 +5286,1837 @@ } } } - }, - { - "key": "meta", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "ApiMeta" + }, + { + "key": "meta", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ApiMeta" + } + } + } + ] + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "List datasets that have been created.", + "id": "/v1/datasets", + "method": "GET", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "datasets" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "queryParameters": [ + { + "key": "datasetType", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "optional filter by dataset type" + }, + { + "key": "before", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "datetime" + } + } + }, + "description": "optional filter before a date" + }, + { + "key": "after", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "datetime" + } + } + }, + "description": "optional filter after a date" + }, + { + "key": "limit", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "double" + } + } + }, + "description": "optional limit to number of results" + }, + { + "key": "offset", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "double" + } + } + }, + "description": "optional offset to start of results" + }, + { + "key": "validationStatus", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "DatasetValidationStatus" + } + }, + "description": "optional filter by validation status" + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "response": { + "statusCode": 200, + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "datasets", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "Dataset" + } + } + } + } + } + ] + }, + "description": "A successful response." + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "Create a dataset by uploading a file. See ['Dataset Creation'](https://docs.cohere.com/docs/datasets#dataset-creation) for more information.", + "id": "/v1/datasets", + "method": "POST", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "datasets" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "queryParameters": [ + { + "key": "name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the uploaded dataset." + }, + { + "key": "type", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "DatasetType" + } + }, + "description": "The dataset type, which is used to validate the data. Valid types are `embed-input`, `reranker-finetune-input`, `single-label-classification-finetune-input`, `chat-finetune-input`, and `multi-label-classification-finetune-input`." + }, + { + "key": "keep_original_file", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "boolean" + } + } + }, + "description": "Indicates if the original file should be stored." + }, + { + "key": "skip_malformed_input", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "boolean" + } + } + }, + "description": "Indicates whether rows with malformed input should be dropped (instead of failing the validation check). Dropped rows will be returned in the warnings field." + }, + { + "key": "keep_fields", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + }, + "description": "List of names of fields that will be persisted in the Dataset. By default the Dataset will retain only the required fields indicated in the [schema for the corresponding Dataset type](https://docs.cohere.com/docs/datasets#dataset-types). For example, datasets of type `embed-input` will drop all fields other than the required `text` field. If any of the fields in `keep_fields` are missing from the uploaded file, Dataset validation will fail." + }, + { + "key": "optional_fields", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + }, + "description": "List of names of fields that will be persisted in the Dataset. By default the Dataset will retain only the required fields indicated in the [schema for the corresponding Dataset type](https://docs.cohere.com/docs/datasets#dataset-types). For example, Datasets of type `embed-input` will drop all fields other than the required `text` field. If any of the fields in `optional_fields` are missing from the uploaded file, Dataset validation will pass." + }, + { + "key": "text_separator", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Raw .txt uploads will be split into entries using the text_separator value." + }, + { + "key": "csv_delimiter", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The delimiter used for .csv uploads." + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "request": { + "contentType": "multipart/form-data", + "body": { + "type": "formData", + "fields": [ + { + "type": "file", + "key": "data", + "isOptional": false, + "description": "The file to upload" + }, + { + "type": "file", + "key": "eval_data", + "isOptional": false, + "description": "An optional evaluation file to upload" + } + ] + } + }, + "response": { + "statusCode": 200, + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The dataset ID" + } + ] + }, + "description": "A successful response." + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "View the dataset storage usage for your Organization. Each Organization can have up to 10GB of storage across all their users.", + "id": "/v1/datasets/usage", + "method": "GET", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "datasets" + }, + { + "type": "literal", + "value": "usage" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "response": { + "statusCode": 200, + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "organization_usage", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "double" + } + } + }, + "description": "The total number of bytes used by the organization." + } + ] + }, + "description": "A successful response." + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "Retrieve a dataset by ID. See ['Datasets'](https://docs.cohere.com/docs/datasets) for more information.", + "id": "/v1/datasets/{id}", + "method": "GET", + "path": [ + { + "type": "literal", + "value": "v1" + }, + { + "type": "literal", + "value": "datasets" + }, + { + "type": "pathParameter", + "value": "id" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "pathParameters": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "response": { + "statusCode": 200, + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "dataset", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "Dataset" + } + } + } + ] + }, + "description": "A successful response." + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } } } - } - ] + ] + }, + "name": "dummy error" }, - "description": "OK" - }, - "errors": [], + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { - "description": "List datasets that have been created.", - "id": "/v1/datasets", - "method": "GET", + "description": "Delete a dataset by ID. Datasets are automatically deleted after 30 days, but they can also be deleted manually.", + "id": "/v1/datasets/{id}", + "method": "DELETE", "path": [ { "type": "literal", @@ -2337,6 +7125,10 @@ { "type": "literal", "value": "datasets" + }, + { + "type": "pathParameter", + "value": "id" } ], "defaultEnvironment": "x-fern-server-name", @@ -2346,9 +7138,9 @@ "baseUrl": "https://api.cohere.com" } ], - "queryParameters": [ + "pathParameters": [ { - "key": "datasetType", + "key": "id", "valueShape": { "type": "alias", "value": { @@ -2357,76 +7149,340 @@ "type": "string" } } - }, - "description": "optional filter by dataset type" - }, + } + } + ], + "requestHeaders": [ { - "key": "before", + "key": "X-Client-Name", "valueShape": { "type": "alias", "value": { "type": "primitive", "value": { - "type": "datetime" + "type": "string" } } }, - "description": "optional filter before a date" + "description": "The name of the project that is making the request.\n" + } + ], + "response": { + "statusCode": 200, + "body": { + "type": "object", + "extends": [], + "properties": [] }, + "description": "A successful response." + }, + "errors": [ { - "key": "after", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "datetime" + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "optional filter after a date" + "name": "dummy error" }, { - "key": "limit", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "double" + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "optional limit to number of results" + "name": "dummy error" + } + ], + "examples": [] + }, + "test-uuid-replacement": { + "description": "\nThis API is marked as \"Legacy\" and is no longer maintained. Follow the [migration guide](https://docs.cohere.com/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.\n\nGenerates a summary in English for a given text.\n", + "id": "/v1/summarize", + "method": "POST", + "path": [ + { + "type": "literal", + "value": "v1" }, { - "key": "offset", + "type": "literal", + "value": "summarize" + } + ], + "defaultEnvironment": "x-fern-server-name", + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", "valueShape": { "type": "alias", "value": { "type": "primitive", "value": { - "type": "double" + "type": "string" } } }, - "description": "optional offset to start of results" - }, - { - "key": "validationStatus", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "DatasetValidationStatus" - } - }, - "description": "optional filter by validation status" + "description": "The name of the project that is making the request.\n" } ], - "requestHeaders": [ + "responseHeaders": [ { - "key": "X-Client-Name", + "key": "X-API-Warning", "valueShape": { "type": "alias", "value": { @@ -2436,9 +7492,127 @@ } } }, - "description": "The name of the project that is making the request.\n" + "description": "Warning description for incorrect usage of the API" } ], + "request": { + "contentType": "application/json", + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "text", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The text to generate a summary for. Can be up to 100,000 characters long. Currently the only supported language is English." + }, + { + "key": "length", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "short" + }, + { + "value": "medium" + }, + { + "value": "long" + } + ], + "default": "medium" + }, + "description": "One of `short`, `medium`, `long`, or `auto` defaults to `auto`. Indicates the approximate length of the summary. If `auto` is selected, the best option will be picked based on the input text." + }, + { + "key": "format", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "paragraph" + }, + { + "value": "bullets" + } + ], + "default": "paragraph" + }, + "description": "One of `paragraph`, `bullets`, or `auto`, defaults to `auto`. Indicates the style in which the summary will be delivered - in a free form paragraph or in bullet points. If `auto` is selected, the best option will be picked based on the input text." + }, + { + "key": "model", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The identifier of the model to generate the summary with. Currently available models are `command` (default), `command-nightly` (experimental), `command-light`, and `command-light-nightly` (experimental). Smaller, \"light\" models are faster, while larger models will perform better." + }, + { + "key": "extractiveness", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "low" + }, + { + "value": "medium" + }, + { + "value": "high" + } + ], + "default": "low" + }, + "description": "One of `low`, `medium`, `high`, or `auto`, defaults to `auto`. Controls how close to the original text the summary is. `high` extractiveness summaries will lean towards reusing sentences verbatim, while `low` extractiveness summaries will tend to paraphrase more. If `auto` is selected, the best option will be picked based on the input text." + }, + { + "key": "temperature", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "double", + "minimum": 0, + "maximum": 5, + "default": 0.3 + } + } + }, + "description": "Ranges from 0 to 5. Controls the randomness of the output. Lower values tend to generate more “predictable” output, while higher values tend to generate more “creative” output. The sweet spot is typically between 0 and 1." + }, + { + "key": "additional_command", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "A free-form instruction for modifying how the summaries get generated. Should complete the sentence \"Generate a summary _\". Eg. \"focusing on the next steps\" or \"written by Yoda\"" + } + ] + } + }, "response": { "statusCode": 200, "body": { @@ -2446,230 +7620,317 @@ "extends": [], "properties": [ { - "key": "datasets", + "key": "id", "valueShape": { "type": "alias", "value": { - "type": "list", - "itemShape": { - "type": "alias", + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Generated ID for the summary" + }, + { + "key": "summary", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Generated summary for the text" + }, + { + "key": "meta", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ApiMeta" + } + } + } + ] + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "id", - "id": "Dataset" + "type": "string" } } } } - } - ] - }, - "description": "A successful response." - }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "Create a dataset by uploading a file. See ['Dataset Creation'](https://docs.cohere.com/docs/datasets#dataset-creation) for more information.", - "id": "/v1/datasets", - "method": "POST", - "path": [ - { - "type": "literal", - "value": "v1" - }, - { - "type": "literal", - "value": "datasets" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "queryParameters": [ - { - "key": "name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } + ] }, - "description": "The name of the uploaded dataset." + "name": "dummy error" }, { - "key": "type", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "DatasetType" - } + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] }, - "description": "The dataset type, which is used to validate the data. Valid types are `embed-input`, `reranker-finetune-input`, `single-label-classification-finetune-input`, `chat-finetune-input`, and `multi-label-classification-finetune-input`." + "name": "dummy error" }, { - "key": "keep_original_file", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "boolean" + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "Indicates if the original file should be stored." + "name": "dummy error" }, { - "key": "skip_malformed_input", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "boolean" + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "Indicates whether rows with malformed input should be dropped (instead of failing the validation check). Dropped rows will be returned in the warnings field." + "name": "dummy error" }, { - "key": "keep_fields", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", - "value": { - "type": "primitive", + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } } - } + ] }, - "description": "List of names of fields that will be persisted in the Dataset. By default the Dataset will retain only the required fields indicated in the [schema for the corresponding Dataset type](https://docs.cohere.com/docs/datasets#dataset-types). For example, datasets of type `embed-input` will drop all fields other than the required `text` field. If any of the fields in `keep_fields` are missing from the uploaded file, Dataset validation will fail." + "name": "dummy error" }, { - "key": "optional_fields", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", - "value": { - "type": "primitive", + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } } - } + ] }, - "description": "List of names of fields that will be persisted in the Dataset. By default the Dataset will retain only the required fields indicated in the [schema for the corresponding Dataset type](https://docs.cohere.com/docs/datasets#dataset-types). For example, Datasets of type `embed-input` will drop all fields other than the required `text` field. If any of the fields in `optional_fields` are missing from the uploaded file, Dataset validation will pass." + "name": "dummy error" }, { - "key": "text_separator", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "Raw .txt uploads will be split into entries using the text_separator value." + "name": "dummy error" }, { - "key": "csv_delimiter", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "The delimiter used for .csv uploads." - } - ], - "requestHeaders": [ + "name": "dummy error" + }, { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "The name of the project that is making the request.\n" + "name": "dummy error" } ], - "request": { - "contentType": "multipart/form-data", - "body": { - "type": "formData", - "fields": [ - { - "type": "file", - "key": "data", - "isOptional": false, - "description": "The file to upload" - }, - { - "type": "file", - "key": "eval_data", - "isOptional": false, - "description": "An optional evaluation file to upload" - } - ] - } - }, - "response": { - "statusCode": 200, - "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The dataset ID" - } - ] - }, - "description": "A successful response." - }, - "errors": [], "examples": [] }, "test-uuid-replacement": { - "description": "View the dataset storage usage for your Organization. Each Organization can have up to 10GB of storage across all their users.", - "id": "/v1/datasets/usage", - "method": "GET", + "description": "This endpoint splits input text into smaller units called tokens using byte-pair encoding (BPE). To learn more about tokenization and byte pair encoding, see the tokens page.", + "id": "/v1/tokenize", + "method": "POST", "path": [ { "type": "literal", @@ -2677,11 +7938,7 @@ }, { "type": "literal", - "value": "datasets" - }, - { - "type": "literal", - "value": "usage" + "value": "tokenize" } ], "defaultEnvironment": "x-fern-server-name", @@ -2706,36 +7963,385 @@ "description": "The name of the project that is making the request.\n" } ], - "response": { - "statusCode": 200, + "responseHeaders": [ + { + "key": "X-API-Warning", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Warning description for incorrect usage of the API" + } + ], + "request": { + "contentType": "application/json", "body": { "type": "object", "extends": [], "properties": [ { - "key": "organization_usage", + "key": "text", "valueShape": { "type": "alias", "value": { "type": "primitive", "value": { - "type": "double" + "type": "string" } } }, - "description": "The total number of bytes used by the organization." + "description": "The string to be tokenized, the minimum text length is 1 character, and the maximum text length is 65536 characters." + }, + { + "key": "model", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "An optional parameter to provide the model name. This will ensure that the tokenization uses the tokenizer used by that model." + } + ] + } + }, + "response": { + "statusCode": 200, + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "tokens", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "integer" + } + } + } + } + }, + "description": "An array of tokens, where each token is an integer." + }, + { + "key": "token_strings", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + } + }, + { + "key": "meta", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ApiMeta" + } + } } ] }, - "description": "A successful response." + "description": "OK" }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { - "description": "Retrieve a dataset by ID. See ['Datasets'](https://docs.cohere.com/docs/datasets) for more information.", - "id": "/v1/datasets/{id}", - "method": "GET", + "description": "This endpoint takes tokens using byte-pair encoding and returns their text representation. To learn more about tokenization and byte pair encoding, see the tokens page.", + "id": "/v1/detokenize", + "method": "POST", "path": [ { "type": "literal", @@ -2743,11 +8349,7 @@ }, { "type": "literal", - "value": "datasets" - }, - { - "type": "pathParameter", - "value": "id" + "value": "detokenize" } ], "defaultEnvironment": "x-fern-server-name", @@ -2757,9 +8359,9 @@ "baseUrl": "https://api.cohere.com" } ], - "pathParameters": [ + "requestHeaders": [ { - "key": "id", + "key": "X-Client-Name", "valueShape": { "type": "alias", "value": { @@ -2768,12 +8370,13 @@ "type": "string" } } - } + }, + "description": "The name of the project that is making the request.\n" } ], - "requestHeaders": [ + "responseHeaders": [ { - "key": "X-Client-Name", + "key": "X-API-Warning", "valueShape": { "type": "alias", "value": { @@ -2783,9 +8386,50 @@ } } }, - "description": "The name of the project that is making the request.\n" + "description": "Warning description for incorrect usage of the API" } ], + "request": { + "contentType": "application/json", + "body": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "tokens", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "integer" + } + } + } + } + }, + "description": "The list of tokens to be detokenized." + }, + { + "key": "model", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "An optional parameter to provide the model name. This will ensure that the detokenization is done by the tokenizer used by that model." + } + ] + } + }, "response": { "statusCode": 200, "body": { @@ -2793,26 +8437,304 @@ "extends": [], "properties": [ { - "key": "dataset", + "key": "text", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "A string representing the list of tokens." + }, + { + "key": "meta", "valueShape": { "type": "alias", "value": { "type": "id", - "id": "Dataset" + "id": "ApiMeta" + } + } + } + ] + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } } } - } - ] - }, - "description": "A successful response." - }, - "errors": [], + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { - "description": "Delete a dataset by ID. Datasets are automatically deleted after 30 days, but they can also be deleted manually.", - "id": "/v1/datasets/{id}", - "method": "DELETE", + "description": "Returns a list of connectors ordered by descending creation date (newer first). See ['Managing your Connector'](https://docs.cohere.com/docs/managing-your-connector) for more information.", + "id": "/v1/connectors", + "method": "GET", "path": [ { "type": "literal", @@ -2820,11 +8742,7 @@ }, { "type": "literal", - "value": "datasets" - }, - { - "type": "pathParameter", - "value": "id" + "value": "connectors" } ], "defaultEnvironment": "x-fern-server-name", @@ -2834,18 +8752,34 @@ "baseUrl": "https://api.cohere.com" } ], - "pathParameters": [ + "queryParameters": [ { - "key": "id", + "key": "limit", "valueShape": { "type": "alias", "value": { "type": "primitive", "value": { - "type": "string" + "type": "double", + "default": 30 } } - } + }, + "description": "Maximum number of connectors to return [0, 100]." + }, + { + "key": "offset", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "double", + "default": 0 + } + } + }, + "description": "Number of connectors to skip before returning results [0, inf]." } ], "requestHeaders": [ @@ -2866,18 +8800,285 @@ "response": { "statusCode": 200, "body": { - "type": "object", - "extends": [], - "properties": [] + "type": "alias", + "value": { + "type": "id", + "id": "ListConnectorsResponse" + } }, - "description": "A successful response." + "description": "OK" }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { - "description": "\nThis API is marked as \"Legacy\" and is no longer maintained. Follow the [migration guide](https://docs.cohere.com/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.\n\nGenerates a summary in English for a given text.\n", - "id": "/v1/summarize", + "description": "Creates a new connector. The connector is tested during registration and will cancel registration when the test is unsuccessful. See ['Creating and Deploying a Connector'](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) for more information.", + "id": "/v1/connectors", "method": "POST", "path": [ { @@ -2886,34 +9087,19 @@ }, { "type": "literal", - "value": "summarize" + "value": "connectors" } ], "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "requestHeaders": [ - { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "The name of the project that is making the request.\n" + "environments": [ + { + "id": "x-fern-server-name", + "baseUrl": "https://api.cohere.com" } ], - "responseHeaders": [ + "requestHeaders": [ { - "key": "X-API-Warning", + "key": "X-Client-Name", "valueShape": { "type": "alias", "value": { @@ -2923,180 +9109,302 @@ } } }, - "description": "Warning description for incorrect usage of the API" + "description": "The name of the project that is making the request.\n" } ], "request": { "contentType": "application/json", "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "text", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + "type": "alias", + "value": { + "type": "id", + "id": "CreateConnectorRequest" + } + } + }, + "response": { + "statusCode": 200, + "body": { + "type": "alias", + "value": { + "type": "id", + "id": "CreateConnectorResponse" + } + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "The text to generate a summary for. Can be up to 100,000 characters long. Currently the only supported language is English." - }, - { - "key": "length", - "valueShape": { - "type": "enum", - "values": [ - { - "value": "short" - }, - { - "value": "medium" - }, - { - "value": "long" + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } } - ], - "default": "medium" - }, - "description": "One of `short`, `medium`, `long`, or `auto` defaults to `auto`. Indicates the approximate length of the summary. If `auto` is selected, the best option will be picked based on the input text." - }, - { - "key": "format", - "valueShape": { - "type": "enum", - "values": [ - { - "value": "paragraph" - }, - { - "value": "bullets" + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } } - ], - "default": "paragraph" - }, - "description": "One of `paragraph`, `bullets`, or `auto`, defaults to `auto`. Indicates the style in which the summary will be delivered - in a free form paragraph or in bullet points. If `auto` is selected, the best option will be picked based on the input text." - }, - { - "key": "model", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "The identifier of the model to generate the summary with. Currently available models are `command` (default), `command-nightly` (experimental), `command-light`, and `command-light-nightly` (experimental). Smaller, \"light\" models are faster, while larger models will perform better." - }, - { - "key": "extractiveness", - "valueShape": { - "type": "enum", - "values": [ - { - "value": "low" - }, - { - "value": "medium" - }, - { - "value": "high" + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } } - ], - "default": "low" - }, - "description": "One of `low`, `medium`, `high`, or `auto`, defaults to `auto`. Controls how close to the original text the summary is. `high` extractiveness summaries will lean towards reusing sentences verbatim, while `low` extractiveness summaries will tend to paraphrase more. If `auto` is selected, the best option will be picked based on the input text." - }, - { - "key": "temperature", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "double", - "minimum": 0, - "maximum": 5, - "default": 0.3 + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "Ranges from 0 to 5. Controls the randomness of the output. Lower values tend to generate more “predictable” output, while higher values tend to generate more “creative” output. The sweet spot is typically between 0 and 1." - }, - { - "key": "additional_command", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "A free-form instruction for modifying how the summaries get generated. Should complete the sentence \"Generate a summary _\". Eg. \"focusing on the next steps\" or \"written by Yoda\"" - } - ] - } - }, - "response": { - "statusCode": 200, - "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "Generated ID for the summary" - }, - { - "key": "summary", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "Generated summary for the text" - }, - { - "key": "meta", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "ApiMeta" - } } - } - ] + ] + }, + "name": "dummy error" }, - "description": "OK" - }, - "errors": [], + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { - "description": "This endpoint splits input text into smaller units called tokens using byte-pair encoding (BPE). To learn more about tokenization and byte pair encoding, see the tokens page.", - "id": "/v1/tokenize", - "method": "POST", + "description": "Retrieve a connector by ID. See ['Connectors'](https://docs.cohere.com/docs/connectors) for more information.", + "id": "/v1/connectors/{id}", + "method": "GET", "path": [ { "type": "literal", @@ -3104,7 +9412,11 @@ }, { "type": "literal", - "value": "tokenize" + "value": "connectors" + }, + { + "type": "pathParameter", + "value": "id" } ], "defaultEnvironment": "x-fern-server-name", @@ -3114,9 +9426,9 @@ "baseUrl": "https://api.cohere.com" } ], - "requestHeaders": [ + "pathParameters": [ { - "key": "X-Client-Name", + "key": "id", "valueShape": { "type": "alias", "value": { @@ -3126,12 +9438,12 @@ } } }, - "description": "The name of the project that is making the request.\n" + "description": "The ID of the connector to retrieve." } ], - "responseHeaders": [ + "requestHeaders": [ { - "key": "X-API-Warning", + "key": "X-Client-Name", "valueShape": { "type": "alias", "value": { @@ -3141,108 +9453,292 @@ } } }, - "description": "Warning description for incorrect usage of the API" + "description": "The name of the project that is making the request.\n" } ], - "request": { - "contentType": "application/json", + "response": { + "statusCode": 200, "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "text", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + "type": "alias", + "value": { + "type": "id", + "id": "GetConnectorResponse" + } + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "The string to be tokenized, the minimum text length is 1 character, and the maximum text length is 65536 characters." - }, - { - "key": "model", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "An optional parameter to provide the model name. This will ensure that the tokenization uses the tokenizer used by that model." - } - ] - } - }, - "response": { - "statusCode": 200, - "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "tokens", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "primitive", - "value": { - "type": "integer" - } + "type": "string" } } } - }, - "description": "An array of tokens, where each token is an integer." - }, - { - "key": "token_strings", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "primitive", - "value": { - "type": "string" - } + "type": "string" } } } } - }, - { - "key": "meta", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "ApiMeta" + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } } } - } - ] - }, - "description": "OK" - }, - "errors": [], + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { - "description": "This endpoint takes tokens using byte-pair encoding and returns their text representation. To learn more about tokenization and byte pair encoding, see the tokens page.", - "id": "/v1/detokenize", - "method": "POST", + "description": "Delete a connector by ID. See ['Connectors'](https://docs.cohere.com/docs/connectors) for more information.", + "id": "/v1/connectors/{id}", + "method": "DELETE", "path": [ { "type": "literal", @@ -3250,7 +9746,11 @@ }, { "type": "literal", - "value": "detokenize" + "value": "connectors" + }, + { + "type": "pathParameter", + "value": "id" } ], "defaultEnvironment": "x-fern-server-name", @@ -3260,9 +9760,9 @@ "baseUrl": "https://api.cohere.com" } ], - "requestHeaders": [ + "pathParameters": [ { - "key": "X-Client-Name", + "key": "id", "valueShape": { "type": "alias", "value": { @@ -3272,12 +9772,12 @@ } } }, - "description": "The name of the project that is making the request.\n" + "description": "The ID of the connector to delete." } ], - "responseHeaders": [ + "requestHeaders": [ { - "key": "X-API-Warning", + "key": "X-Client-Name", "valueShape": { "type": "alias", "value": { @@ -3287,90 +9787,292 @@ } } }, - "description": "Warning description for incorrect usage of the API" + "description": "The name of the project that is making the request.\n" } ], - "request": { - "contentType": "application/json", + "response": { + "statusCode": 200, "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "tokens", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { - "type": "alias", + "type": "alias", + "value": { + "type": "id", + "id": "DeleteConnectorResponse" + } + }, + "description": "OK" + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", "value": { - "type": "primitive", - "value": { - "type": "integer" - } + "type": "string" } } } - }, - "description": "The list of tokens to be detokenized." - }, - { - "key": "model", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "An optional parameter to provide the model name. This will ensure that the detokenization is done by the tokenizer used by that model." - } - ] - } - }, - "response": { - "statusCode": 200, - "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "text", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } - }, - "description": "A string representing the list of tokens." - }, - { - "key": "meta", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "ApiMeta" - } } - } - ] - }, - "description": "OK" - }, - "errors": [], + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { - "description": "Returns a list of connectors ordered by descending creation date (newer first). See ['Managing your Connector'](https://docs.cohere.com/docs/managing-your-connector) for more information.", - "id": "/v1/connectors", - "method": "GET", + "description": "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.", + "id": "/v1/connectors/{id}/oauth/authorize", + "method": "POST", "path": [ { "type": "literal", @@ -3379,6 +10081,18 @@ { "type": "literal", "value": "connectors" + }, + { + "type": "pathParameter", + "value": "id" + }, + { + "type": "literal", + "value": "oauth" + }, + { + "type": "literal", + "value": "authorize" } ], "defaultEnvironment": "x-fern-server-name", @@ -3388,34 +10102,34 @@ "baseUrl": "https://api.cohere.com" } ], - "queryParameters": [ + "pathParameters": [ { - "key": "limit", + "key": "id", "valueShape": { "type": "alias", "value": { "type": "primitive", "value": { - "type": "double", - "default": 30 + "type": "string" } } }, - "description": "Maximum number of connectors to return [0, 100]." - }, + "description": "The ID of the connector to authorize." + } + ], + "queryParameters": [ { - "key": "offset", + "key": "after_token_redirect", "valueShape": { "type": "alias", "value": { "type": "primitive", "value": { - "type": "double", - "default": 0 + "type": "string" } } }, - "description": "Number of connectors to skip before returning results [0, inf]." + "description": "The URL to redirect to after the connector has been authorized." } ], "requestHeaders": [ @@ -3439,77 +10153,282 @@ "type": "alias", "value": { "type": "id", - "id": "ListConnectorsResponse" + "id": "OAuthAuthorizeResponse" } }, "description": "OK" }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "Creates a new connector. The connector is tested during registration and will cancel registration when the test is unsuccessful. See ['Creating and Deploying a Connector'](https://docs.cohere.com/v1/docs/creating-and-deploying-a-connector) for more information.", - "id": "/v1/connectors", - "method": "POST", - "path": [ + "errors": [ { - "type": "literal", - "value": "v1" + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" }, { - "type": "literal", - "value": "connectors" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "requestHeaders": [ + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "The name of the project that is making the request.\n" + "name": "dummy error" } ], - "request": { - "contentType": "application/json", - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "CreateConnectorRequest" - } - } - }, - "response": { - "statusCode": 200, - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "CreateConnectorResponse" - } - }, - "description": "OK" - }, - "errors": [], "examples": [] }, "test-uuid-replacement": { - "description": "Retrieve a connector by ID. See ['Connectors'](https://docs.cohere.com/docs/connectors) for more information.", - "id": "/v1/connectors/{id}", + "description": "Returns the details of a model, provided its name.", + "id": "/v1/models/{model}", "method": "GET", "path": [ { @@ -3518,11 +10437,11 @@ }, { "type": "literal", - "value": "connectors" + "value": "models" }, { "type": "pathParameter", - "value": "id" + "value": "model" } ], "defaultEnvironment": "x-fern-server-name", @@ -3534,7 +10453,7 @@ ], "pathParameters": [ { - "key": "id", + "key": "model", "valueShape": { "type": "alias", "value": { @@ -3543,8 +10462,7 @@ "type": "string" } } - }, - "description": "The ID of the connector to retrieve." + } } ], "requestHeaders": [ @@ -3562,93 +10480,304 @@ "description": "The name of the project that is making the request.\n" } ], + "responseHeaders": [ + { + "key": "X-API-Warning", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Warning description for incorrect usage of the API" + } + ], "response": { "statusCode": 200, "body": { "type": "alias", "value": { "type": "id", - "id": "GetConnectorResponse" + "id": "GetModelResponse" } }, "description": "OK" }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "Delete a connector by ID. See ['Connectors'](https://docs.cohere.com/docs/connectors) for more information.", - "id": "/v1/connectors/{id}", - "method": "DELETE", - "path": [ + "errors": [ { - "type": "literal", - "value": "v1" + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" }, { - "type": "literal", - "value": "connectors" + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" }, { - "type": "pathParameter", - "value": "id" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "pathParameters": [ + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, { - "key": "id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] }, - "description": "The ID of the connector to delete." - } - ], - "requestHeaders": [ + "name": "dummy error" + }, { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "The name of the project that is making the request.\n" + "name": "dummy error" } ], - "response": { - "statusCode": 200, - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "DeleteConnectorResponse" - } - }, - "description": "OK" - }, - "errors": [], "examples": [] }, "test-uuid-replacement": { - "description": "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.", - "id": "/v1/connectors/{id}/oauth/authorize", - "method": "POST", + "description": "Returns a list of models available for use. The list contains models from Cohere as well as your fine-tuned models.", + "id": "/v1/models", + "method": "GET", "path": [ { "type": "literal", @@ -3656,19 +10785,7 @@ }, { "type": "literal", - "value": "connectors" - }, - { - "type": "pathParameter", - "value": "id" - }, - { - "type": "literal", - "value": "oauth" - }, - { - "type": "literal", - "value": "authorize" + "value": "models" } ], "defaultEnvironment": "x-fern-server-name", @@ -3678,24 +10795,22 @@ "baseUrl": "https://api.cohere.com" } ], - "pathParameters": [ + "queryParameters": [ { - "key": "id", + "key": "page_size", "valueShape": { "type": "alias", "value": { "type": "primitive", "value": { - "type": "string" + "type": "double" } } }, - "description": "The ID of the connector to authorize." - } - ], - "queryParameters": [ + "description": "Maximum number of models to include in a page\nDefaults to `20`, min value of `1`, max value of `1000`." + }, { - "key": "after_token_redirect", + "key": "page_token", "valueShape": { "type": "alias", "value": { @@ -3705,22 +10820,31 @@ } } }, - "description": "The URL to redirect to after the connector has been authorized." - } - ], - "requestHeaders": [ + "description": "Page token provided in the `next_page_token` field of a previous response." + }, { - "key": "X-Client-Name", + "key": "endpoint", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "CompatibleEndpoint" + } + }, + "description": "When provided, filters the list of models to only those that are compatible with the specified endpoint." + }, + { + "key": "default_only", "valueShape": { "type": "alias", "value": { "type": "primitive", "value": { - "type": "string" + "type": "boolean" } } }, - "description": "The name of the project that is making the request.\n" + "description": "When provided, filters the list of models to only the default model to the endpoint. This parameter is only valid when `endpoint` is provided." } ], "response": { @@ -3729,18 +10853,283 @@ "type": "alias", "value": { "type": "id", - "id": "OAuthAuthorizeResponse" + "id": "ListModelsResponse" } }, "description": "OK" }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { - "description": "Returns the details of a model, provided its name.", - "id": "/v1/models/{model}", - "method": "GET", + "description": "Checks that the api key in the Authorization header is valid and active\n", + "id": "/v1/check-api-key", + "method": "POST", "path": [ { "type": "literal", @@ -3748,11 +11137,7 @@ }, { "type": "literal", - "value": "models" - }, - { - "type": "pathParameter", - "value": "model" + "value": "check-api-key" } ], "defaultEnvironment": "x-fern-server-name", @@ -3762,20 +11147,6 @@ "baseUrl": "https://api.cohere.com" } ], - "pathParameters": [ - { - "key": "model", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - } - } - ], "requestHeaders": [ { "key": "X-Client-Name", @@ -3791,205 +11162,318 @@ "description": "The name of the project that is making the request.\n" } ], - "responseHeaders": [ - { - "key": "X-API-Warning", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" - } - } - }, - "description": "Warning description for incorrect usage of the API" - } - ], "response": { "statusCode": 200, "body": { - "type": "alias", - "value": { - "type": "id", - "id": "GetModelResponse" - } + "type": "object", + "extends": [], + "properties": [ + { + "key": "valid", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "boolean" + } + } + } + }, + { + "key": "organization_id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + }, + { + "key": "owner_id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] }, "description": "OK" }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "Returns a list of models available for use. The list contains models from Cohere as well as your fine-tuned models.", - "id": "/v1/models", - "method": "GET", - "path": [ + "errors": [ { - "type": "literal", - "value": "v1" + "statusCode": 400, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" }, { - "type": "literal", - "value": "models" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "queryParameters": [ - { - "key": "page_size", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "double" + "statusCode": 401, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "Maximum number of models to include in a page\nDefaults to `20`, min value of `1`, max value of `1000`." + "name": "dummy error" }, { - "key": "page_token", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 403, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "Page token provided in the `next_page_token` field of a previous response." + "name": "dummy error" }, { - "key": "endpoint", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "CompatibleEndpoint" - } + "statusCode": 404, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] }, - "description": "When provided, filters the list of models to only those that are compatible with the specified endpoint." + "name": "dummy error" }, { - "key": "default_only", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "boolean" + "statusCode": 422, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "When provided, filters the list of models to only the default model to the endpoint. This parameter is only valid when `endpoint` is provided." - } - ], - "response": { - "statusCode": 200, - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "ListModelsResponse" - } + "name": "dummy error" }, - "description": "OK" - }, - "errors": [], - "examples": [] - }, - "test-uuid-replacement": { - "description": "Checks that the api key in the Authorization header is valid and active\n", - "id": "/v1/check-api-key", - "method": "POST", - "path": [ { - "type": "literal", - "value": "v1" + "statusCode": 429, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" }, { - "type": "literal", - "value": "check-api-key" - } - ], - "defaultEnvironment": "x-fern-server-name", - "environments": [ - { - "id": "x-fern-server-name", - "baseUrl": "https://api.cohere.com" - } - ], - "requestHeaders": [ + "statusCode": 498, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + }, { - "key": "X-Client-Name", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", - "value": { - "type": "string" + "statusCode": 499, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } } - } + ] }, - "description": "The name of the project that is making the request.\n" - } - ], - "response": { - "statusCode": 200, - "body": { - "type": "object", - "extends": [], - "properties": [ - { - "key": "valid", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "boolean" + "type": "primitive", + "value": { + "type": "string" + } } } } - }, - { - "key": "organization_id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + ] + }, + "name": "dummy error" + }, + { + "statusCode": 501, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } } - }, - { - "key": "owner_id", - "valueShape": { - "type": "alias", - "value": { - "type": "primitive", + ] + }, + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", "value": { - "type": "string" + "type": "primitive", + "value": { + "type": "string" + } } } } - } - ] + ] + }, + "name": "dummy error" }, - "description": "OK" - }, - "errors": [], + { + "statusCode": 504, + "shape": { + "type": "object", + "extends": [], + "properties": [ + { + "key": "data", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { @@ -4083,7 +11567,80 @@ }, "description": "A successful response." }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Bad Request", + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Unauthorized", + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Forbidden", + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Not Found", + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Internal Server Error", + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Status Service Unavailable", + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { @@ -4146,7 +11703,80 @@ }, "description": "A successful response." }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Bad Request", + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Unauthorized", + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Forbidden", + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Not Found", + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Internal Server Error", + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Status Service Unavailable", + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { @@ -4179,46 +11809,119 @@ ], "pathParameters": [ { - "key": "id", - "valueShape": { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The fine-tuned model ID." + } + ], + "requestHeaders": [ + { + "key": "X-Client-Name", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The name of the project that is making the request.\n" + } + ], + "response": { + "statusCode": 200, + "body": { + "type": "alias", + "value": { + "type": "id", + "id": "GetFinetunedModelResponse" + } + }, + "description": "A successful response." + }, + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Bad Request", + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Unauthorized", + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Forbidden", + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Not Found", + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { "type": "alias", "value": { - "type": "primitive", - "value": { - "type": "string" - } + "type": "id", + "id": "Error" } }, - "description": "The fine-tuned model ID." - } - ], - "requestHeaders": [ + "description": "Internal Server Error", + "name": "dummy error" + }, { - "key": "X-Client-Name", - "valueShape": { + "statusCode": 503, + "shape": { "type": "alias", "value": { - "type": "primitive", - "value": { - "type": "string" - } + "type": "id", + "id": "Error" } }, - "description": "The name of the project that is making the request.\n" + "description": "Status Service Unavailable", + "name": "dummy error" } ], - "response": { - "statusCode": 200, - "body": { - "type": "alias", - "value": { - "type": "id", - "id": "GetFinetunedModelResponse" - } - }, - "description": "A successful response." - }, - "errors": [], "examples": [] }, "test-uuid-replacement": { @@ -4290,7 +11993,80 @@ }, "description": "A successful response." }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Bad Request", + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Unauthorized", + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Forbidden", + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Not Found", + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Internal Server Error", + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Status Service Unavailable", + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { @@ -4407,7 +12183,80 @@ }, "description": "A successful response." }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Bad Request", + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Unauthorized", + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Forbidden", + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Not Found", + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Internal Server Error", + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Status Service Unavailable", + "name": "dummy error" + } + ], "examples": [] }, "test-uuid-replacement": { @@ -4511,7 +12360,80 @@ }, "description": "A successful response." }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Bad Request", + "name": "dummy error" + }, + { + "statusCode": 401, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Unauthorized", + "name": "dummy error" + }, + { + "statusCode": 403, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Forbidden", + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Not Found", + "name": "dummy error" + }, + { + "statusCode": 500, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Internal Server Error", + "name": "dummy error" + }, + { + "statusCode": 503, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Error" + } + }, + "description": "Status Service Unavailable", + "name": "dummy error" + } + ], "examples": [] } }, @@ -4660,34 +12582,218 @@ "extends": [], "properties": [ { - "key": "role", - "valueShape": { - "type": "alias", - "value": { - "type": "id", - "id": "ChatRole" + "key": "role", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ChatRole" + } + } + }, + { + "key": "tool_results", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ToolResult" + } + } + } + } + } + ] + }, + "description": "Represents tool result in the chat history.\n" + }, + "Message": { + "name": "Message", + "shape": { + "type": "discriminatedUnion", + "discriminant": "role", + "variants": [ + { + "discriminantValue": "CHATBOT", + "description": "Represents a single message in the chat history, excluding the current user turn. It has two properties: `role` and `message`. The `role` identifies the sender (`CHATBOT`, `SYSTEM`, or `USER`), while the `message` contains the text content.\n\nThe chat_history parameter should not be used for `SYSTEM` messages in most cases. Instead, to add a `SYSTEM` role message at the beginning of a conversation, the `preamble` parameter should be used.\n", + "type": "object", + "extends": [], + "properties": [ + { + "key": "role", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ChatRole" + } + } + }, + { + "key": "message", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Contents of the chat message.\n" + }, + { + "key": "tool_calls", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ToolCall" + } + } + } + } + } + ] + }, + { + "discriminantValue": "SYSTEM", + "description": "Represents a single message in the chat history, excluding the current user turn. It has two properties: `role` and `message`. The `role` identifies the sender (`CHATBOT`, `SYSTEM`, or `USER`), while the `message` contains the text content.\n\nThe chat_history parameter should not be used for `SYSTEM` messages in most cases. Instead, to add a `SYSTEM` role message at the beginning of a conversation, the `preamble` parameter should be used.\n", + "type": "object", + "extends": [], + "properties": [ + { + "key": "role", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ChatRole" + } + } + }, + { + "key": "message", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Contents of the chat message.\n" + }, + { + "key": "tool_calls", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ToolCall" + } + } + } + } + } + ] + }, + { + "discriminantValue": "USER", + "description": "Represents a single message in the chat history, excluding the current user turn. It has two properties: `role` and `message`. The `role` identifies the sender (`CHATBOT`, `SYSTEM`, or `USER`), while the `message` contains the text content.\n\nThe chat_history parameter should not be used for `SYSTEM` messages in most cases. Instead, to add a `SYSTEM` role message at the beginning of a conversation, the `preamble` parameter should be used.\n", + "type": "object", + "extends": [], + "properties": [ + { + "key": "role", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ChatRole" + } + } + }, + { + "key": "message", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "Contents of the chat message.\n" + }, + { + "key": "tool_calls", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ToolCall" + } + } + } + } } - } + ] }, { - "key": "tool_results", - "valueShape": { - "type": "alias", - "value": { - "type": "list", - "itemShape": { + "discriminantValue": "TOOL", + "description": "Represents tool result in the chat history.\n", + "type": "object", + "extends": [], + "properties": [ + { + "key": "role", + "valueShape": { "type": "alias", "value": { "type": "id", - "id": "ToolResult" + "id": "ChatRole" + } + } + }, + { + "key": "tool_results", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ToolResult" + } + } } } } - } + ] } ] - }, - "description": "Represents tool result in the chat history.\n" + } }, "ChatConnector": { "name": "ChatConnector", @@ -4882,6 +12988,59 @@ ] } }, + "ResponseFormat": { + "name": "ResponseFormat", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "text", + "type": "object", + "extends": [], + "properties": [ + { + "key": "type", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ResponseFormatType" + } + } + } + ] + }, + { + "discriminantValue": "json_object", + "type": "object", + "extends": [], + "properties": [ + { + "key": "type", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ResponseFormatType" + } + } + }, + { + "key": "schema", + "valueShape": { + "type": "object", + "extends": [], + "properties": [] + }, + "description": "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.\nExample (required name and age object):\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"}\n },\n \"required\": [\"name\", \"age\"]\n}\n```\n\n**Note**: This field must not be specified when the `type` is set to `\"text\"`.\n" + } + ] + } + ] + }, + "description": "Configuration for forcing the model output to adhere to the specified format. Supported on [Command R 03-2024](https://docs.cohere.com/docs/command-r), [Command R+ 04-2024](https://docs.cohere.com/docs/command-r-plus) and newer models.\n\nThe model can be forced into outputting JSON objects (with up to 5 levels of nesting) by setting `{ \"type\": \"json_object\" }`.\n\nA [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.\n\n**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.\n**Limitation**: The parameter is not supported in RAG mode (when any of `connectors`, `documents`, `tools`, `tool_results` are provided).\n" + }, "ChatCitation": { "name": "ChatCitation", "shape": { @@ -5514,6 +13673,76 @@ ] } }, + "ChatStreamStartEvent": { + "name": "ChatStreamStartEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + }, + "ChatSearchQueriesGenerationEvent": { + "name": "ChatSearchQueriesGenerationEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + }, + "ChatSearchResultsEvent": { + "name": "ChatSearchResultsEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + }, + "ChatTextGenerationEvent": { + "name": "ChatTextGenerationEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + }, + "ChatCitationGenerationEvent": { + "name": "ChatCitationGenerationEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + }, + "ChatToolCallsGenerationEvent": { + "name": "ChatToolCallsGenerationEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + }, + "ChatStreamEndEvent": { + "name": "ChatStreamEndEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + }, "ToolCallDelta": { "name": "ToolCallDelta", "shape": { @@ -5576,6 +13805,108 @@ }, "description": "Contains the chunk of the tool call generation in the stream.\n" }, + "ChatToolCallsChunkEvent": { + "name": "ChatToolCallsChunkEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + }, + "ChatDebugEvent": { + "name": "ChatDebugEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + }, + "StreamedChatResponse": { + "name": "StreamedChatResponse", + "shape": { + "type": "discriminatedUnion", + "discriminant": "event_type", + "variants": [ + { + "discriminantValue": "stream-start", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "search-queries-generation", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "search-results", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "text-generation", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "citation-generation", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "tool-calls-generation", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "stream-end", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "tool-calls-chunk", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "debug", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + ] + }, + "description": "StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request)." + }, "TextContent": { "name": "TextContent", "shape": { @@ -5609,6 +13940,47 @@ }, "description": "Text content of the message." }, + "Content": { + "name": "Content", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "text", + "description": "Text content of the message.", + "type": "object", + "extends": [], + "properties": [ + { + "key": "type", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "text" + } + ] + } + }, + { + "key": "text", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + } + ] + }, + "description": "A Content block which contains information about the content type and the content itself." + }, "UserMessage": { "name": "User Message", "shape": { @@ -5625,6 +13997,14 @@ } ] } + }, + { + "key": "content", + "valueShape": { + "type": "undiscriminatedUnion", + "variants": [] + }, + "description": "The content of the message. This can be a string or a list of content blocks.\nIf a string is provided, it will be treated as a text content block.\n" } ] }, @@ -5757,6 +14137,73 @@ }, "description": "A document source object containing the unique identifier of the document and the document itself." }, + "Source": { + "name": "Source", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "tool", + "type": "object", + "extends": [], + "properties": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The unique identifier of the document" + }, + { + "key": "tool_output", + "valueShape": { + "type": "object", + "extends": [], + "properties": [] + } + } + ] + }, + { + "discriminantValue": "document", + "description": "A document source object containing the unique identifier of the document and the document itself.", + "type": "object", + "extends": [], + "properties": [ + { + "key": "id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The unique identifier of the document" + }, + { + "key": "document", + "valueShape": { + "type": "object", + "extends": [], + "properties": [] + } + } + ] + } + ] + }, + "description": "A source object containing information about the source of the data cited." + }, "Citation": { "name": "Citation", "shape": { @@ -5868,6 +14315,13 @@ }, "description": "A chain-of-thought style reflection and plan that the model generates when working with Tools." }, + { + "key": "content", + "valueShape": { + "type": "undiscriminatedUnion", + "variants": [] + } + }, { "key": "citations", "valueShape": { @@ -5904,6 +14358,13 @@ } ] } + }, + { + "key": "content", + "valueShape": { + "type": "undiscriminatedUnion", + "variants": [] + } } ] }, @@ -5972,11 +14433,81 @@ "type": "id", "id": "Document" } - } + } + } + ] + }, + "description": "Document content." + }, + "ToolContent": { + "name": "ToolContent", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "text", + "description": "Text content of the message.", + "type": "object", + "extends": [], + "properties": [ + { + "key": "type", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "text" + } + ] + } + }, + { + "key": "text", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + }, + { + "discriminantValue": "document", + "description": "Document content.", + "type": "object", + "extends": [], + "properties": [ + { + "key": "type", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "document" + } + ] + } + }, + { + "key": "document", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "Document" + } + } + } + ] } ] }, - "description": "Document content." + "description": "A content block which contains information about the content of a tool result" }, "ToolMessageV2": { "name": "Tool Message", @@ -6007,11 +14538,193 @@ } }, "description": "The id of the associated tool call that has provided the given content" + }, + { + "key": "content", + "valueShape": { + "type": "undiscriminatedUnion", + "variants": [] + }, + "description": "Outputs from a tool. The content should formatted as a JSON object string, or a list of tool content blocks" } ] }, "description": "A message with Tool outputs." }, + "ChatMessageV2": { + "name": "ChatMessageV2", + "shape": { + "type": "discriminatedUnion", + "discriminant": "role", + "variants": [ + { + "discriminantValue": "user", + "description": "A message from the user.", + "type": "object", + "extends": [], + "properties": [ + { + "key": "role", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "user" + } + ] + } + }, + { + "key": "content", + "valueShape": { + "type": "undiscriminatedUnion", + "variants": [] + }, + "description": "The content of the message. This can be a string or a list of content blocks.\nIf a string is provided, it will be treated as a text content block.\n" + } + ] + }, + { + "discriminantValue": "assistant", + "description": "A message from the assistant role can contain text and tool call information.", + "type": "object", + "extends": [], + "properties": [ + { + "key": "role", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "assistant" + } + ] + } + }, + { + "key": "tool_calls", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ToolCallV2" + } + } + } + } + }, + { + "key": "tool_plan", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "A chain-of-thought style reflection and plan that the model generates when working with Tools." + }, + { + "key": "content", + "valueShape": { + "type": "undiscriminatedUnion", + "variants": [] + } + }, + { + "key": "citations", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "alias", + "value": { + "type": "id", + "id": "Citation" + } + } + } + } + } + ] + }, + { + "discriminantValue": "system", + "description": "A message from the system.", + "type": "object", + "extends": [], + "properties": [ + { + "key": "role", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "system" + } + ] + } + }, + { + "key": "content", + "valueShape": { + "type": "undiscriminatedUnion", + "variants": [] + } + } + ] + }, + { + "discriminantValue": "tool", + "description": "A message with Tool outputs.", + "type": "object", + "extends": [], + "properties": [ + { + "key": "role", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "tool" + } + ] + } + }, + { + "key": "tool_call_id", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + }, + "description": "The id of the associated tool call that has provided the given content" + }, + { + "key": "content", + "valueShape": { + "type": "undiscriminatedUnion", + "variants": [] + }, + "description": "Outputs from a tool. The content should formatted as a JSON object string, or a list of tool content blocks" + } + ] + } + ] + }, + "description": "Represents a single message in the chat history from a given role." + }, "ChatMessages": { "name": "ChatMessages", "shape": { @@ -6184,6 +14897,59 @@ ] } }, + "ResponseFormatV2": { + "name": "ResponseFormatV2", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "text", + "type": "object", + "extends": [], + "properties": [ + { + "key": "type", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ResponseFormatTypeV2" + } + } + } + ] + }, + { + "discriminantValue": "json_object", + "type": "object", + "extends": [], + "properties": [ + { + "key": "type", + "valueShape": { + "type": "alias", + "value": { + "type": "id", + "id": "ResponseFormatTypeV2" + } + } + }, + { + "key": "json_schema", + "valueShape": { + "type": "object", + "extends": [], + "properties": [] + }, + "description": "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.\nExample (required name and age object):\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"}\n },\n \"required\": [\"name\", \"age\"]\n}\n```\n\n**Note**: This field must not be specified when the `type` is set to `\"text\"`.\n" + } + ] + } + ] + }, + "description": "Configuration for forcing the model output to adhere to the specified format. Supported on [Command R](https://docs.cohere.com/v2/docs/command-r), [Command R+](https://docs.cohere.com/v2/docs/command-r-plus) and newer models.\n\nThe model can be forced into outputting JSON objects by setting `{ \"type\": \"json_object\" }`.\n\nA [JSON Schema](https://json-schema.org/) can optionally be provided, to ensure a specific structure.\n\n**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.\n\n**Note**: When `json_schema` is not specified, the generated object can have up to 5 layers of nesting.\n\n**Limitation**: The parameter is not supported when used in combinations with the `documents` or `tools` parameters.\n" + }, "ChatFinishReason": { "name": "ChatFinishReason", "shape": { @@ -6254,6 +15020,52 @@ }, "description": "A chain-of-thought style reflection and plan that the model generates when working with Tools." }, + { + "key": "content", + "valueShape": { + "type": "alias", + "value": { + "type": "list", + "itemShape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "text", + "description": "Text content of the message.", + "type": "object", + "extends": [], + "properties": [ + { + "key": "type", + "valueShape": { + "type": "enum", + "values": [ + { + "value": "text" + } + ] + } + }, + { + "key": "text", + "valueShape": { + "type": "alias", + "value": { + "type": "primitive", + "value": { + "type": "string" + } + } + } + } + ] + } + ] + } + } + } + }, { "key": "citations", "valueShape": { @@ -6558,6 +15370,244 @@ }, "description": "The streamed event types" }, + "ChatMessageStartEvent": { + "name": "ChatMessageStartEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed event which signifies that a stream has started." + }, + "ChatContentStartEvent": { + "name": "ChatContentStartEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed delta event which signifies that a new content block has started." + }, + "ChatContentDeltaEvent": { + "name": "ChatContentDeltaEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed delta event which contains a delta of chat text content." + }, + "ChatContentEndEvent": { + "name": "ChatContentEndEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed delta event which signifies that the content block has ended." + }, + "ChatToolPlanDeltaEvent": { + "name": "ChatToolPlanDeltaEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed event which contains a delta of tool plan text." + }, + "ChatToolCallStartEvent": { + "name": "ChatToolCallStartEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed event delta which signifies a tool call has started streaming." + }, + "ChatToolCallDeltaEvent": { + "name": "ChatToolCallDeltaEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed event delta which signifies a delta in tool call arguments." + }, + "ChatToolCallEndEvent": { + "name": "ChatToolCallEndEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed event delta which signifies a tool call has finished streaming." + }, + "CitationStartEvent": { + "name": "CitationStartEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed event which signifies a citation has been created." + }, + "CitationEndEvent": { + "name": "CitationEndEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed event which signifies a citation has finished streaming." + }, + "ChatMessageEndEvent": { + "name": "ChatMessageEndEvent", + "shape": { + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + "description": "A streamed event which signifies that the chat message has ended." + }, + "StreamedChatResponseV2": { + "name": "StreamedChatResponseV2", + "shape": { + "type": "discriminatedUnion", + "discriminant": "type", + "variants": [ + { + "discriminantValue": "message-start", + "description": "A streamed event which signifies that a stream has started.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "content-start", + "description": "A streamed delta event which signifies that a new content block has started.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "content-delta", + "description": "A streamed delta event which contains a delta of chat text content.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "content-end", + "description": "A streamed delta event which signifies that the content block has ended.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "tool-plan-delta", + "description": "A streamed event which contains a delta of tool plan text.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "tool-call-start", + "description": "A streamed event delta which signifies a tool call has started streaming.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "tool-call-delta", + "description": "A streamed event delta which signifies a delta in tool call arguments.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "tool-call-end", + "description": "A streamed event delta which signifies a tool call has finished streaming.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "citation-start", + "description": "A streamed event which signifies a citation has been created.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "citation-end", + "description": "A streamed event which signifies a citation has finished streaming.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "message-end", + "description": "A streamed event which signifies that the chat message has ended.", + "type": "object", + "extends": [ + "ChatStreamEventType" + ], + "properties": [] + }, + { + "discriminantValue": "debug", + "type": "object", + "extends": [ + "ChatStreamEvent" + ], + "properties": [] + } + ] + }, + "description": "StreamedChatResponse is returned in streaming mode (specified with `stream=True` in the request)." + }, "SingleGeneration": { "name": "SingleGeneration", "shape": { @@ -6743,6 +15793,16 @@ ] } }, + "GenerateStreamText": { + "name": "GenerateStreamText", + "shape": { + "type": "object", + "extends": [ + "GenerateStreamEvent" + ], + "properties": [] + } + }, "SingleGenerationInStream": { "name": "SingleGenerationInStream", "shape": { @@ -6800,6 +15860,60 @@ ] } }, + "GenerateStreamEnd": { + "name": "GenerateStreamEnd", + "shape": { + "type": "object", + "extends": [ + "GenerateStreamEvent" + ], + "properties": [] + } + }, + "GenerateStreamError": { + "name": "GenerateStreamError", + "shape": { + "type": "object", + "extends": [ + "GenerateStreamEvent" + ], + "properties": [] + } + }, + "GenerateStreamedResponse": { + "name": "GenerateStreamedResponse", + "shape": { + "type": "discriminatedUnion", + "discriminant": "event_type", + "variants": [ + { + "discriminantValue": "text-generation", + "type": "object", + "extends": [ + "GenerateStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "stream-end", + "type": "object", + "extends": [ + "GenerateStreamEvent" + ], + "properties": [] + }, + { + "discriminantValue": "stream-error", + "type": "object", + "extends": [ + "GenerateStreamEvent" + ], + "properties": [] + } + ] + }, + "description": "Response in content type stream when `stream` is `true` in the request parameters. Generation tokens are streamed with the GenerationStream response. The final response is of type GenerationFinalResponse." + }, "EmbedInputType": { "name": "EmbedInputType", "shape": { diff --git a/packages/parsers/src/__test__/__snapshots__/openapi/petstore.json b/packages/parsers/src/__test__/__snapshots__/openapi/petstore.json index eaebd9b94c..1f3dd1af76 100644 --- a/packages/parsers/src/__test__/__snapshots__/openapi/petstore.json +++ b/packages/parsers/src/__test__/__snapshots__/openapi/petstore.json @@ -130,7 +130,32 @@ }, "description": "The pet" }, - "errors": [], + "errors": [ + { + "statusCode": 400, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Pet" + } + }, + "description": "Invalid ID supplied", + "name": "dummy error" + }, + { + "statusCode": 404, + "shape": { + "type": "alias", + "value": { + "type": "id", + "id": "Pet" + } + }, + "description": "Pet not found", + "name": "dummy error" + } + ], "examples": [] } }, diff --git a/packages/parsers/src/openapi/3.1/guards/isObjectSchema.ts b/packages/parsers/src/openapi/3.1/guards/isObjectSchema.ts index bf44e07c19..044778988f 100644 --- a/packages/parsers/src/openapi/3.1/guards/isObjectSchema.ts +++ b/packages/parsers/src/openapi/3.1/guards/isObjectSchema.ts @@ -2,5 +2,5 @@ import { OpenAPIV3_1 } from "openapi-types"; import { ObjectConverterNode } from "../schemas/ObjectConverter.node"; export function isObjectSchema(input: OpenAPIV3_1.SchemaObject): input is ObjectConverterNode.Input { - return typeof input.type === "string" && input.type === "object"; + return input.type == null || (typeof input.type === "string" && input.type === "object"); } diff --git a/packages/parsers/src/openapi/3.1/paths/response/ResponsesObjectConverter.node.ts b/packages/parsers/src/openapi/3.1/paths/response/ResponsesObjectConverter.node.ts index c896ab1cf6..db81f128ba 100644 --- a/packages/parsers/src/openapi/3.1/paths/response/ResponsesObjectConverter.node.ts +++ b/packages/parsers/src/openapi/3.1/paths/response/ResponsesObjectConverter.node.ts @@ -27,11 +27,15 @@ export class ResponsesObjectConverterNode extends BaseOpenApiV3_1ConverterNode< } parse(): void { + const defaultResponse = this.input["default"]; Object.entries(this.input).forEach(([statusCode, response]) => { if (parseInt(statusCode) >= 400) { this.errorsByStatusCode ??= {}; this.errorsByStatusCode[statusCode] = new ResponseObjectConverterNode({ - input: response, + input: { + ...defaultResponse, + ...response, + }, context: this.context, accessPath: this.accessPath, pathId: "errors", @@ -39,7 +43,10 @@ export class ResponsesObjectConverterNode extends BaseOpenApiV3_1ConverterNode< } else { this.responsesByStatusCode ??= {}; this.responsesByStatusCode[statusCode] = new ResponseObjectConverterNode({ - input: response, + input: { + ...defaultResponse, + ...response, + }, context: this.context, accessPath: this.accessPath, pathId: "responses", diff --git a/packages/parsers/src/openapi/3.1/schemas/ObjectConverter.node.ts b/packages/parsers/src/openapi/3.1/schemas/ObjectConverter.node.ts index 64b2084909..e46da20cca 100644 --- a/packages/parsers/src/openapi/3.1/schemas/ObjectConverter.node.ts +++ b/packages/parsers/src/openapi/3.1/schemas/ObjectConverter.node.ts @@ -12,7 +12,7 @@ import { SchemaConverterNode } from "./SchemaConverter.node"; export declare namespace ObjectConverterNode { interface Input extends OpenAPIV3_1.NonArraySchemaObject { - type: "object"; + type?: "object"; } } diff --git a/packages/parsers/src/openapi/3.1/schemas/OneOfConverter.node.ts b/packages/parsers/src/openapi/3.1/schemas/OneOfConverter.node.ts index 1add203554..9fdde1a313 100644 --- a/packages/parsers/src/openapi/3.1/schemas/OneOfConverter.node.ts +++ b/packages/parsers/src/openapi/3.1/schemas/OneOfConverter.node.ts @@ -6,7 +6,6 @@ import { BaseOpenApiV3_1ConverterNodeConstructorArgs, } from "../../BaseOpenApiV3_1Converter.node"; import { resolveSchemaReference } from "../../utils/3.1/resolveSchemaReference"; -import { isReferenceObject } from "../guards/isReferenceObject"; import { SchemaConverterNode } from "./SchemaConverter.node"; export class OneOfConverterNode extends BaseOpenApiV3_1ConverterNode< @@ -30,13 +29,13 @@ export class OneOfConverterNode extends BaseOpenApiV3_1ConverterNode< this.discriminated = false; this.undiscriminatedMapping = this.input.oneOf ?.map((schema) => { - if (!isReferenceObject(schema) && schema.type !== "object") { - this.context.errors.error({ - message: `Expected 'oneOf' schema to be an object. Received ${schema.type}`, - path: this.accessPath, - }); - return undefined; - } + // if (!isReferenceObject(schema) && schema.type !== "object") { + // this.context.errors.error({ + // message: `Expected 'oneOf' schema to be an object. Received ${schema.type}`, + // path: this.accessPath, + // }); + // return undefined; + // } return new SchemaConverterNode({ input: schema, context: this.context, diff --git a/packages/parsers/src/openapi/3.1/schemas/SchemaConverter.node.ts b/packages/parsers/src/openapi/3.1/schemas/SchemaConverter.node.ts index d35d7086fc..4ad1469f66 100644 --- a/packages/parsers/src/openapi/3.1/schemas/SchemaConverter.node.ts +++ b/packages/parsers/src/openapi/3.1/schemas/SchemaConverter.node.ts @@ -77,6 +77,15 @@ export class SchemaConverterNode extends BaseOpenApiV3_1ConverterNode< accessPath: this.accessPath, pathId: this.pathId, }); + // here, isObjectSchema also supports null type + } else if (isObjectSchema(this.input) && this.input.allOf != null) { + // Object Converter Node encapsulates allOf logic, so we use that + this.typeShapeNode = new ObjectConverterNode({ + input: this.input, + context: this.context, + accessPath: this.accessPath, + pathId: this.pathId, + }); } else if (isNonArraySchema(this.input) && this.input.enum != null) { this.typeShapeNode = new EnumConverterNode({ input: this.input, @@ -174,7 +183,6 @@ export class SchemaConverterNode extends BaseOpenApiV3_1ConverterNode< } if (this.typeShapeNode == null) { - console.log(JSON.stringify(this.input, null, 2)); this.context.errors.error({ message: "Expected type declaration. Received: null", path: this.accessPath,