@ai-sdk/cohere 3.0.72 → 3.0.73

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,14 @@
1
1
  # @ai-sdk/cohere
2
2
 
3
+ ## 3.0.73
4
+
5
+ ### Patch Changes
6
+
7
+ - 064714a: Defer validation schema construction until first use to reduce provider import time.
8
+ - Updated dependencies [1183cc4]
9
+ - Updated dependencies [d726591]
10
+ - @ai-sdk/provider-utils@4.0.62
11
+
3
12
  ## 3.0.72
4
13
 
5
14
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,18 +1,15 @@
1
- import { z } from 'zod/v4';
1
+ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
2
+ import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
2
3
  import { ProviderV3, LanguageModelV3, EmbeddingModelV3, RerankingModelV3 } from '@ai-sdk/provider';
3
- import { FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
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
- declare const cohereLanguageModelOptions: 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>>;
14
- }, z.core.$strip>;
15
- type CohereLanguageModelOptions = z.infer<typeof cohereLanguageModelOptions>;
6
+ declare const cohereLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
7
+ thinking?: {
8
+ type?: "enabled" | "disabled" | undefined;
9
+ tokenBudget?: number | undefined;
10
+ } | undefined;
11
+ }>;
12
+ type CohereLanguageModelOptions = InferSchema<typeof cohereLanguageModelOptions>;
16
13
 
17
14
  type CohereRerankingModelId = 'rerank-v3.5' | 'rerank-english-v3.0' | 'rerank-multilingual-v3.0' | (string & {});
18
15
  type CohereRerankingModelOptions = {
@@ -31,21 +28,12 @@ type CohereRerankingModelOptions = {
31
28
  };
32
29
 
33
30
  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
- 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<768>, z.ZodLiteral<1024>, z.ZodLiteral<1536>, z.ZodLiteral<2048>]>>;
47
- }, z.core.$strip>;
48
- type CohereEmbeddingModelOptions = z.infer<typeof cohereEmbeddingModelOptions>;
31
+ declare const cohereEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
32
+ inputType?: "search_document" | "search_query" | "classification" | "clustering" | undefined;
33
+ truncate?: "NONE" | "START" | "END" | undefined;
34
+ outputDimension?: 256 | 512 | 768 | 1024 | 1536 | 2048 | undefined;
35
+ }>;
36
+ type CohereEmbeddingModelOptions = InferSchema<typeof cohereEmbeddingModelOptions>;
49
37
 
50
38
  interface CohereProvider extends ProviderV3 {
51
39
  (modelId: CohereChatModelId): LanguageModelV3;
package/dist/index.d.ts CHANGED
@@ -1,18 +1,15 @@
1
- import { z } from 'zod/v4';
1
+ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
2
+ import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
2
3
  import { ProviderV3, LanguageModelV3, EmbeddingModelV3, RerankingModelV3 } from '@ai-sdk/provider';
3
- import { FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
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
- declare const cohereLanguageModelOptions: 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>>;
14
- }, z.core.$strip>;
15
- type CohereLanguageModelOptions = z.infer<typeof cohereLanguageModelOptions>;
6
+ declare const cohereLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
7
+ thinking?: {
8
+ type?: "enabled" | "disabled" | undefined;
9
+ tokenBudget?: number | undefined;
10
+ } | undefined;
11
+ }>;
12
+ type CohereLanguageModelOptions = InferSchema<typeof cohereLanguageModelOptions>;
16
13
 
17
14
  type CohereRerankingModelId = 'rerank-v3.5' | 'rerank-english-v3.0' | 'rerank-multilingual-v3.0' | (string & {});
18
15
  type CohereRerankingModelOptions = {
@@ -31,21 +28,12 @@ type CohereRerankingModelOptions = {
31
28
  };
32
29
 
33
30
  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
- 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<768>, z.ZodLiteral<1024>, z.ZodLiteral<1536>, z.ZodLiteral<2048>]>>;
47
- }, z.core.$strip>;
48
- type CohereEmbeddingModelOptions = z.infer<typeof cohereEmbeddingModelOptions>;
31
+ declare const cohereEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
32
+ inputType?: "search_document" | "search_query" | "classification" | "clustering" | undefined;
33
+ truncate?: "NONE" | "START" | "END" | undefined;
34
+ outputDimension?: 256 | 512 | 768 | 1024 | 1536 | 2048 | undefined;
35
+ }>;
36
+ type CohereEmbeddingModelOptions = InferSchema<typeof cohereEmbeddingModelOptions>;
49
37
 
50
38
  interface CohereProvider extends ProviderV3 {
51
39
  (modelId: CohereChatModelId): LanguageModelV3;