Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cohere-ai",
"version": "7.19.0",
"version": "7.20.0",
"private": false,
"repository": "https://github.com/cohere-ai/cohere-typescript",
"main": "./index.js",
Expand Down
6 changes: 3 additions & 3 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2)

```typescript
const response = await client.v2.chatStream({
model: "command-r",
model: "command-a-03-2025",
messages: [
{
role: "user",
content: "Hello!",
content: "Tell me about LLMs",
},
],
});
Expand Down Expand Up @@ -1408,7 +1408,7 @@ await client.models.get("command-a-03-2025");
<dl>
<dd>

Returns a list of models available for use. The list contains models from Cohere as well as your fine-tuned models.
Returns a list of models available for use.

</dd>
</dl>
Expand Down
59 changes: 26 additions & 33 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
Accepts: accepts != null ? accepts : undefined,
Expand Down Expand Up @@ -227,21 +227,13 @@ export class CohereClient {
*
* @example
* await client.chat({
* chatHistory: [{
* role: "USER",
* message: "Who discovered gravity?"
* }, {
* role: "CHATBOT",
* message: "The man who is widely credited with discovering gravity is Sir Isaac Newton"
* }],
* message: "What year was he born?",
* connectors: [{
* id: "web-search"
* }]
* model: "command-a-03-2025",
* message: "Tell me about LLMs"
* })
*
* @example
* await client.chat({
* model: "command-a-03-2025",
* message: "Who is more popular: Nsync or Backstreet Boys?",
* documents: [{
* "title": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters",
Expand All @@ -260,6 +252,7 @@ export class CohereClient {
*
* @example
* await client.chat({
* model: "command-a-03-2025",
* message: "Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?",
* tools: [{
* name: "query_daily_sales_report",
Expand Down Expand Up @@ -312,8 +305,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
Accepts: accepts != null ? accepts : undefined,
Expand Down Expand Up @@ -431,8 +424,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -581,8 +574,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -731,8 +724,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -877,8 +870,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -1043,8 +1036,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -1179,8 +1172,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -1313,8 +1306,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -1447,8 +1440,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -1575,8 +1568,8 @@ export class CohereClient {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down
20 changes: 6 additions & 14 deletions src/api/client/requests/ChatRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@ import * as Cohere from "../../index";
/**
* @example
* {
* chatHistory: [{
* role: "USER",
* message: "Who discovered gravity?"
* }, {
* role: "CHATBOT",
* message: "The man who is widely credited with discovering gravity is Sir Isaac Newton"
* }],
* message: "What year was he born?",
* connectors: [{
* id: "web-search"
* }]
* model: "command-a-03-2025",
* message: "Tell me about LLMs"
* }
*
* @example
* {
* model: "command-a-03-2025",
* message: "Who is more popular: Nsync or Backstreet Boys?",
* documents: [{
* "title": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters",
Expand All @@ -40,6 +32,7 @@ import * as Cohere from "../../index";
*
* @example
* {
* model: "command-a-03-2025",
* message: "Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?",
* tools: [{
* name: "query_daily_sales_report",
Expand Down Expand Up @@ -164,9 +157,8 @@ export interface ChatRequest {
*/
documents?: Cohere.ChatDocument[];
/**
* Defaults to `"accurate"`.
*
* Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results.
* Defaults to `"enabled"`.
* Citations are enabled by default for models that support it, but can be turned off by setting `"type": "disabled"`.
*
* Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
*/
Expand Down
8 changes: 4 additions & 4 deletions src/api/client/requests/ChatStreamRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import * as Cohere from "../../index";
/**
* @example
* {
* message: "hello world!"
* model: "command-a-03-2025",
* message: "hello!"
* }
*/
export interface ChatStreamRequest {
Expand Down Expand Up @@ -110,9 +111,8 @@ export interface ChatStreamRequest {
*/
documents?: Cohere.ChatDocument[];
/**
* Defaults to `"accurate"`.
*
* Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want `"accurate"` results, `"fast"` results or no results.
* Defaults to `"enabled"`.
* Citations are enabled by default for models that support it, but can be turned off by setting `"type": "disabled"`.
*
* Compatible Deployments: Cohere Platform, Azure, AWS Sagemaker/Bedrock, Private Deployments
*/
Expand Down
2 changes: 1 addition & 1 deletion src/api/client/requests/EmbedRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface EmbedRequest {
/**
* An array of image data URIs for the model to embed. Maximum number of images per call is `1`.
*
* The 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.
* The 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`, `image/png`, `image/webp`, or `image/gif` format and has a maximum size of 5MB.
*
* Images are only supported with Embed v3.0 and newer models.
*/
Expand Down
24 changes: 12 additions & 12 deletions src/api/resources/connectors/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -226,8 +226,8 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -357,8 +357,8 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -483,8 +483,8 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -612,8 +612,8 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -752,8 +752,8 @@ export class Connectors {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down
20 changes: 10 additions & 10 deletions src/api/resources/datasets/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -300,8 +300,8 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
..._maybeEncodedRequest.headers,
Expand Down Expand Up @@ -426,8 +426,8 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -552,8 +552,8 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down Expand Up @@ -678,8 +678,8 @@ export class Datasets {
: undefined,
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "cohere-ai",
"X-Fern-SDK-Version": "7.19.0",
"User-Agent": "cohere-ai/7.19.0",
"X-Fern-SDK-Version": "7.20.0",
"User-Agent": "cohere-ai/7.20.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
...requestOptions?.headers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface DatasetsCreateRequest {
*/
name: string;
/**
* 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`.
* The dataset type, which is used to validate the data. The only valid type is `embed-input` used in conjunction with the Embed Jobs API.
*/
type: Cohere.DatasetType;
/**
Expand Down
Loading
Loading