You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -167,12 +166,11 @@ Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2)
167
166
168
167
```typescript
169
168
awaitclient.v2.chat({
170
-
model: "model",
169
+
model: "command-a-03-2025",
171
170
messages: [
172
171
{
173
-
role: "tool",
174
-
toolCallId: "messages",
175
-
content: "messages",
172
+
role: "user",
173
+
content: "Tell me about LLMs",
176
174
},
177
175
],
178
176
});
@@ -243,8 +241,9 @@ If you want to learn more how to use the embedding model, have a look at the [Se
243
241
244
242
```typescript
245
243
awaitclient.v2.embed({
246
-
model: "model",
247
-
inputType: "search_document",
244
+
texts: ["hello", "goodbye"],
245
+
model: "embed-v4.0",
246
+
inputType: "classification",
248
247
embeddingTypes: ["float"],
249
248
});
250
249
```
@@ -310,9 +309,16 @@ This endpoint takes in a query and a list of texts and produces an ordered array
310
309
311
310
```typescript
312
311
awaitclient.v2.rerank({
313
-
model: "model",
314
-
query: "query",
315
-
documents: ["documents"],
312
+
documents: [
313
+
"Carson City is the capital city of the American state of Nevada.",
314
+
"The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.",
315
+
"Capitalization or capitalisation in English grammar is the use of a capital letter at the start of a word. English usage varies from capitalization in other languages.",
316
+
"Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.",
317
+
"Capital punishment has existed in the United States since beforethe United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states.",
318
+
],
319
+
query: "What is the capital of the United States?",
Copy file name to clipboardExpand all lines: src/api/client/requests/ChatRequest.ts
+52-15Lines changed: 52 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,61 @@ import * as Cohere from "../../index";
7
7
/**
8
8
* @example
9
9
* {
10
-
* message: "Can you give me a global market overview of solar panels?",
11
10
* chatHistory: [{
12
-
* role: "TOOL"
11
+
* role: "USER",
12
+
* message: "Who discovered gravity?"
13
13
* }, {
14
-
* role: "TOOL"
14
+
* role: "CHATBOT",
15
+
* message: "The man who is widely credited with discovering gravity is Sir Isaac Newton"
15
16
* }],
16
-
* promptTruncation: "OFF",
17
-
* temperature: 0.3
17
+
* message: "What year was he born?",
18
+
* connectors: [{
19
+
* id: "web-search"
20
+
* }]
21
+
* }
22
+
*
23
+
* @example
24
+
* {
25
+
* message: "Who is more popular: Nsync or Backstreet Boys?",
26
+
* documents: [{
27
+
* "title": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters",
28
+
* "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: Backstreet Boys Popularity Analysis\n\nHern\u00E1n Lopez Posted on February 9, 2017 Posted in CSPC 72 Comments Tagged with Backstreet Boys, Boy band\n\nAt one point, Backstreet Boys defined success: massive albums sales across the globe, great singles sales, plenty of chart topping releases, hugely hyped tours and tremendous media coverage.\n\nIt is true that they benefited from extraordinarily good market conditions in all markets. After all, the all-time record year for the music business, as far as revenues in billion dollars are concerned, was actually 1999. That is, back when this five men group was at its peak."
* "snippet": "\u2193 Skip to Main Content\n\nMusic industry \u2013 One step closer to being accurate\n\nCSPC: NSYNC Popularity Analysis\n\nMJD Posted on February 9, 2018 Posted in CSPC 27 Comments Tagged with Boy band, N'Sync\n\nAt the turn of the millennium three teen acts were huge in the US, the Backstreet Boys, Britney Spears and NSYNC. The latter is the only one we haven\u2019t study so far. It took 15 years and Adele to break their record of 2,4 million units sold of No Strings Attached in its first week alone.\n\nIt wasn\u2019t a fluke, as the second fastest selling album of the Soundscan era prior 2015, was also theirs since Celebrity debuted with 1,88 million units sold."
32
+
* }, {
33
+
* "title": "CSPC: Backstreet Boys Popularity Analysis - ChartMasters",
34
+
* "snippet": "1997, 1998, 2000 and 2001 also rank amongst some of the very best years.\nYet the way many music consumers \u2013 especially teenagers and young women\u2019s \u2013 embraced their output deserves its own chapter. If Jonas Brothers and more recently One Direction reached a great level of popularity during the past decade, the type of success achieved by Backstreet Boys is in a completely different level as they really dominated the business for a few years all over the world, including in some countries that were traditionally hard to penetrate for Western artists.\n\nWe will try to analyze the extent of that hegemony with this new article with final results which will more than surprise many readers."
* "snippet": "Was the teen group led by Justin Timberlake really that big? Was it only in the US where they found success? Or were they a global phenomenon?\nAs usual, I\u2019ll be using the Commensurate Sales to Popularity Concept in order to relevantly gauge their results. This concept will not only bring you sales information for all NSYNC\u2018s albums, physical and download singles, as well as audio and video streaming, but it will also determine their true popularity. If you are not yet familiar with the CSPC method, the next page explains it with a short video. I fully recommend watching the video before getting into the sales figures."
38
+
* }]
39
+
* }
40
+
*
41
+
* @example
42
+
* {
43
+
* 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?",
44
+
* tools: [{
45
+
* name: "query_daily_sales_report",
46
+
* description: "Connects to a database to retrieve overall sales volumes and sales information for a given day.",
47
+
* parameterDefinitions: {
48
+
* "day": {
49
+
* description: "Retrieves sales data for this day, formatted as YYYY-MM-DD.",
50
+
* type: "str",
51
+
* required: true
52
+
* }
53
+
* }
54
+
* }, {
55
+
* name: "query_product_catalog",
56
+
* description: "Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.",
57
+
* parameterDefinitions: {
58
+
* "category": {
59
+
* description: "Retrieves product information data for all products in this category.",
0 commit comments