Skip to content

Commit 4d33e2b

Browse files
🌿 Fern Regeneration -- August 30, 2024 (#199)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 3cfb4bc commit 4d33e2b

File tree

84 files changed

+997
-820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+997
-820
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cohere-ai",
3-
"version": "7.12.1",
3+
"version": "7.13.0",
44
"private": false,
55
"repository": "https://github.com/cohere-ai/cohere-typescript",
66
"main": "./index.js",

reference.md

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ await client.checkApiKey();
6363
<dl>
6464
<dd>
6565

66+
#### 📝 Description
67+
68+
<dl>
69+
<dd>
70+
71+
<dl>
72+
<dd>
73+
74+
Generates a message from the model in response to a provided conversation. To learn how to use the Chat API with Streaming and RAG follow our Text Generation guides.
75+
76+
</dd>
77+
</dl>
78+
</dd>
79+
</dl>
80+
6681
#### 🔌 Usage
6782

6883
<dl>
@@ -76,41 +91,15 @@ await client.v2.chatStream({
7691
model: "string",
7792
messages: [
7893
{
79-
role: "assistant",
80-
toolCalls: [
94+
role: "user",
95+
content: "string",
96+
documents: [
8197
{
82-
id: "string",
83-
type: "function",
84-
function: {
85-
name: "string",
86-
arguments: "string",
98+
string: {
99+
key: "value",
87100
},
88101
},
89102
],
90-
toolPlan: "string",
91-
content: [
92-
{
93-
text: "string",
94-
},
95-
],
96-
citations: [
97-
{
98-
start: 1,
99-
end: 1,
100-
text: "string",
101-
sources: [
102-
{
103-
type: "tool",
104-
id: "string",
105-
toolOutput: {
106-
string: {
107-
key: "value",
108-
},
109-
},
110-
},
111-
],
112-
},
113-
],
114103
},
115104
],
116105
tools: [
@@ -127,26 +116,18 @@ await client.v2.chatStream({
127116
},
128117
},
129118
],
130-
toolChoice: Cohere.V2ChatStreamRequestToolChoice.Auto,
131119
citationMode: Cohere.V2ChatStreamRequestCitationMode.Fast,
132-
truncationMode: Cohere.V2ChatStreamRequestTruncationMode.Off,
133120
responseFormat: {
134-
type: "json_object",
135-
schema: {
136-
string: {
137-
key: "value",
138-
},
139-
},
121+
type: "text",
140122
},
141123
maxTokens: 1,
142124
stopSequences: ["string"],
143-
maxInputTokens: 1,
144125
temperature: 1.1,
145126
seed: 1,
146127
frequencyPenalty: 1.1,
147128
presencePenalty: 1.1,
148-
k: 1,
149-
p: 1,
129+
k: 1.1,
130+
p: 1.1,
150131
returnPrompt: true,
151132
});
152133
```
@@ -187,6 +168,21 @@ await client.v2.chatStream({
187168
<dl>
188169
<dd>
189170

171+
#### 📝 Description
172+
173+
<dl>
174+
<dd>
175+
176+
<dl>
177+
<dd>
178+
179+
Generates a message from the model in response to a provided conversation. To learn how to use the Chat API with Streaming and RAG follow our Text Generation guides.
180+
181+
</dd>
182+
</dl>
183+
</dd>
184+
</dl>
185+
190186
#### 🔌 Usage
191187

192188
<dl>

src/Client.ts

Lines changed: 38 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ export class CohereClient {
6262
: undefined,
6363
"X-Fern-Language": "JavaScript",
6464
"X-Fern-SDK-Name": "cohere-ai",
65-
"X-Fern-SDK-Version": "7.12.1",
66-
"User-Agent": "cohere-ai/7.12.1",
65+
"X-Fern-SDK-Version": "7.13.0",
66+
"User-Agent": "cohere-ai/7.13.0",
6767
"X-Fern-Runtime": core.RUNTIME.type,
6868
"X-Fern-Runtime-Version": core.RUNTIME.version,
6969
},
@@ -233,8 +233,8 @@ export class CohereClient {
233233
: undefined,
234234
"X-Fern-Language": "JavaScript",
235235
"X-Fern-SDK-Name": "cohere-ai",
236-
"X-Fern-SDK-Version": "7.12.1",
237-
"User-Agent": "cohere-ai/7.12.1",
236+
"X-Fern-SDK-Version": "7.13.0",
237+
"User-Agent": "cohere-ai/7.13.0",
238238
"X-Fern-Runtime": core.RUNTIME.type,
239239
"X-Fern-Runtime-Version": core.RUNTIME.version,
240240
},
@@ -350,10 +350,9 @@ export class CohereClient {
350350
}
351351

352352
/**
353-
* > 🚧 Warning
354-
* >
355-
* > This API is marked as "Legacy" and is no longer maintained. Follow the [migration guide](/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.
356-
*
353+
* <Warning>
354+
* This API is marked as "Legacy" and is no longer maintained. Follow the [migration guide](/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.
355+
* </Warning>
357356
* Generates realistic text conditioned on a given input.
358357
*/
359358
public async generateStream(
@@ -374,8 +373,8 @@ export class CohereClient {
374373
: undefined,
375374
"X-Fern-Language": "JavaScript",
376375
"X-Fern-SDK-Name": "cohere-ai",
377-
"X-Fern-SDK-Version": "7.12.1",
378-
"User-Agent": "cohere-ai/7.12.1",
376+
"X-Fern-SDK-Version": "7.13.0",
377+
"User-Agent": "cohere-ai/7.13.0",
379378
"X-Fern-Runtime": core.RUNTIME.type,
380379
"X-Fern-Runtime-Version": core.RUNTIME.version,
381380
},
@@ -502,10 +501,9 @@ export class CohereClient {
502501
}
503502

504503
/**
505-
* > 🚧 Warning
506-
* >
507-
* > This API is marked as "Legacy" and is no longer maintained. Follow the [migration guide](/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.
508-
*
504+
* <Warning>
505+
* This API is marked as "Legacy" and is no longer maintained. Follow the [migration guide](/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.
506+
* </Warning>
509507
* Generates realistic text conditioned on a given input.
510508
*
511509
* @param {Cohere.GenerateRequest} request
@@ -546,8 +544,8 @@ export class CohereClient {
546544
: undefined,
547545
"X-Fern-Language": "JavaScript",
548546
"X-Fern-SDK-Name": "cohere-ai",
549-
"X-Fern-SDK-Version": "7.12.1",
550-
"User-Agent": "cohere-ai/7.12.1",
547+
"X-Fern-SDK-Version": "7.13.0",
548+
"User-Agent": "cohere-ai/7.13.0",
551549
"X-Fern-Runtime": core.RUNTIME.type,
552550
"X-Fern-Runtime-Version": core.RUNTIME.version,
553551
},
@@ -687,6 +685,7 @@ export class CohereClient {
687685
* @example
688686
* await client.embed({
689687
* texts: ["string"],
688+
* images: ["string"],
690689
* model: "string",
691690
* inputType: Cohere.EmbedInputType.SearchDocument,
692691
* embeddingTypes: [Cohere.EmbeddingType.Float],
@@ -711,8 +710,8 @@ export class CohereClient {
711710
: undefined,
712711
"X-Fern-Language": "JavaScript",
713712
"X-Fern-SDK-Name": "cohere-ai",
714-
"X-Fern-SDK-Version": "7.12.1",
715-
"User-Agent": "cohere-ai/7.12.1",
713+
"X-Fern-SDK-Version": "7.13.0",
714+
"User-Agent": "cohere-ai/7.13.0",
716715
"X-Fern-Runtime": core.RUNTIME.type,
717716
"X-Fern-Runtime-Version": core.RUNTIME.version,
718717
},
@@ -844,9 +843,8 @@ export class CohereClient {
844843
*
845844
* @example
846845
* await client.rerank({
847-
* model: "rerank-english-v3.0",
848-
* query: "What is the capital of the United States?",
849-
* documents: ["Carson City is the capital city of the American state of Nevada.", "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.", "Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.", "Capital punishment (the death penalty) 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."]
846+
* query: "query",
847+
* documents: ["documents"]
850848
* })
851849
*/
852850
public async rerank(
@@ -867,8 +865,8 @@ export class CohereClient {
867865
: undefined,
868866
"X-Fern-Language": "JavaScript",
869867
"X-Fern-SDK-Name": "cohere-ai",
870-
"X-Fern-SDK-Version": "7.12.1",
871-
"User-Agent": "cohere-ai/7.12.1",
868+
"X-Fern-SDK-Version": "7.13.0",
869+
"User-Agent": "cohere-ai/7.13.0",
872870
"X-Fern-Runtime": core.RUNTIME.type,
873871
"X-Fern-Runtime-Version": core.RUNTIME.version,
874872
},
@@ -1001,38 +999,7 @@ export class CohereClient {
1001999
*
10021000
* @example
10031001
* await client.classify({
1004-
* inputs: ["Confirm your email address", "hey i need u to send some $"],
1005-
* examples: [{
1006-
* text: "Dermatologists don't like her!",
1007-
* label: "Spam"
1008-
* }, {
1009-
* text: "Hello, open to this?",
1010-
* label: "Spam"
1011-
* }, {
1012-
* text: "I need help please wire me $1000 right now",
1013-
* label: "Spam"
1014-
* }, {
1015-
* text: "Nice to know you ;)",
1016-
* label: "Spam"
1017-
* }, {
1018-
* text: "Please help me?",
1019-
* label: "Spam"
1020-
* }, {
1021-
* text: "Your parcel will be delivered today",
1022-
* label: "Not spam"
1023-
* }, {
1024-
* text: "Review changes to our Terms and Conditions",
1025-
* label: "Not spam"
1026-
* }, {
1027-
* text: "Weekly sync notes",
1028-
* label: "Not spam"
1029-
* }, {
1030-
* text: "Re: Follow up from today\u2019s meeting",
1031-
* label: "Not spam"
1032-
* }, {
1033-
* text: "Pre-read for tomorrow",
1034-
* label: "Not spam"
1035-
* }]
1002+
* inputs: ["inputs"]
10361003
* })
10371004
*/
10381005
public async classify(
@@ -1053,8 +1020,8 @@ export class CohereClient {
10531020
: undefined,
10541021
"X-Fern-Language": "JavaScript",
10551022
"X-Fern-SDK-Name": "cohere-ai",
1056-
"X-Fern-SDK-Version": "7.12.1",
1057-
"User-Agent": "cohere-ai/7.12.1",
1023+
"X-Fern-SDK-Version": "7.13.0",
1024+
"User-Agent": "cohere-ai/7.13.0",
10581025
"X-Fern-Runtime": core.RUNTIME.type,
10591026
"X-Fern-Runtime-Version": core.RUNTIME.version,
10601027
},
@@ -1167,10 +1134,9 @@ export class CohereClient {
11671134
}
11681135

11691136
/**
1170-
* > 🚧 Warning
1171-
* >
1172-
* > This API is marked as "Legacy" and is no longer maintained. Follow the [migration guide](/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.
1173-
*
1137+
* <Warning>
1138+
* This API is marked as "Legacy" and is no longer maintained. Follow the [migration guide](/docs/migrating-from-cogenerate-to-cochat) to start using the Chat API.
1139+
* </Warning>
11741140
* Generates a summary in English for a given text.
11751141
*
11761142
* @param {Cohere.SummarizeRequest} request
@@ -1190,7 +1156,7 @@ export class CohereClient {
11901156
*
11911157
* @example
11921158
* await client.summarize({
1193-
* text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. It may be made from milk or cream and is flavoured with a sweetener, either sugar or an alternative, and a spice, such as cocoa or vanilla, or with fruit such as strawberries or peaches. It can also be made by whisking a flavored cream base and liquid nitrogen together. Food coloring is sometimes added, in addition to stabilizers. The mixture is cooled below the freezing point of water and stirred to incorporate air spaces and to prevent detectable ice crystals from forming. The result is a smooth, semi-solid foam that is solid at very low temperatures (below 2 \u00B0C or 35 \u00B0F). It becomes more malleable as its temperature increases.\n\nThe meaning of the name \"ice cream\" varies from one country to another. In some countries, such as the United States, \"ice cream\" applies only to a specific variety, and most governments regulate the commercial use of the various terms according to the relative quantities of the main ingredients, notably the amount of cream. Products that do not meet the criteria to be called ice cream are sometimes labelled \"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, one word is used fo\r all variants. Analogues made from dairy alternatives, such as goat's or sheep's milk, or milk substitutes (e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are lactose intolerant, allergic to dairy protein or vegan."
1159+
* text: "text"
11941160
* })
11951161
*/
11961162
public async summarize(
@@ -1211,8 +1177,8 @@ export class CohereClient {
12111177
: undefined,
12121178
"X-Fern-Language": "JavaScript",
12131179
"X-Fern-SDK-Name": "cohere-ai",
1214-
"X-Fern-SDK-Version": "7.12.1",
1215-
"User-Agent": "cohere-ai/7.12.1",
1180+
"X-Fern-SDK-Version": "7.13.0",
1181+
"User-Agent": "cohere-ai/7.13.0",
12161182
"X-Fern-Runtime": core.RUNTIME.type,
12171183
"X-Fern-Runtime-Version": core.RUNTIME.version,
12181184
},
@@ -1366,8 +1332,8 @@ export class CohereClient {
13661332
: undefined,
13671333
"X-Fern-Language": "JavaScript",
13681334
"X-Fern-SDK-Name": "cohere-ai",
1369-
"X-Fern-SDK-Version": "7.12.1",
1370-
"User-Agent": "cohere-ai/7.12.1",
1335+
"X-Fern-SDK-Version": "7.13.0",
1336+
"User-Agent": "cohere-ai/7.13.0",
13711337
"X-Fern-Runtime": core.RUNTIME.type,
13721338
"X-Fern-Runtime-Version": core.RUNTIME.version,
13731339
},
@@ -1499,8 +1465,8 @@ export class CohereClient {
14991465
*
15001466
* @example
15011467
* await client.detokenize({
1502-
* tokens: [10104, 12221, 1315, 34, 1420, 69],
1503-
* model: "command"
1468+
* tokens: [1],
1469+
* model: "model"
15041470
* })
15051471
*/
15061472
public async detokenize(
@@ -1521,8 +1487,8 @@ export class CohereClient {
15211487
: undefined,
15221488
"X-Fern-Language": "JavaScript",
15231489
"X-Fern-SDK-Name": "cohere-ai",
1524-
"X-Fern-SDK-Version": "7.12.1",
1525-
"User-Agent": "cohere-ai/7.12.1",
1490+
"X-Fern-SDK-Version": "7.13.0",
1491+
"User-Agent": "cohere-ai/7.13.0",
15261492
"X-Fern-Runtime": core.RUNTIME.type,
15271493
"X-Fern-Runtime-Version": core.RUNTIME.version,
15281494
},
@@ -1669,8 +1635,8 @@ export class CohereClient {
16691635
: undefined,
16701636
"X-Fern-Language": "JavaScript",
16711637
"X-Fern-SDK-Name": "cohere-ai",
1672-
"X-Fern-SDK-Version": "7.12.1",
1673-
"User-Agent": "cohere-ai/7.12.1",
1638+
"X-Fern-SDK-Version": "7.13.0",
1639+
"User-Agent": "cohere-ai/7.13.0",
16741640
"X-Fern-Runtime": core.RUNTIME.type,
16751641
"X-Fern-Runtime-Version": core.RUNTIME.version,
16761642
},

0 commit comments

Comments
 (0)