Skip to content

Commit b5f751a

Browse files
SDK regeneration (#215)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 5de8ebb commit b5f751a

File tree

122 files changed

+1100
-2268
lines changed

Some content is hidden

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

122 files changed

+1100
-2268
lines changed

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cohere-ai",
3-
"version": "7.15.1",
3+
"version": "7.15.2",
44
"private": false,
55
"repository": "https://github.com/cohere-ai/cohere-typescript",
66
"main": "./index.js",
@@ -17,9 +17,9 @@
1717
"formdata-node": "^6.0.3",
1818
"node-fetch": "2.7.0",
1919
"qs": "6.11.2",
20+
"readable-stream": "^4.5.2",
2021
"js-base64": "3.7.2",
2122
"form-data-encoder": "^4.0.2",
22-
"readable-stream": "^4.5.2",
2323
"@aws-sdk/client-sagemaker": "^3.583.0",
2424
"@aws-sdk/credential-providers": "^3.583.0",
2525
"@aws-sdk/protocol-http": "^3.374.0",
@@ -30,17 +30,16 @@
3030
"@types/url-join": "4.0.1",
3131
"@types/qs": "6.9.8",
3232
"@types/node-fetch": "2.6.9",
33-
"fetch-mock-jest": "^1.5.1",
33+
"@types/readable-stream": "^4.0.14",
34+
"webpack": "^5.91.0",
35+
"ts-loader": "^9.5.1",
3436
"jest": "^29.7.0",
3537
"@types/jest": "29.5.5",
3638
"ts-jest": "^29.1.2",
3739
"jest-environment-jsdom": "29.7.0",
3840
"@types/node": "17.0.33",
3941
"prettier": "2.7.1",
4042
"typescript": "4.6.4",
41-
"@types/readable-stream": "^4.0.14",
42-
"ts-loader": "^9.5.1",
43-
"webpack": "^5.91.0",
4443
"@types/convict": "^6.1.6"
4544
},
4645
"browser": {

reference.md

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ await client.checkApiKey();
7171
<dl>
7272
<dd>
7373

74-
Generates a text response to a user message and streams it down, token by token. To learn how to use the Chat API with streaming follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api).
74+
Generates a text response to a user message. To learn how to use the Chat API and RAG follow our [Text Generation guides](https://docs.cohere.com/v2/docs/chat-api).
7575

7676
Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2) for instructions on moving from API v1 to API v2.
7777

@@ -89,48 +89,19 @@ Follow the [Migration Guide](https://docs.cohere.com/v2/docs/migrating-v1-to-v2)
8989
<dd>
9090

9191
```typescript
92-
await client.v2.chatStream({
93-
model: "string",
92+
const response = await client.v2.chatStream({
93+
model: "model",
9494
messages: [
9595
{
96-
role: "user",
97-
content: "string",
98-
},
99-
],
100-
tools: [
101-
{
102-
type: "function",
103-
function: {
104-
name: "string",
105-
description: "string",
106-
parameters: {
107-
string: {
108-
key: "value",
109-
},
110-
},
111-
},
96+
role: "tool",
97+
toolCallId: "messages",
98+
content: "messages",
11299
},
113100
],
114-
strictTools: true,
115-
documents: ["string"],
116-
citationOptions: {
117-
mode: Cohere.CitationOptionsMode.Fast,
118-
},
119-
responseFormat: {
120-
type: "text",
121-
},
122-
safetyMode: Cohere.V2ChatStreamRequestSafetyMode.Contextual,
123-
maxTokens: 1,
124-
stopSequences: ["string"],
125-
temperature: 1.1,
126-
seed: 1,
127-
frequencyPenalty: 1.1,
128-
presencePenalty: 1.1,
129-
k: 1.1,
130-
p: 1.1,
131-
returnPrompt: true,
132-
logprobs: true,
133101
});
102+
for await (const item of response) {
103+
console.log(item);
104+
}
134105
```
135106

136107
</dd>
@@ -273,8 +244,8 @@ If you want to learn more how to use the embedding model, have a look at the [Se
273244
```typescript
274245
await client.v2.embed({
275246
model: "model",
276-
inputType: Cohere.EmbedInputType.SearchDocument,
277-
embeddingTypes: [Cohere.EmbeddingType.Float],
247+
inputType: "search_document",
248+
embeddingTypes: ["float"],
278249
});
279250
```
280251

@@ -465,7 +436,7 @@ This API launches an async Embed job for a [Dataset](https://docs.cohere.com/doc
465436
await client.embedJobs.create({
466437
model: "model",
467438
datasetId: "dataset_id",
468-
inputType: Cohere.EmbedInputType.SearchDocument,
439+
inputType: "search_document",
469440
});
470441
```
471442

@@ -722,7 +693,7 @@ Create a dataset by uploading a file. See ['Dataset Creation'](https://docs.cohe
722693
```typescript
723694
await client.datasets.create(fs.createReadStream("/path/to/your/file"), fs.createReadStream("/path/to/your/file"), {
724695
name: "name",
725-
type: Cohere.DatasetType.EmbedInput,
696+
type: "embed-input",
726697
});
727698
```
728699

@@ -1549,7 +1520,7 @@ await client.finetuning.createFinetunedModel({
15491520
name: "api-test",
15501521
settings: {
15511522
baseModel: {
1552-
baseType: Cohere.BaseType.BaseTypeChat,
1523+
baseType: "BASE_TYPE_CHAT",
15531524
},
15541525
datasetId: "my-dataset-id",
15551526
},
@@ -1701,7 +1672,7 @@ await client.finetuning.updateFinetunedModel("id", {
17011672
name: "name",
17021673
settings: {
17031674
baseModel: {
1704-
baseType: Cohere.BaseType.BaseTypeUnspecified,
1675+
baseType: "BASE_TYPE_UNSPECIFIED",
17051676
},
17061677
datasetId: "dataset_id",
17071678
},

0 commit comments

Comments
 (0)