@ai-sdk/cohere 1.2.9 → 2.0.0-alpha.1

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 CHANGED
@@ -1,41 +1,217 @@
1
1
  # @ai-sdk/cohere
2
2
 
3
- ## 1.2.9
3
+ ## 2.0.0-alpha.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 033f445: fix (provider/cohere): tool calling
7
+ - Updated dependencies [3f2f00c]
8
+ - @ai-sdk/provider@2.0.0-alpha.1
9
+ - @ai-sdk/provider-utils@3.0.0-alpha.1
8
10
 
9
- ## 1.2.8
11
+ ## 2.0.0-canary.20
10
12
 
11
13
  ### Patch Changes
12
14
 
13
- - Updated dependencies [beef951]
14
- - @ai-sdk/provider@1.1.3
15
- - @ai-sdk/provider-utils@2.2.7
15
+ - Updated dependencies [faf8446]
16
+ - @ai-sdk/provider-utils@3.0.0-canary.19
16
17
 
17
- ## 1.2.7
18
+ ## 2.0.0-canary.19
18
19
 
19
20
  ### Patch Changes
20
21
 
21
- - Updated dependencies [013faa8]
22
- - @ai-sdk/provider@1.1.2
23
- - @ai-sdk/provider-utils@2.2.6
22
+ - Updated dependencies [40acf9b]
23
+ - @ai-sdk/provider-utils@3.0.0-canary.18
24
24
 
25
- ## 1.2.6
25
+ ## 2.0.0-canary.18
26
26
 
27
27
  ### Patch Changes
28
28
 
29
- - Updated dependencies [c21fa6d]
30
- - @ai-sdk/provider-utils@2.2.5
31
- - @ai-sdk/provider@1.1.1
29
+ - Updated dependencies [ea7a7c9]
30
+ - @ai-sdk/provider-utils@3.0.0-canary.17
32
31
 
33
- ## 1.2.5
32
+ ## 2.0.0-canary.17
34
33
 
35
34
  ### Patch Changes
36
35
 
