@ai-sdk/cohere 4.0.52 → 4.0.54
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 +18 -0
- package/dist/index.d.ts +101 -96
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +894 -1147
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/cohere
|
|
2
2
|
|
|
3
|
+
## 4.0.54
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [8c65988]
|
|
8
|
+
- Updated dependencies [527a163]
|
|
9
|
+
- @ai-sdk/provider@4.0.21
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.53
|
|
11
|
+
|
|
12
|
+
## 4.0.53
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- ede5b89: chore: migrate package builds from tsup to tsdown
|
|
17
|
+
- Updated dependencies [ede5b89]
|
|
18
|
+
- @ai-sdk/provider@4.0.20
|
|
19
|
+
- @ai-sdk/provider-utils@5.0.52
|
|
20
|
+
|
|
3
21
|
## 4.0.52
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,117 +1,122 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { EmbeddingModelV4, LanguageModelV4, ProviderV4, RerankingModelV4 } from "@ai-sdk/provider";
|
|
2
|
+
import { FetchFunction } from "@ai-sdk/provider-utils";
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
|
+
//#region src/cohere-chat-language-model-options.d.ts
|
|
5
5
|
type CohereChatModelId = 'command-a-03-2025' | 'command-a-reasoning-08-2025' | 'command-a-vision-07-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 & {});
|
|
6
6
|
declare const cohereLanguageModelChatOptions: z.ZodObject<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
thinking: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
enabled: "enabled";
|
|
10
|
+
disabled: "disabled";
|
|
11
|
+
}>>;
|
|
12
|
+
tokenBudget: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
14
|
}, z.core.$strip>;
|
|
15
15
|
type CohereLanguageModelChatOptions = z.infer<typeof cohereLanguageModelChatOptions>;
|
|
16
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/reranking/cohere-reranking-model-options.d.ts
|
|
17
18
|
type CohereRerankingModelId = 'rerank-v3.5' | 'rerank-english-v3.0' | 'rerank-multilingual-v3.0' | (string & {});
|
|
18
19
|
type CohereRerankingModelOptions = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Long documents will be automatically truncated to the specified number of tokens.
|
|
22
|
+
*
|
|
23
|
+
* @default 4096
|
|
24
|
+
*/
|
|
25
|
+
maxTokensPerDoc?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The priority of the request.
|
|
28
|
+
*
|
|
29
|
+
* @default 0
|
|
30
|
+
*/
|
|
31
|
+
priority?: number;
|
|
31
32
|
};
|
|
32
|
-
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/cohere-embedding-model-options.d.ts
|
|
33
35
|
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 & {});
|
|
34
36
|
declare const cohereEmbeddingModelOptions: z.ZodObject<{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
inputType: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
search_document: "search_document";
|
|
39
|
+
search_query: "search_query";
|
|
40
|
+
classification: "classification";
|
|
41
|
+
clustering: "clustering";
|
|
42
|
+
}>>;
|
|
43
|
+
truncate: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
NONE: "NONE";
|
|
45
|
+
START: "START";
|
|
46
|
+
END: "END";
|
|
47
|
+
}>>;
|
|
48
|
+
outputDimension: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<256>, z.ZodLiteral<512>, z.ZodLiteral<1024>, z.ZodLiteral<1536>]>>;
|
|
47
49
|
}, z.core.$strip>;
|
|
48
50
|
type CohereEmbeddingModelOptions = z.infer<typeof cohereEmbeddingModelOptions>;
|
|
49
|
-
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/cohere-provider.d.ts
|
|
50
53
|
interface CohereProvider extends ProviderV4 {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
54
|
+
(modelId: CohereChatModelId): LanguageModelV4;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a model for text generation.
|
|
57
|
+
*/
|
|
58
|
+
languageModel(modelId: CohereChatModelId): LanguageModelV4;
|
|
59
|
+
/**
|
|
60
|
+
* Creates a model for text embeddings.
|
|
61
|
+
*/
|
|
62
|
+
embedding(modelId: CohereEmbeddingModelId): EmbeddingModelV4;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a model for text embeddings.
|
|
65
|
+
*/
|
|
66
|
+
embeddingModel(modelId: CohereEmbeddingModelId): EmbeddingModelV4;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated Use `embedding` instead.
|
|
69
|
+
*/
|
|
70
|
+
textEmbedding(modelId: CohereEmbeddingModelId): EmbeddingModelV4;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated Use `embeddingModel` instead.
|
|
73
|
+
*/
|
|
74
|
+
textEmbeddingModel(modelId: CohereEmbeddingModelId): EmbeddingModelV4;
|
|
75
|
+
/**
|
|
76
|
+
* Creates a model for reranking.
|
|
77
|
+
*/
|
|
78
|
+
reranking(modelId: CohereRerankingModelId): RerankingModelV4;
|
|
79
|
+
/**
|
|
80
|
+
* Creates a model for reranking.
|
|
81
|
+
*/
|
|
82
|
+
rerankingModel(modelId: CohereRerankingModelId): RerankingModelV4;
|
|
80
83
|
}
|
|
81
84
|
interface CohereProviderSettings {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Use a different URL prefix for API calls, e.g. to use proxy servers.
|
|
87
|
+
* The default prefix is `https://api.cohere.com/v2`.
|
|
88
|
+
*/
|
|
89
|
+
baseURL?: string;
|
|
90
|
+
/**
|
|
91
|
+
* API key that is being send using the `Authorization` header.
|
|
92
|
+
* It defaults to the `COHERE_API_KEY` environment variable.
|
|
93
|
+
*/
|
|
94
|
+
apiKey?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Custom headers to include in the requests.
|
|
97
|
+
*/
|
|
98
|
+
headers?: Record<string, string>;
|
|
99
|
+
/**
|
|
100
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
101
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
102
|
+
*/
|
|
103
|
+
fetch?: FetchFunction;
|
|
104
|
+
/**
|
|
105
|
+
* Optional function to generate a unique ID for each request.
|
|
106
|
+
*/
|
|
107
|
+
generateId?: () => string;
|
|
105
108
|
}
|
|
106
109
|
/**
|
|
107
110
|
* Create a Cohere AI provider instance.
|
|
108
111
|
*/
|
|
109
|
-
declare function createCohere(options?: CohereProviderSettings): CohereProvider;
|
|
112
|
+
export declare function createCohere(options?: CohereProviderSettings): CohereProvider;
|
|
110
113
|
/**
|
|
111
114
|
* Default Cohere provider instance.
|
|
112
115
|
*/
|
|
113
|
-
declare const cohere: CohereProvider;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
export declare const cohere: CohereProvider;
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/version.d.ts
|
|
119
|
+
export declare const VERSION: string;
|
|
120
|
+
//#endregion
|
|
121
|
+
export type { CohereLanguageModelChatOptions as CohereChatModelOptions, CohereLanguageModelChatOptions, CohereLanguageModelChatOptions as CohereLanguageModelOptions, CohereEmbeddingModelOptions, CohereProvider, CohereProviderSettings, CohereRerankingModelOptions, CohereRerankingModelOptions as CohereRerankingOptions };
|
|
122
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/cohere-chat-language-model-options.ts","../src/reranking/cohere-reranking-model-options.ts","../src/cohere-embedding-model-options.ts","../src/cohere-provider.ts","../src/version.ts"],"mappings":";;;;KAGY;cAgBC,gCAA8B,EAAA;;;;;;;;GAezC,EAAA,KAAA;KAEU,iCAAiC,EAAE,aACtC;;;KC7BG;KAMA;;;;;;EAMV;;;;;;EAOA;;;;KCzBU;cAUC,6BAA2B,EAAA;;;;;;;;;;;;;GAiCtC,EAAA,KAAA;KAEU,8BAA8B,EAAE,aACnC;;;UC1BQ,uBAAuB;GACrC,SAAS,oBAAoB;;;;EAK9B,cAAc,SAAS,oBAAoB;;;;EAK3C,UAAU,SAAS,yBAAyB;;;;EAK5C,eAAe,SAAS,yBAAyB;;;;EAKjD,cAAc,SAAS,yBAAyB;;;;EAKhD,mBAAmB,SAAS,yBAAyB;;;;EAKrD,UAAU,SAAS,yBAAyB;;;;EAK5C,eAAe,SAAS,yBAAyB;;UAGlC;;;;;EAKf;;;;;EAMA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;;;EAKR;;;;;wBAMc,aACd,UAAS,yBACR;;;;qBAuEU,QAAM;;;qBCrKN"}
|