@ai-sdk/cohere 4.0.51 → 4.0.53

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,5 +1,22 @@
1
1
  # @ai-sdk/cohere
2
2
 
3
+ ## 4.0.53
4
+
5
+ ### Patch Changes
6
+
7
+ - ede5b89: chore: migrate package builds from tsup to tsdown
8
+ - Updated dependencies [ede5b89]
9
+ - @ai-sdk/provider@4.0.20
10
+ - @ai-sdk/provider-utils@5.0.52
11
+
12
+ ## 4.0.52
13
+
14
+ ### Patch Changes
15
+
16
+ - c2511c1: fix: use standards-compliant User-Agent header
17
+ - Updated dependencies [c2511c1]
18
+ - @ai-sdk/provider-utils@5.0.51
19
+
3
20
  ## 4.0.51
4
21
 
5
22
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,117 +1,122 @@
1
- import { z } from 'zod/v4';
2
- import { ProviderV4, LanguageModelV4, EmbeddingModelV4, RerankingModelV4 } from '@ai-sdk/provider';
3
- import { FetchFunction } from '@ai-sdk/provider-utils';
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
- 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>>;
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
- * Long documents will be automatically truncated to the specified number of tokens.
21
- *
22
- * @default 4096
23
- */
24
- maxTokensPerDoc?: number;
25
- /**
26
- * The priority of the request.
27
- *
28
- * @default 0
29
- */
30
- priority?: number;
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
- inputType: z.ZodOptional<z.ZodEnum<{
36
- search_document: "search_document";
37
- search_query: "search_query";
38
- classification: "classification";
39
- clustering: "clustering";
40
- }>>;
41
- truncate: z.ZodOptional<z.ZodEnum<{
42
- NONE: "NONE";
43
- START: "START";
44
- END: "END";
45
- }>>;
46
- outputDimension: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<256>, z.ZodLiteral<512>, z.ZodLiteral<1024>, z.ZodLiteral<1536>]>>;
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
- (modelId: CohereChatModelId): LanguageModelV4;
52
- /**
53
- * Creates a model for text generation.
54
- */
55
- languageModel(modelId: CohereChatModelId): LanguageModelV4;
56
- /**
57
- * Creates a model for text embeddings.
58
- */
59
- embedding(modelId: CohereEmbeddingModelId): EmbeddingModelV4;
60
- /**
61
- * Creates a model for text embeddings.
62
- */
63
- embeddingModel(modelId: CohereEmbeddingModelId): EmbeddingModelV4;
64
- /**
65
- * @deprecated Use `embedding` instead.
66
- */
67
- textEmbedding(modelId: CohereEmbeddingModelId): EmbeddingModelV4;
68
- /**
69
- * @deprecated Use `embeddingModel` instead.
70
- */
71
- textEmbeddingModel(modelId: CohereEmbeddingModelId): EmbeddingModelV4;
72
- /**
73
- * Creates a model for reranking.
74
- */
75
- reranking(modelId: CohereRerankingModelId): RerankingModelV4;
76
- /**
77
- * Creates a model for reranking.
78
- */
79
- rerankingModel(modelId: CohereRerankingModelId): RerankingModelV4;
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
- * Use a different URL prefix for API calls, e.g. to use proxy servers.
84
- * The default prefix is `https://api.cohere.com/v2`.
85
- */
86
- baseURL?: string;
87
- /**
88
- * API key that is being send using the `Authorization` header.
89
- * It defaults to the `COHERE_API_KEY` environment variable.
90
- */
91
- apiKey?: string;
92
- /**
93
- * Custom headers to include in the requests.
94
- */
95
- headers?: Record<string, string>;
96
- /**
97
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
98
- * or to provide a custom fetch implementation for e.g. testing.
99
- */
100
- fetch?: FetchFunction;
101
- /**
102
- * Optional function to generate a unique ID for each request.
103
- */
104
- generateId?: () => string;
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
- declare const VERSION: string;
116
-
117
- export { type CohereLanguageModelChatOptions as CohereChatModelOptions, type CohereEmbeddingModelOptions, type CohereLanguageModelChatOptions, type CohereLanguageModelChatOptions as CohereLanguageModelOptions, type CohereProvider, type CohereProviderSettings, type CohereRerankingModelOptions, type CohereRerankingModelOptions as CohereRerankingOptions, VERSION, cohere, createCohere };
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"}