ai 6.0.74 → 6.0.75

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,15 @@
1
1
  # ai
2
2
 
3
+ ## 6.0.75
4
+
5
+ ### Patch Changes
6
+
7
+ - 7168375: feat (ai, provider): default global provider video model resolution
8
+ - Updated dependencies [7168375]
9
+ - @ai-sdk/provider@3.0.8
10
+ - @ai-sdk/gateway@3.0.37
11
+ - @ai-sdk/provider-utils@4.0.14
12
+
3
13
  ## 6.0.74
4
14
 
5
15
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -5617,13 +5617,14 @@ declare function wrapProvider({ provider, languageModelMiddleware, imageModelMid
5617
5617
  *
5618
5618
  * @throws {NoSuchModelError} Throws when a requested model is not found and no fallback provider is available.
5619
5619
  */
5620
- declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageModelV3>, EMBEDDING_MODELS extends Record<string, EmbeddingModelV3>, IMAGE_MODELS extends Record<string, ImageModelV3>, TRANSCRIPTION_MODELS extends Record<string, TranscriptionModelV3>, SPEECH_MODELS extends Record<string, SpeechModelV3>, RERANKING_MODELS extends Record<string, RerankingModelV3>>({ languageModels, embeddingModels, imageModels, transcriptionModels, speechModels, rerankingModels, fallbackProvider: fallbackProviderArg, }: {
5620
+ declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageModelV3>, EMBEDDING_MODELS extends Record<string, EmbeddingModelV3>, IMAGE_MODELS extends Record<string, ImageModelV3>, TRANSCRIPTION_MODELS extends Record<string, TranscriptionModelV3>, SPEECH_MODELS extends Record<string, SpeechModelV3>, RERANKING_MODELS extends Record<string, RerankingModelV3>, VIDEO_MODELS extends Record<string, Experimental_VideoModelV3>>({ languageModels, embeddingModels, imageModels, transcriptionModels, speechModels, rerankingModels, videoModels, fallbackProvider: fallbackProviderArg, }: {
5621
5621
  languageModels?: LANGUAGE_MODELS;
5622
5622
  embeddingModels?: EMBEDDING_MODELS;
5623
5623
  imageModels?: IMAGE_MODELS;
5624
5624
  transcriptionModels?: TRANSCRIPTION_MODELS;
5625
5625
  speechModels?: SPEECH_MODELS;
5626
5626
  rerankingModels?: RERANKING_MODELS;
5627
+ videoModels?: VIDEO_MODELS;
5627
5628
  fallbackProvider?: ProviderV3 | ProviderV2;
5628
5629
  }): ProviderV3 & {
5629
5630
  languageModel(modelId: ExtractModelId<LANGUAGE_MODELS>): LanguageModelV3;
@@ -5632,6 +5633,7 @@ declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageM
5632
5633
  transcriptionModel(modelId: ExtractModelId<TRANSCRIPTION_MODELS>): TranscriptionModelV3;
5633
5634
  rerankingModel(modelId: ExtractModelId<RERANKING_MODELS>): RerankingModelV3;
5634
5635
  speechModel(modelId: ExtractModelId<SPEECH_MODELS>): SpeechModelV3;
5636
+ videoModel(modelId: ExtractModelId<VIDEO_MODELS>): Experimental_VideoModelV3;
5635
5637
  };
5636
5638
  /**
5637
5639
  * @deprecated Use `customProvider` instead.
package/dist/index.d.ts CHANGED
@@ -5617,13 +5617,14 @@ declare function wrapProvider({ provider, languageModelMiddleware, imageModelMid
5617
5617
  *
5618
5618
  * @throws {NoSuchModelError} Throws when a requested model is not found and no fallback provider is available.
5619
5619
  */
5620
- declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageModelV3>, EMBEDDING_MODELS extends Record<string, EmbeddingModelV3>, IMAGE_MODELS extends Record<string, ImageModelV3>, TRANSCRIPTION_MODELS extends Record<string, TranscriptionModelV3>, SPEECH_MODELS extends Record<string, SpeechModelV3>, RERANKING_MODELS extends Record<string, RerankingModelV3>>({ languageModels, embeddingModels, imageModels, transcriptionModels, speechModels, rerankingModels, fallbackProvider: fallbackProviderArg, }: {
5620
+ declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageModelV3>, EMBEDDING_MODELS extends Record<string, EmbeddingModelV3>, IMAGE_MODELS extends Record<string, ImageModelV3>, TRANSCRIPTION_MODELS extends Record<string, TranscriptionModelV3>, SPEECH_MODELS extends Record<string, SpeechModelV3>, RERANKING_MODELS extends Record<string, RerankingModelV3>, VIDEO_MODELS extends Record<string, Experimental_VideoModelV3>>({ languageModels, embeddingModels, imageModels, transcriptionModels, speechModels, rerankingModels, videoModels, fallbackProvider: fallbackProviderArg, }: {
5621
5621
  languageModels?: LANGUAGE_MODELS;
5622
5622
  embeddingModels?: EMBEDDING_MODELS;
5623
5623
  imageModels?: IMAGE_MODELS;
5624
5624
  transcriptionModels?: TRANSCRIPTION_MODELS;
5625
5625
  speechModels?: SPEECH_MODELS;
5626
5626
  rerankingModels?: RERANKING_MODELS;
5627
+ videoModels?: VIDEO_MODELS;
5627
5628
  fallbackProvider?: ProviderV3 | ProviderV2;
5628
5629
  }): ProviderV3 & {
5629
5630
  languageModel(modelId: ExtractModelId<LANGUAGE_MODELS>): LanguageModelV3;
@@ -5632,6 +5633,7 @@ declare function customProvider<LANGUAGE_MODELS extends Record<string, LanguageM
5632
5633
  transcriptionModel(modelId: ExtractModelId<TRANSCRIPTION_MODELS>): TranscriptionModelV3;
5633
5634
  rerankingModel(modelId: ExtractModelId<RERANKING_MODELS>): RerankingModelV3;
5634
5635
  speechModel(modelId: ExtractModelId<SPEECH_MODELS>): SpeechModelV3;
5636
+ videoModel(modelId: ExtractModelId<VIDEO_MODELS>): Experimental_VideoModelV3;
5635
5637
  };
5636
5638
  /**
5637
5639
  * @deprecated Use `customProvider` instead.
package/dist/index.js CHANGED
@@ -928,9 +928,14 @@ function resolveImageModel(model) {
928
928
  }
929
929
  function resolveVideoModel(model) {
930
930
  if (typeof model === "string") {
931
- throw new Error(
932
- 'Video models cannot be resolved from strings. Please use a Experimental_VideoModelV3 object from a provider (e.g., fal.video("model-id")).'
933
- );
931
+ const provider = getGlobalProvider();
932
+ const videoModel = provider.videoModel;
933
+ if (!videoModel) {
934
+ throw new Error(
935
+ 'The default provider does not support video models. Please use a Experimental_VideoModelV3 object from a provider (e.g., vertex.video("model-id")).'
936
+ );
937
+ }
938
+ return videoModel(model);
934
939
  }
935
940
  if (model.specificationVersion !== "v3") {
936
941
  const unsupportedModel = model;
@@ -1205,7 +1210,7 @@ var import_provider_utils3 = require("@ai-sdk/provider-utils");
1205
1210
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
1206
1211
 
1207
1212
  // src/version.ts
1208
- var VERSION = true ? "6.0.74" : "0.0.0-test";
1213
+ var VERSION = true ? "6.0.75" : "0.0.0-test";
1209
1214
 
1210
1215
  // src/util/download/download.ts
1211
1216
  var download = async ({ url }) => {
@@ -11659,6 +11664,7 @@ function customProvider({
11659
11664
  transcriptionModels,
11660
11665
  speechModels,
11661
11666
  rerankingModels,
11667
+ videoModels,
11662
11668
  fallbackProvider: fallbackProviderArg
11663
11669
  }) {
11664
11670
  const fallbackProvider = fallbackProviderArg ? asProviderV3(fallbackProviderArg) : void 0;
@@ -11717,6 +11723,16 @@ function customProvider({
11717
11723
  return fallbackProvider.rerankingModel(modelId);
11718
11724
  }
11719
11725
  throw new import_provider33.NoSuchModelError({ modelId, modelType: "rerankingModel" });
11726
+ },
11727
+ videoModel(modelId) {
11728
+ if (videoModels != null && modelId in videoModels) {
11729
+ return videoModels[modelId];
11730
+ }
11731
+ const videoModel = fallbackProvider == null ? void 0 : fallbackProvider.videoModel;
11732
+ if (videoModel) {
11733
+ return videoModel(modelId);
11734
+ }
11735
+ throw new import_provider33.NoSuchModelError({ modelId, modelType: "videoModel" });
11720
11736
  }
11721
11737
  };
11722
11738
  }