37
- - Updated dependencies [2c19b9a]
38
- - @ai-sdk/provider-utils@2.2.4
36
+ - Updated dependencies [87b828f]
37
+ - @ai-sdk/provider-utils@3.0.0-canary.16
38
+
39
+ ## 2.0.0-canary.16
40
+
41
+ ### Patch Changes
42
+
43
+ - 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions
44
+ - Updated dependencies [a571d6e]
45
+ - Updated dependencies [a8c8bd5]
46
+ - Updated dependencies [7979f7f]
47
+ - Updated dependencies [41fa418]
48
+ - @ai-sdk/provider-utils@3.0.0-canary.15
49
+ - @ai-sdk/provider@2.0.0-canary.14
50
+
51
+ ## 2.0.0-canary.15
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [957b739]
56
+ - Updated dependencies [9bd5ab5]
57
+ - @ai-sdk/provider-utils@3.0.0-canary.14
58
+ - @ai-sdk/provider@2.0.0-canary.13
59
+
60
+ ## 2.0.0-canary.14
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [7b3ae3f]
65
+ - Updated dependencies [0ff02bb]
66
+ - @ai-sdk/provider@2.0.0-canary.12
67
+ - @ai-sdk/provider-utils@3.0.0-canary.13
68
+
69
+ ## 2.0.0-canary.13
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [9bf7291]
74
+ - Updated dependencies [4617fab]
75
+ - Updated dependencies [e030615]
76
+ - @ai-sdk/provider@2.0.0-canary.11
77
+ - @ai-sdk/provider-utils@3.0.0-canary.12
78
+
79
+ ## 2.0.0-canary.12
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [66962ed]
84
+ - Updated dependencies [9301f86]
85
+ - Updated dependencies [a3f768e]
86
+ - @ai-sdk/provider-utils@3.0.0-canary.11
87
+ - @ai-sdk/provider@2.0.0-canary.10
88
+
89
+ ## 2.0.0-canary.11
90
+
91
+ ### Patch Changes
92
+
93
+ - Updated dependencies [e86be6f]
94
+ - @ai-sdk/provider@2.0.0-canary.9
95
+ - @ai-sdk/provider-utils@3.0.0-canary.10
96
+
97
+ ## 2.0.0-canary.10
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies [95857aa]
102
+ - Updated dependencies [7ea4132]
103
+ - @ai-sdk/provider@2.0.0-canary.8
104
+ - @ai-sdk/provider-utils@3.0.0-canary.9
105
+
106
+ ## 2.0.0-canary.9
107
+
108
+ ### Patch Changes
109
+
110
+ - ef4f44e: fix (provider/cohere): tool calling
111
+
112
+ ## 2.0.0-canary.8
113
+
114
+ ### Patch Changes
115
+
116
+ - Updated dependencies [5d142ab]
117
+ - Updated dependencies [b6b43c7]
118
+ - Updated dependencies [8aa9e20]
119
+ - Updated dependencies [3795467]
120
+ - @ai-sdk/provider-utils@3.0.0-canary.8
121
+ - @ai-sdk/provider@2.0.0-canary.7
122
+
123
+ ## 2.0.0-canary.7
124
+
125
+ ### Patch Changes
126
+
127
+ - 26735b5: chore(embedding-model): add v2 interface
128
+ - 443d8ec: feat(embedding-model-v2): add response body field
129
+ - fd65bc6: chore(embedding-model-v2): rename rawResponse to response
130
+ - 77e5975: chore(providers/cohere): convert to providerOptions
131
+ - Updated dependencies [26735b5]
132
+ - Updated dependencies [443d8ec]
133
+ - Updated dependencies [14c9410]
134
+ - Updated dependencies [d9c98f4]
135
+ - Updated dependencies [c4a2fec]
136
+ - Updated dependencies [0054544]
137
+ - Updated dependencies [9e9c809]
138
+ - Updated dependencies [32831c6]
139
+ - Updated dependencies [d0f9495]
140
+ - Updated dependencies [fd65bc6]
141
+ - Updated dependencies [393138b]
142
+ - Updated dependencies [7182d14]
143
+ - @ai-sdk/provider@2.0.0-canary.6
144
+ - @ai-sdk/provider-utils@3.0.0-canary.7
145
+
146
+ ## 2.0.0-canary.6
147
+
148
+ ### Patch Changes
149
+
150
+ - Updated dependencies [411e483]
151
+ - Updated dependencies [79457bd]
152
+ - Updated dependencies [ad80501]
153
+ - Updated dependencies [1766ede]
154
+ - Updated dependencies [f10304b]
155
+ - @ai-sdk/provider@2.0.0-canary.5
156
+ - @ai-sdk/provider-utils@3.0.0-canary.6
157
+
158
+ ## 2.0.0-canary.5
159
+
160
+ ### Patch Changes
161
+
162
+ - Updated dependencies [6f6bb89]
163
+ - @ai-sdk/provider@2.0.0-canary.4
164
+ - @ai-sdk/provider-utils@3.0.0-canary.5
165
+
166
+ ## 2.0.0-canary.4
167
+
168
+ ### Patch Changes
169
+
170
+ - Updated dependencies [d1a1aa1]
171
+ - @ai-sdk/provider@2.0.0-canary.3
172
+ - @ai-sdk/provider-utils@3.0.0-canary.4
173
+
174
+ ## 2.0.0-canary.3
175
+
176
+ ### Patch Changes
177
+
178
+ - Updated dependencies [a166433]
179
+ - Updated dependencies [abf9a79]
180
+ - Updated dependencies [9f95b35]
181
+ - Updated dependencies [0a87932]
182
+ - Updated dependencies [6dc848c]
183
+ - @ai-sdk/provider-utils@3.0.0-canary.3
184
+ - @ai-sdk/provider@2.0.0-canary.2
185
+
186
+ ## 2.0.0-canary.2
187
+
188
+ ### Patch Changes
189
+
190
+ - Updated dependencies [c57e248]
191
+ - Updated dependencies [33f4a6a]
192
+ - @ai-sdk/provider@2.0.0-canary.1
193
+ - @ai-sdk/provider-utils@3.0.0-canary.2
194
+
195
+ ## 2.0.0-canary.1
196
+
197
+ ### Patch Changes
198
+
199
+ - Updated dependencies [060370c]
200
+ - Updated dependencies [0c0c0b3]
201
+ - Updated dependencies [63d791d]
202
+ - @ai-sdk/provider-utils@3.0.0-canary.1
203
+
204
+ ## 2.0.0-canary.0
205
+
206
+ ### Major Changes
207
+
208
+ - d5f588f: AI SDK 5
209
+
210
+ ### Patch Changes
211
+
212
+ - Updated dependencies [d5f588f]
213
+ - @ai-sdk/provider-utils@3.0.0-canary.0
214
+ - @ai-sdk/provider@2.0.0-canary.0
39
215
 
