@ai-sdk/provider 1.0.11 → 1.1.0

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,17 @@
1
1
  # @ai-sdk/provider
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5bc638d: AI SDK 4.2
8
+
9
+ ## 1.0.12
10
+
11
+ ### Patch Changes
12
+
13
+ - 0bd5bc6: feat (ai): support model-generated files
14
+
3
15
  ## 1.0.11
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -611,7 +611,7 @@ type LanguageModelV1Message = ({
611
611
  content: Array<LanguageModelV1TextPart | LanguageModelV1ImagePart | LanguageModelV1FilePart>;
612
612
  } | {
613
613
  role: 'assistant';
614
- content: Array<LanguageModelV1TextPart | LanguageModelV1ReasoningPart | LanguageModelV1RedactedReasoningPart | LanguageModelV1ToolCallPart>;
614
+ content: Array<LanguageModelV1TextPart | LanguageModelV1FilePart | LanguageModelV1ReasoningPart | LanguageModelV1RedactedReasoningPart | LanguageModelV1ToolCallPart>;
615
615
  } | {
616
616
  role: 'tool';
617
617
  content: Array<LanguageModelV1ToolResultPart>;
@@ -1034,6 +1034,17 @@ An optional signature for verifying that the reasoning originated from the model
1034
1034
  data: string;
1035
1035
  }>;
1036
1036
  /**
1037
+ Generated files as base64 encoded strings or binary data.
1038
+ The files should be returned without any unnecessary conversion.
1039
+ If the API returns base64 encoded strings, the files should be returned
1040
+ as base64 encoded strings. If the API returns binary data, the files should
1041
+ be returned as binary data.
1042
+ */
1043
+ files?: Array<{
1044
+ data: string | Uint8Array;
1045
+ mimeType: string;
1046
+ }>;
1047
+ /**
1037
1048
  Tool calls that the model has generated.
1038
1049
  Can be undefined if the model did not generate any tool calls.
1039
1050
  */
@@ -1188,6 +1199,17 @@ type LanguageModelV1StreamPart = {
1188
1199
  } | {
1189
1200
  type: 'source';
1190
1201
  source: LanguageModelV1Source;
1202
+ } | {
1203
+ type: 'file';
1204
+ mimeType: string;
1205
+ /**
1206
+ Generated file data as base64 encoded strings or binary data.
1207
+ The file data should be returned without any unnecessary conversion.
1208
+ If the API returns base64 encoded strings, the file data should be returned
1209
+ as base64 encoded strings. If the API returns binary data, the file data should
1210
+ be returned as binary data.
1211
+ */
1212
+ data: string | Uint8Array;
1191
1213
  } | ({
1192
1214
  type: 'tool-call';
1193
1215
  } & LanguageModelV1FunctionToolCall) | {
@@ -1221,7 +1243,7 @@ represents no support for object generation.
1221
1243
  type LanguageModelV1ObjectGenerationMode = 'json' | 'tool' | undefined;
1222
1244
 
1223
1245
  /**
1224
- * Provider for language and text embedding models.
1246
+ * Provider for language, text embedding, and image generation models.
1225
1247
  */
1226
1248
  interface ProviderV1 {
1227
1249
  /**
package/dist/index.d.ts CHANGED
@@ -611,7 +611,7 @@ type LanguageModelV1Message = ({
611
611
  content: Array<LanguageModelV1TextPart | LanguageModelV1ImagePart | LanguageModelV1FilePart>;
612
612
  } | {
613
613
  role: 'assistant';
614
- content: Array<LanguageModelV1TextPart | LanguageModelV1ReasoningPart | LanguageModelV1RedactedReasoningPart | LanguageModelV1ToolCallPart>;
614
+ content: Array<LanguageModelV1TextPart | LanguageModelV1FilePart | LanguageModelV1ReasoningPart | LanguageModelV1RedactedReasoningPart | LanguageModelV1ToolCallPart>;
615
615
  } | {
616
616
  role: 'tool';
617
617
  content: Array<LanguageModelV1ToolResultPart>;
@@ -1034,6 +1034,17 @@ An optional signature for verifying that the reasoning originated from the model
1034
1034
  data: string;
1035
1035
  }>;
1036
1036
  /**
1037
+ Generated files as base64 encoded strings or binary data.
1038
+ The files should be returned without any unnecessary conversion.
1039
+ If the API returns base64 encoded strings, the files should be returned
1040
+ as base64 encoded strings. If the API returns binary data, the files should
1041
+ be returned as binary data.
1042
+ */
1043
+ files?: Array<{
1044
+ data: string | Uint8Array;
1045
+ mimeType: string;
1046
+ }>;
1047
+ /**
1037
1048
  Tool calls that the model has generated.
1038
1049
  Can be undefined if the model did not generate any tool calls.
1039
1050
  */
@@ -1188,6 +1199,17 @@ type LanguageModelV1StreamPart = {
1188
1199
  } | {
1189
1200
  type: 'source';
1190
1201
  source: LanguageModelV1Source;
1202
+ } | {
1203
+ type: 'file';
1204
+ mimeType: string;
1205
+ /**
1206
+ Generated file data as base64 encoded strings or binary data.
1207
+ The file data should be returned without any unnecessary conversion.
1208
+ If the API returns base64 encoded strings, the file data should be returned
1209
+ as base64 encoded strings. If the API returns binary data, the file data should
1210
+ be returned as binary data.
1211
+ */
1212
+ data: string | Uint8Array;
1191
1213
  } | ({
1192
1214
  type: 'tool-call';
1193
1215
  } & LanguageModelV1FunctionToolCall) | {
@@ -1221,7 +1243,7 @@ represents no support for object generation.
1221
1243
  type LanguageModelV1ObjectGenerationMode = 'json' | 'tool' | undefined;
1222
1244
 
1223
1245
  /**
1224
- * Provider for language and text embedding models.
1246
+ * Provider for language, text embedding, and image generation models.
1225
1247
  */
1226
1248
  interface ProviderV1 {
1227
1249
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider",
3
- "version": "1.0.11",
3
+ "version": "1.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/json-schema": "7.0.15",
26
- "@types/node": "^18",
26
+ "@types/node": "20.17.24",
27
27
  "tsup": "^8",
28
28
  "typescript": "5.6.3",
29
29
  "@vercel/ai-tsconfig": "0.0.0"