@ai-sdk/provider 0.0.23 → 0.0.24

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,11 @@
1
1
  # @ai-sdk/provider
2
2
 
3
+ ## 0.0.24
4
+
5
+ ### Patch Changes
6
+
7
+ - d595d0d: feat (ai/core): file content parts
8
+
3
9
  ## 0.0.23
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -1 +1 @@
1
- # Vercel AI SDK - Provider Language Model Specification
1
+ # AI SDK - Provider Language Model Specification
package/dist/index.d.mts CHANGED
@@ -591,7 +591,7 @@ type LanguageModelV1Message = ({
591
591
  content: string;
592
592
  } | {
593
593
  role: 'user';
594
- content: Array<LanguageModelV1TextPart | LanguageModelV1ImagePart>;
594
+ content: Array<LanguageModelV1TextPart | LanguageModelV1ImagePart | LanguageModelV1FilePart>;
595
595
  } | {
596
596
  role: 'assistant';
597
597
  content: Array<LanguageModelV1TextPart | LanguageModelV1ToolCallPart>;
@@ -643,6 +643,26 @@ interface LanguageModelV1ImagePart {
643
643
  providerMetadata?: LanguageModelV1ProviderMetadata;
644
644
  }
645
645
  /**
646
+ File content part of a prompt. It contains a file.
647
+ */
648
+ interface LanguageModelV1FilePart {
649
+ type: 'file';
650
+ /**
651
+ File data as base64 encoded string or as a URL.
652
+ */
653
+ data: string | URL;
654
+ /**
655
+ Mime type of the file.
656
+ */
657
+ mimeType: string;
658
+ /**
659
+ * Additional provider-specific metadata. They are passed through
660
+ * to the provider from the AI SDK and enable provider-specific
661
+ * functionality that can be fully encapsulated in the provider.
662
+ */
663
+ providerMetadata?: LanguageModelV1ProviderMetadata;
664
+ }
665
+ /**
646
666
  Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
647
667
  */
648
668
  interface LanguageModelV1ToolCallPart {
@@ -764,9 +784,9 @@ Specifies how the tool should be selected. Defaults to 'auto'.
764
784
  */
765
785
  prompt: LanguageModelV1Prompt;
766
786
  /**
767
- * Additional provider-specific metadata. They are passed through
768
- * to the provider from the AI SDK and enable provider-specific
769
- * functionality that can be fully encapsulated in the provider.
787
+ Additional provider-specific metadata.
788
+ The metadata is passed through to the provider from the AI SDK and enables
789
+ provider-specific functionality that can be fully encapsulated in the provider.
770
790
  */
771
791
  providerMetadata?: LanguageModelV1ProviderMetadata;
772
792
  };
@@ -1030,7 +1050,7 @@ interface ProviderV1 {
1030
1050
  Returns the language model with the given id.
1031
1051
  The model id is then passed to the provider function to get the model.
1032
1052
 
1033
- @param {string} id - The id of the model to return.
1053
+ @param {string} modelId - The id of the model to return.
1034
1054
 
1035
1055
  @returns {LanguageModel} The language model associated with the id
1036
1056
 
@@ -1041,7 +1061,7 @@ interface ProviderV1 {
1041
1061
  Returns the text embedding model with the given id.
1042
1062
  The model id is then passed to the provider function to get the model.
1043
1063
 
1044
- @param {string} id - The id of the model to return.
1064
+ @param {string} modelId - The id of the model to return.
1045
1065
 
1046
1066
  @returns {LanguageModel} The language model associated with the id
1047
1067
 
@@ -1050,4 +1070,4 @@ interface ProviderV1 {
1050
1070
  textEmbeddingModel(modelId: string): EmbeddingModelV1<string>;
1051
1071
  }
1052
1072
 
1053
- export { AISDKError, APICallError, type EmbeddingModelV1, type EmbeddingModelV1Embedding, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV1, type LanguageModelV1CallOptions, type LanguageModelV1CallWarning, type LanguageModelV1FinishReason, type LanguageModelV1FunctionTool, type LanguageModelV1FunctionToolCall, type LanguageModelV1ImagePart, type LanguageModelV1LogProbs, type LanguageModelV1Message, type LanguageModelV1Prompt, type LanguageModelV1ProviderMetadata, type LanguageModelV1StreamPart, type LanguageModelV1TextPart, type LanguageModelV1ToolCallPart, type LanguageModelV1ToolChoice, type LanguageModelV1ToolResultPart, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, type ProviderV1, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };
1073
+ export { AISDKError, APICallError, type EmbeddingModelV1, type EmbeddingModelV1Embedding, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV1, type LanguageModelV1CallOptions, type LanguageModelV1CallWarning, type LanguageModelV1FilePart, type LanguageModelV1FinishReason, type LanguageModelV1FunctionTool, type LanguageModelV1FunctionToolCall, type LanguageModelV1ImagePart, type LanguageModelV1LogProbs, type LanguageModelV1Message, type LanguageModelV1Prompt, type LanguageModelV1ProviderMetadata, type LanguageModelV1StreamPart, type LanguageModelV1TextPart, type LanguageModelV1ToolCallPart, type LanguageModelV1ToolChoice, type LanguageModelV1ToolResultPart, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, type ProviderV1, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };
package/dist/index.d.ts CHANGED
@@ -591,7 +591,7 @@ type LanguageModelV1Message = ({
591
591
  content: string;
592
592
  } | {
593
593
  role: 'user';
594
- content: Array<LanguageModelV1TextPart | LanguageModelV1ImagePart>;
594
+ content: Array<LanguageModelV1TextPart | LanguageModelV1ImagePart | LanguageModelV1FilePart>;
595
595
  } | {
596
596
  role: 'assistant';
597
597
  content: Array<LanguageModelV1TextPart | LanguageModelV1ToolCallPart>;
@@ -643,6 +643,26 @@ interface LanguageModelV1ImagePart {
643
643
  providerMetadata?: LanguageModelV1ProviderMetadata;
644
644
  }
645
645
  /**
646
+ File content part of a prompt. It contains a file.
647
+ */
648
+ interface LanguageModelV1FilePart {
649
+ type: 'file';
650
+ /**
651
+ File data as base64 encoded string or as a URL.
652
+ */
653
+ data: string | URL;
654
+ /**
655
+ Mime type of the file.
656
+ */
657
+ mimeType: string;
658
+ /**
659
+ * Additional provider-specific metadata. They are passed through
660
+ * to the provider from the AI SDK and enable provider-specific
661
+ * functionality that can be fully encapsulated in the provider.
662
+ */
663
+ providerMetadata?: LanguageModelV1ProviderMetadata;
664
+ }
665
+ /**
646
666
  Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
647
667
  */
648
668
  interface LanguageModelV1ToolCallPart {
@@ -764,9 +784,9 @@ Specifies how the tool should be selected. Defaults to 'auto'.
764
784
  */
765
785
  prompt: LanguageModelV1Prompt;
766
786
  /**
767
- * Additional provider-specific metadata. They are passed through
768
- * to the provider from the AI SDK and enable provider-specific
769
- * functionality that can be fully encapsulated in the provider.
787
+ Additional provider-specific metadata.
788
+ The metadata is passed through to the provider from the AI SDK and enables
789
+ provider-specific functionality that can be fully encapsulated in the provider.
770
790
  */
771
791
  providerMetadata?: LanguageModelV1ProviderMetadata;
772
792
  };
@@ -1030,7 +1050,7 @@ interface ProviderV1 {
1030
1050
  Returns the language model with the given id.
1031
1051
  The model id is then passed to the provider function to get the model.
1032
1052
 
1033
- @param {string} id - The id of the model to return.
1053
+ @param {string} modelId - The id of the model to return.
1034
1054
 
1035
1055
  @returns {LanguageModel} The language model associated with the id
1036
1056
 
@@ -1041,7 +1061,7 @@ interface ProviderV1 {
1041
1061
  Returns the text embedding model with the given id.
1042
1062
  The model id is then passed to the provider function to get the model.
1043
1063
 
1044
- @param {string} id - The id of the model to return.
1064
+ @param {string} modelId - The id of the model to return.
1045
1065
 
1046
1066
  @returns {LanguageModel} The language model associated with the id
1047
1067
 
@@ -1050,4 +1070,4 @@ interface ProviderV1 {
1050
1070
  textEmbeddingModel(modelId: string): EmbeddingModelV1<string>;
1051
1071
  }
1052
1072
 
1053
- export { AISDKError, APICallError, type EmbeddingModelV1, type EmbeddingModelV1Embedding, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV1, type LanguageModelV1CallOptions, type LanguageModelV1CallWarning, type LanguageModelV1FinishReason, type LanguageModelV1FunctionTool, type LanguageModelV1FunctionToolCall, type LanguageModelV1ImagePart, type LanguageModelV1LogProbs, type LanguageModelV1Message, type LanguageModelV1Prompt, type LanguageModelV1ProviderMetadata, type LanguageModelV1StreamPart, type LanguageModelV1TextPart, type LanguageModelV1ToolCallPart, type LanguageModelV1ToolChoice, type LanguageModelV1ToolResultPart, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, type ProviderV1, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };
1073
+ export { AISDKError, APICallError, type EmbeddingModelV1, type EmbeddingModelV1Embedding, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV1, type LanguageModelV1CallOptions, type LanguageModelV1CallWarning, type LanguageModelV1FilePart, type LanguageModelV1FinishReason, type LanguageModelV1FunctionTool, type LanguageModelV1FunctionToolCall, type LanguageModelV1ImagePart, type LanguageModelV1LogProbs, type LanguageModelV1Message, type LanguageModelV1Prompt, type LanguageModelV1ProviderMetadata, type LanguageModelV1StreamPart, type LanguageModelV1TextPart, type LanguageModelV1ToolCallPart, type LanguageModelV1ToolChoice, type LanguageModelV1ToolResultPart, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, type ProviderV1, TooManyEmbeddingValuesForCallError, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",