ai 6.0.0-beta.118 → 6.0.0-beta.120

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/dist/index.mjs CHANGED
@@ -32,23 +32,15 @@ function formatWarning({
32
32
  }) {
33
33
  const prefix = `AI SDK Warning (${provider} / ${model}):`;
34
34
  switch (warning.type) {
35
- case "unsupported-setting": {
36
- let message = `${prefix} The "${warning.setting}" setting is not supported.`;
35
+ case "unsupported": {
36
+ let message = `${prefix} The feature "${warning.feature}" is not supported.`;
37
37
  if (warning.details) {
38
38
  message += ` ${warning.details}`;
39
39
  }
40
40
  return message;
41
41
  }
42
42
  case "compatibility": {
43
- let message = `${prefix} The "${warning.feature}" feature is not fully supported.`;
44
- if (warning.details) {
45
- message += ` ${warning.details}`;
46
- }
47
- return message;
48
- }
49
- case "unsupported-tool": {
50
- const toolName = "name" in warning.tool ? warning.tool.name : "unknown tool";
51
- let message = `${prefix} The tool "${toolName}" is not supported.`;
43
+ let message = `${prefix} The feature "${warning.feature}" is used in a compatibility mode.`;
52
44
  if (warning.details) {
53
45
  message += ` ${warning.details}`;
54
46
  }
@@ -783,7 +775,7 @@ import {
783
775
  } from "@ai-sdk/provider-utils";
784
776
 
785
777
  // src/version.ts
786
- var VERSION = true ? "6.0.0-beta.118" : "0.0.0-test";
778
+ var VERSION = true ? "6.0.0-beta.120" : "0.0.0-test";
787
779
 
788
780
  // src/util/download/download.ts
789
781
  var download = async ({ url }) => {
@@ -930,7 +922,13 @@ async function convertToLanguageModelPrompt({
930
922
  supportedUrls
931
923
  );
932
924
  const messages = [
933
- ...prompt.system != null ? [{ role: "system", content: prompt.system }] : [],
925
+ ...prompt.system != null ? typeof prompt.system === "string" ? [{ role: "system", content: prompt.system }] : [
926
+ {
927
+ role: "system",
928
+ content: prompt.system.content,
929
+ providerOptions: prompt.system.providerOptions
930
+ }
931
+ ] : [],
934
932
  ...prompt.messages.map(
935
933
  (message) => convertToLanguageModelMessage({ message, downloadedAssets })
936
934
  )
@@ -1359,7 +1357,9 @@ async function prepareToolsAndToolChoice({
1359
1357
 
1360
1358
  // src/prompt/standardize-prompt.ts
1361
1359
  import { InvalidPromptError as InvalidPromptError2 } from "@ai-sdk/provider";
1362
- import { safeValidateTypes } from "@ai-sdk/provider-utils";
1360
+ import {
1361
+ safeValidateTypes
1362
+ } from "@ai-sdk/provider-utils";
1363
1363
  import { z as z6 } from "zod/v4";
1364
1364
 
1365
1365
  // src/prompt/message.ts
@@ -1587,7 +1587,7 @@ async function standardizePrompt(prompt) {
1587
1587
  message: "prompt and messages cannot be defined at the same time"
1588
1588
  });
1589
1589
  }
1590
- if (prompt.system != null && typeof prompt.system !== "string") {
1590
+ if (prompt.system != null && typeof prompt.system !== "string" && "role" in prompt.system && prompt.system.role !== "system") {
1591
1591
  throw new InvalidPromptError2({
1592
1592
  prompt,
1593
1593
  message: "system must be a string"