40
216
  ## 1.2.4
41
217
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AI SDK - Cohere Provider
2
2
 
3
- The **[Cohere provider](https://sdk.vercel.ai/providers/ai-sdk-providers/cohere)** for the [AI SDK](https://sdk.vercel.ai/docs) contains language model support for the Cohere API.
3
+ The **[Cohere provider](https://ai-sdk.dev/providers/ai-sdk-providers/cohere)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the Cohere API.
4
4
 
5
5
  ## Setup
6
6
 
@@ -32,4 +32,4 @@ const { text } = await generateText({
32
32
 
33
33
  ## Documentation
34
34
 
35
- Please check out the **[Cohere provider](https://sdk.vercel.ai/providers/ai-sdk-providers/cohere)** for more information.
35
+ Please check out the **[Cohere provider](https://ai-sdk.dev/providers/ai-sdk-providers/cohere)** for more information.
package/dist/index.d.mts CHANGED
@@ -1,40 +1,18 @@
1
- import { ProviderV1, LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2, EmbeddingModelV2 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
 
4
4
  type CohereChatModelId = 'command-a-03-2025' | 'command-r7b-12-2024' | 'command-r-plus-04-2024' | 'command-r-plus' | 'command-r-08-2024' | 'command-r-03-2024' | 'command-r' | 'command' | 'command-nightly' | 'command-light' | 'command-light-nightly' | (string & {});
5
- interface CohereChatSettings {
6
- }
7
5
 
8
6
  type CohereEmbeddingModelId = 'embed-english-v3.0' | 'embed-multilingual-v3.0' | 'embed-english-light-v3.0' | 'embed-multilingual-light-v3.0' | 'embed-english-v2.0' | 'embed-english-light-v2.0' | 'embed-multilingual-v2.0' | (string & {});
9
- interface CohereEmbeddingSettings {
10
- /**
11
- * Specifies the type of input passed to the model. Default is `search_query`.
12
- *
13
- * - "search_document": Used for embeddings stored in a vector database for search use-cases.
14
- * - "search_query": Used for embeddings of search queries run against a vector DB to find relevant documents.
15
- * - "classification": Used for embeddings passed through a text classifier.
16
- * - "clustering": Used for embeddings run through a clustering algorithm.
17
- */
18
- inputType?: 'search_document' | 'search_query' | 'classification' | 'clustering';
19
- /**
20
- * Specifies how the API will handle inputs longer than the maximum token length.
21
- * Default is `END`.
22
- *
23
- * - "NONE": If selected, when the input exceeds the maximum input token length will return an error.
24
- * - "START": Will discard the start of the input until the remaining input is exactly the maximum input token length for the model.
25
- * - "END": Will discard the end of the input until the remaining input is exactly the maximum input token length for the model.
26
- */
27
- truncate?: 'NONE' | 'START' | 'END';
28
- }
29
7
 
30
- interface CohereProvider extends ProviderV1 {
31
- (modelId: CohereChatModelId, settings?: CohereChatSettings): LanguageModelV1;
8
+ interface CohereProvider extends ProviderV2 {
9
+ (modelId: CohereChatModelId): LanguageModelV2;
32
10
  /**
33
11
  Creates a model for text generation.
34
12
  */
35
- languageModel(modelId: CohereChatModelId, settings?: CohereChatSettings): LanguageModelV1;
36
- embedding(modelId: CohereEmbeddingModelId, settings?: CohereEmbeddingSettings): EmbeddingModelV1<string>;
37
- textEmbeddingModel(modelId: CohereEmbeddingModelId, settings?: CohereEmbeddingSettings): EmbeddingModelV1<string>;
13
+ languageModel(modelId: CohereChatModelId): LanguageModelV2;
14
+ embedding(modelId: CohereEmbeddingModelId): EmbeddingModelV2<string>;
15
+ textEmbeddingModel(modelId: CohereEmbeddingModelId): EmbeddingModelV2<string>;
38
16
  }
39
17
  interface CohereProviderSettings {
40
18
  /**
package/dist/index.d.ts CHANGED
@@ -1,40 +1,18 @@
1
- import { ProviderV1, LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2, EmbeddingModelV2 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
3
 
4
4
  type CohereChatModelId = 'command-a-03-2025' | 'command-r7b-12-2024' | 'command-r-plus-04-2024' | 'command-r-plus' | 'command-r-08-2024' | 'command-r-03-2024' | 'command-r' | 'command' | 'command-nightly' | 'command-light' | 'command-light-nightly' | (string & {});
5
- interface CohereChatSettings {
6
- }
7
5
 
8
6
  type CohereEmbeddingModelId = 'embed-english-v3.0' | 'embed-multilingual-v3.0' | 'embed-english-light-v3.0' | 'embed-multilingual-light-v3.0' | 'embed-english-v2.0' | 'embed-english-light-v2.0' | 'embed-multilingual-v2.0' | (string & {});
9
- interface CohereEmbeddingSettings {
10
- /**
11
- * Specifies the type of input passed to the model. Default is `search_query`.
12
- *
13
- * - "search_document": Used for embeddings stored in a vector database for search use-cases.
14
- * - "search_query": Used for embeddings of search queries run against a vector DB to find relevant documents.
15
- * - "classification": Used for embeddings passed through a text classifier.
16
- * - "clustering": Used for embeddings run through a clustering algorithm.
17
- */
18
- inputType?: 'search_document' | 'search_query' | 'classification' | 'clustering';
19
- /**
20
- * Specifies how the API will handle inputs longer than the maximum token length.
21
- * Default is `END`.
22
- *
23
- * - "NONE": If selected, when the input exceeds the maximum input token length will return an error.
24
- * - "START": Will discard the start of the input until the remaining input is exactly the maximum input token length for the model.
25
- * - "END": Will discard the end of the input until the remaining input is exactly the maximum input token length for the model.
26
- */
27
- truncate?: 'NONE' | 'START' | 'END';
28
- }
29
7
 
30
- interface CohereProvider extends ProviderV1 {
31
- (modelId: CohereChatModelId, settings?: CohereChatSettings): LanguageModelV1;
8
+ interface CohereProvider extends ProviderV2 {
9
+ (modelId: CohereChatModelId): LanguageModelV2;
32
10
  /**
33
11
  Creates a model for text generation.
34
12
  */
35
- languageModel(modelId: CohereChatModelId, settings?: CohereChatSettings): LanguageModelV1;
36
- embedding(modelId: CohereEmbeddingModelId, settings?: CohereEmbeddingSettings): EmbeddingModelV1<string>;
37
- textEmbeddingModel(modelId: CohereEmbeddingModelId, settings?: CohereEmbeddingSettings): EmbeddingModelV1<string>;
13
+ languageModel(modelId: CohereChatModelId): LanguageModelV2;
14
+ embedding(modelId: CohereEmbeddingModelId): EmbeddingModelV2<string>;
15
+ textEmbeddingModel(modelId: CohereEmbeddingModelId): EmbeddingModelV2<string>;
38
16
  }
39
17
  interface CohereProviderSettings {
40
18
  /**