@ai-sdk/cohere 3.0.7 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -4
- package/src/__snapshots__/cohere-embedding-model.test.ts.snap +41 -0
- package/src/cohere-chat-language-model.test.ts +1591 -0
- package/src/cohere-chat-language-model.ts +607 -0
- package/src/cohere-chat-options.ts +36 -0
- package/src/cohere-chat-prompt.ts +41 -0
- package/src/cohere-embedding-model.test.ts +143 -0
- package/src/cohere-embedding-model.ts +112 -0
- package/src/cohere-embedding-options.ts +37 -0
- package/src/cohere-error.ts +13 -0
- package/src/cohere-prepare-tools.test.ts +152 -0
- package/src/cohere-prepare-tools.ts +96 -0
- package/src/cohere-provider.ts +169 -0
- package/src/convert-cohere-usage.ts +45 -0
- package/src/convert-to-cohere-chat-prompt.test.ts +175 -0
- package/src/convert-to-cohere-chat-prompt.ts +156 -0
- package/src/index.ts +5 -0
- package/src/map-cohere-finish-reason.ts +23 -0
- package/src/reranking/__fixtures__/cohere-reranking.1.json +21 -0
- package/src/reranking/cohere-reranking-api.ts +27 -0
- package/src/reranking/cohere-reranking-model.test.ts +243 -0
- package/src/reranking/cohere-reranking-model.ts +107 -0
- package/src/reranking/cohere-reranking-options.ts +35 -0
- package/src/version.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @ai-sdk/cohere
|
|
2
2
|
|
|
3
|
+
## 3.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8dc54db: chore: add src folders to package bundle
|
|
8
|
+
|
|
9
|
+
## 3.0.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [5c090e7]
|
|
14
|
+
- @ai-sdk/provider@3.0.4
|
|
15
|
+
- @ai-sdk/provider-utils@4.0.8
|
|
16
|
+
|
|
3
17
|
## 3.0.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/cohere",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist/**/*",
|
|
11
|
+
"src",
|
|
11
12
|
"CHANGELOG.md",
|
|
12
13
|
"README.md"
|
|
13
14
|
],
|
|
@@ -20,15 +21,15 @@
|
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@ai-sdk/provider": "3.0.
|
|
24
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
24
|
+
"@ai-sdk/provider": "3.0.4",
|
|
25
|
+
"@ai-sdk/provider-utils": "4.0.8"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@types/node": "20.17.24",
|
|
28
29
|
"tsup": "^8",
|
|
29
30
|
"typescript": "5.8.3",
|
|
30
31
|
"zod": "3.25.76",
|
|
31
|
-
"@ai-sdk/test-server": "1.0.
|
|
32
|
+
"@ai-sdk/test-server": "1.0.2",
|
|
32
33
|
"@vercel/ai-tsconfig": "0.0.0"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`doEmbed > should expose the raw response 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"body": {
|
|
6
|
+
"embeddings": {
|
|
7
|
+
"float": [
|
|
8
|
+
[
|
|
9
|
+
0.1,
|
|
10
|
+
0.2,
|
|
11
|
+
0.3,
|
|
12
|
+
0.4,
|
|
13
|
+
0.5,
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
0.6,
|
|
17
|
+
0.7,
|
|
18
|
+
0.8,
|
|
19
|
+
0.9,
|
|
20
|
+
1,
|
|
21
|
+
],
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
"id": "test-id",
|
|
25
|
+
"meta": {
|
|
26
|
+
"billed_units": {
|
|
27
|
+
"input_tokens": 8,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
"texts": [
|
|
31
|
+
"sunny day at the beach",
|
|
32
|
+
"rainy day in the city",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
"headers": {
|
|
36
|
+
"content-length": "185",
|
|
37
|
+
"content-type": "application/json",
|
|
38
|
+
"test-header": "test-value",
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
`;
|