@ai-sdk/mistral 4.0.0-beta.2 → 4.0.0-beta.21

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
- LanguageModelV3CallOptions,
3
- SharedV3Warning,
2
+ LanguageModelV4CallOptions,
3
+ SharedV4Warning,
4
4
  UnsupportedFunctionalityError,
5
5
  } from '@ai-sdk/provider';
6
6
  import { MistralToolChoice } from './mistral-chat-prompt';
@@ -9,8 +9,8 @@ export function prepareTools({
9
9
  tools,
10
10
  toolChoice,
11
11
  }: {
12
- tools: LanguageModelV3CallOptions['tools'];
13
- toolChoice?: LanguageModelV3CallOptions['toolChoice'];
12
+ tools: LanguageModelV4CallOptions['tools'];
13
+ toolChoice?: LanguageModelV4CallOptions['toolChoice'];
14
14
  }): {
15
15
  tools:
16
16
  | Array<{
@@ -24,12 +24,12 @@ export function prepareTools({
24
24
  }>
25
25
  | undefined;
26
26
  toolChoice: MistralToolChoice | undefined;
27
- toolWarnings: SharedV3Warning[];
27
+ toolWarnings: SharedV4Warning[];
28
28
  } {
29
29
  // when the tools array is empty, change it to undefined to prevent errors:
30
30
  tools = tools?.length ? tools : undefined;
31
31
 
32
- const toolWarnings: SharedV3Warning[] = [];
32
+ const toolWarnings: SharedV4Warning[] = [];
33
33
 
34
34
  if (tools == null) {
35
35
  return { tools: undefined, toolChoice: undefined, toolWarnings };
@@ -1,8 +1,8 @@
1
1
  import {
2
- EmbeddingModelV3,
3
- LanguageModelV3,
2
+ EmbeddingModelV4,
3
+ LanguageModelV4,
4
4
  NoSuchModelError,
5
- ProviderV3,
5
+ ProviderV4,
6
6
  } from '@ai-sdk/provider';
7
7
  import {
8
8
  FetchFunction,
@@ -16,38 +16,38 @@ import { MistralEmbeddingModel } from './mistral-embedding-model';
16
16
  import { MistralEmbeddingModelId } from './mistral-embedding-options';
17
17
  import { VERSION } from './version';
18
18
 
19
- export interface MistralProvider extends ProviderV3 {
20
- (modelId: MistralChatModelId): LanguageModelV3;
19
+ export interface MistralProvider extends ProviderV4 {
20
+ (modelId: MistralChatModelId): LanguageModelV4;
21
21
 
22
22
  /**
23
23
  * Creates a model for text generation.
24
24
  */
25
- languageModel(modelId: MistralChatModelId): LanguageModelV3;
25
+ languageModel(modelId: MistralChatModelId): LanguageModelV4;
26
26
 
27
27
  /**
28
28
  * Creates a model for text generation.
29
29
  */
30
- chat(modelId: MistralChatModelId): LanguageModelV3;
30
+ chat(modelId: MistralChatModelId): LanguageModelV4;
31
31
 
32
32
  /**
33
33
  * Creates a model for text embeddings.
34
34
  */
35
- embedding(modelId: MistralEmbeddingModelId): EmbeddingModelV3;
35
+ embedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
36
36
 
37
37
  /**
38
38
  * Creates a model for text embeddings.
39
39
  */
40
- embeddingModel: (modelId: MistralEmbeddingModelId) => EmbeddingModelV3;
40
+ embeddingModel: (modelId: MistralEmbeddingModelId) => EmbeddingModelV4;
41
41
 
42
42
  /**
43
43
  * @deprecated Use `embedding` instead.
44
44
  */
45
- textEmbedding(modelId: MistralEmbeddingModelId): EmbeddingModelV3;
45
+ textEmbedding(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
46
46
 
47
47
  /**
48
48
  * @deprecated Use `embeddingModel` instead.
49
49
  */
50
- textEmbeddingModel(modelId: MistralEmbeddingModelId): EmbeddingModelV3;
50
+ textEmbeddingModel(modelId: MistralEmbeddingModelId): EmbeddingModelV4;
51
51
  }
52
52
 
53
53
  export interface MistralProviderSettings {
@@ -126,7 +126,7 @@ export function createMistral(
126
126
  return createChatModel(modelId);
127
127
  };
128
128
 
129
- provider.specificationVersion = 'v3' as const;
129
+ provider.specificationVersion = 'v4' as const;
130
130
  provider.languageModel = createChatModel;
131
131
  provider.chat = createChatModel;
132
132
  provider.embedding = createEmbeddingModel;