Skip to content

Commit

Permalink
SDK regeneration (#215)
Browse files Browse the repository at this point in the history
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
  • Loading branch information
fern-api[bot] authored Jan 6, 2025
1 parent 5de8ebb commit b5f751a
Show file tree
Hide file tree
Showing 122 changed files with 1,100 additions and 2,268 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cohere-ai",
"version": "7.15.1",
"version": "7.15.2",
"private": false,
"repository": "https://github.com/cohere-ai/cohere-typescript",
"main": "./index.js",
Expand All @@ -17,9 +17,9 @@
"formdata-node": "^6.0.3",
"node-fetch": "2.7.0",
"qs": "6.11.2",
"readable-stream": "^4.5.2",
"js-base64": "3.7.2",
"form-data-encoder": "^4.0.2",
"readable-stream": "^4.5.2",
"@aws-sdk/client-sagemaker": "^3.583.0",
"@aws-sdk/credential-providers": "^3.583.0",
"@aws-sdk/protocol-http": "^3.374.0",
Expand All @@ -30,17 +30,16 @@
"@types/url-join": "4.0.1",
"@types/qs": "6.9.8",
"@types/node-fetch": "2.6.9",
"fetch-mock-jest": "^1.5.1",
"@types/readable-stream": "^4.0.14",
"webpack": "^5.91.0",
"ts-loader": "^9.5.1",
"jest": "^29.7.0",
"@types/jest": "29.5.5",
"ts-jest": "^29.1.2",
"jest-environment-jsdom": "29.7.0",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4",
"@types/readable-stream": "^4.0.14",
"ts-loader": "^9.5.1",
"webpack": "^5.91.0",
"@types/convict": "^6.1.6"
},
"browser": {
Expand Down
59 changes: 15 additions & 44 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ await client.checkApiKey();
<dl>
<dd>

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).
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).

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

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

```typescript
await client.v2.chatStream({
model: "string",
const response = await client.v2.chatStream({
model: "model",
messages: [
{
role: "user",
content: "string",
},
],
tools: [
{
type: "function",
function: {
name: "string",
description: "string",
parameters: {
string: {
key: "value",
},
},
},
role: "tool",
toolCallId: "messages",
content: "messages",
},
],
strictTools: true,
documents: ["string"],
citationOptions: {
mode: Cohere.CitationOptionsMode.Fast,
},
responseFormat: {
type: "text",
},
safetyMode: Cohere.V2ChatStreamRequestSafetyMode.Contextual,
maxTokens: 1,
stopSequences: ["string"],
temperature: 1.1,
seed: 1,
frequencyPenalty: 1.1,
presencePenalty: 1.1,
k: 1.1,
p: 1.1,
returnPrompt: true,
logprobs: true,
});
for await (const item of response) {
console.log(item);
}
```

</dd>
Expand Down Expand Up @@ -273,8 +244,8 @@ If you want to learn more how to use the embedding model, have a look at the [Se
```typescript
await client.v2.embed({
model: "model",
inputType: Cohere.EmbedInputType.SearchDocument,
embeddingTypes: [Cohere.EmbeddingType.Float],
inputType: "search_document",
embeddingTypes: ["float"],
});
```

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

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

Expand Down Expand Up @@ -1549,7 +1520,7 @@ await client.finetuning.createFinetunedModel({
name: "api-test",
settings: {
baseModel: {
baseType: Cohere.BaseType.BaseTypeChat,
baseType: "BASE_TYPE_CHAT",
},
datasetId: "my-dataset-id",
},
Expand Down Expand Up @@ -1701,7 +1672,7 @@ await client.finetuning.updateFinetunedModel("id", {
name: "name",
settings: {
baseModel: {
baseType: Cohere.BaseType.BaseTypeUnspecified,
baseType: "BASE_TYPE_UNSPECIFIED",
},
datasetId: "dataset_id",
},
Expand Down
Loading

0 comments on commit b5f751a

Please sign in to comment.