@ai-sdk/provider 2.0.0-alpha.10 → 2.0.0-alpha.12

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
+ ## 2.0.0-alpha.12
4
+
5
+ ### Patch Changes
6
+
7
+ - e2aceaf: feat: add raw chunk support
8
+
9
+ ## 2.0.0-alpha.11
10
+
11
+ ### Patch Changes
12
+
13
+ - c1e6647: release alpha.11
14
+
3
15
  ## 2.0.0-alpha.10
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -843,6 +843,10 @@ type LanguageModelV2CallOptions = {
843
843
  */
844
844
  toolChoice?: LanguageModelV2ToolChoice;
845
845
  /**
846
+ Include raw chunks in the stream. Only applicable for streaming calls.
847
+ */
848
+ includeRawChunks?: boolean;
849
+ /**
846
850
  Abort signal for cancelling the operation.
847
851
  */
848
852
  abortSignal?: AbortSignal;
@@ -918,7 +922,7 @@ A source that has been used as input to generate the response.
918
922
  type LanguageModelV2Source = {
919
923
  type: 'source';
920
924
  /**
921
- * A URL source. This is return by web search RAG models.
925
+ * The type of source - URL sources reference web content.
922
926
  */
923
927
  sourceType: 'url';
924
928
  /**
@@ -937,6 +941,32 @@ type LanguageModelV2Source = {
937
941
  * Additional provider metadata for the source.
938
942
  */
939
943
  providerMetadata?: SharedV2ProviderMetadata;
944
+ } | {
945
+ type: 'source';
946
+ /**
947
+ * The type of source - document sources reference files/documents.
948
+ */
949
+ sourceType: 'document';
950
+ /**
951
+ * The ID of the source.
952
+ */
953
+ id: string;
954
+ /**
955
+ * IANA media type of the document (e.g., 'application/pdf').
956
+ */
957
+ mediaType: string;
958
+ /**
959
+ * The title of the document.
960
+ */
961
+ title: string;
962
+ /**
963
+ * Optional filename of the document.
964
+ */
965
+ filename?: string;
966
+ /**
967
+ * Additional provider metadata for the source.
968
+ */
969
+ providerMetadata?: SharedV2ProviderMetadata;
940
970
  };
941
971
 
942
972
  /**
@@ -1047,6 +1077,9 @@ type LanguageModelV2StreamPart = LanguageModelV2Content | {
1047
1077
  usage: LanguageModelV2Usage;
1048
1078
  finishReason: LanguageModelV2FinishReason;
1049
1079
  providerMetadata?: SharedV2ProviderMetadata;
1080
+ } | {
1081
+ type: 'raw';
1082
+ rawValue: unknown;
1050
1083
  } | {
1051
1084
  type: 'error';
1052
1085
  error: unknown;
package/dist/index.d.ts CHANGED
@@ -843,6 +843,10 @@ type LanguageModelV2CallOptions = {
843
843
  */
844
844
  toolChoice?: LanguageModelV2ToolChoice;
845
845
  /**
846
+ Include raw chunks in the stream. Only applicable for streaming calls.
847
+ */
848
+ includeRawChunks?: boolean;
849
+ /**
846
850
  Abort signal for cancelling the operation.
847
851
  */
848
852
  abortSignal?: AbortSignal;
@@ -918,7 +922,7 @@ A source that has been used as input to generate the response.
918
922
  type LanguageModelV2Source = {
919
923
  type: 'source';
920
924
  /**
921
- * A URL source. This is return by web search RAG models.
925
+ * The type of source - URL sources reference web content.
922
926
  */
923
927
  sourceType: 'url';
924
928
  /**
@@ -937,6 +941,32 @@ type LanguageModelV2Source = {
937
941
  * Additional provider metadata for the source.
938
942
  */
939
943
  providerMetadata?: SharedV2ProviderMetadata;
944
+ } | {
945
+ type: 'source';
946
+ /**
947
+ * The type of source - document sources reference files/documents.
948
+ */
949
+ sourceType: 'document';
950
+ /**
951
+ * The ID of the source.
952
+ */
953
+ id: string;
954
+ /**
955
+ * IANA media type of the document (e.g., 'application/pdf').
956
+ */
957
+ mediaType: string;
958
+ /**
959
+ * The title of the document.
960
+ */
961
+ title: string;
962
+ /**
963
+ * Optional filename of the document.
964
+ */
965
+ filename?: string;
966
+ /**
967
+ * Additional provider metadata for the source.
968
+ */
969
+ providerMetadata?: SharedV2ProviderMetadata;
940
970
  };
941
971
 
942
972
  /**
@@ -1047,6 +1077,9 @@ type LanguageModelV2StreamPart = LanguageModelV2Content | {
1047
1077
  usage: LanguageModelV2Usage;
1048
1078
  finishReason: LanguageModelV2FinishReason;
1049
1079
  providerMetadata?: SharedV2ProviderMetadata;
1080
+ } | {
1081
+ type: 'raw';
1082
+ rawValue: unknown;
1050
1083
  } | {
1051
1084
  type: 'error';
1052
1085
  error: unknown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider",
3
- "version": "2.0.0-alpha.10",
3
+ "version": "2.0.0-alpha.12",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",