ai 3.1.5 → 3.1.6

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.d.mts CHANGED
@@ -978,9 +978,13 @@ interface Message$1 {
978
978
  tool_call_id?: string;
979
979
  createdAt?: Date;
980
980
  content: string;
981
+ /**
982
+ @deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
983
+ */
981
984
  ui?: string | JSX.Element | JSX.Element[] | null | undefined;
982
985
  role: 'system' | 'user' | 'assistant' | 'function' | 'data' | 'tool';
983
986
  /**
987
+ *
984
988
  * If the message has a role of `function`, the `name` field is the name of the function.
985
989
  * Otherwise, the name field should not be set.
986
990
  */
@@ -2008,11 +2012,16 @@ type Payload = {
2008
2012
  ui: UINode | Promise<UINode>;
2009
2013
  content: string;
2010
2014
  };
2015
+ /**
2016
+ @deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
2017
+ */
2011
2018
  type ReactResponseRow = Payload & {
2012
2019
  next: null | Promise<ReactResponseRow>;
2013
2020
  };
2014
2021
  /**
2015
- * A utility class for streaming React responses.
2022
+ A utility class for streaming React responses.
2023
+
2024
+ @deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
2016
2025
  */
2017
2026
  declare class experimental_StreamingReactResponse {
2018
2027
  constructor(res: ReadableStream, options?: {
package/dist/index.d.ts CHANGED
@@ -978,9 +978,13 @@ interface Message$1 {
978
978
  tool_call_id?: string;
979
979
  createdAt?: Date;
980
980
  content: string;
981
+ /**
982
+ @deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
983
+ */
981
984
  ui?: string | JSX.Element | JSX.Element[] | null | undefined;
982
985
  role: 'system' | 'user' | 'assistant' | 'function' | 'data' | 'tool';
983
986
  /**
987
+ *
984
988
  * If the message has a role of `function`, the `name` field is the name of the function.
985
989
  * Otherwise, the name field should not be set.
986
990
  */
@@ -2008,11 +2012,16 @@ type Payload = {
2008
2012
  ui: UINode | Promise<UINode>;
2009
2013
  content: string;
2010
2014
  };
2015
+ /**
2016
+ @deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
2017
+ */
2011
2018
  type ReactResponseRow = Payload & {
2012
2019
  next: null | Promise<ReactResponseRow>;
2013
2020
  };
2014
2021
  /**
2015
- * A utility class for streaming React responses.
2022
+ A utility class for streaming React responses.
2023
+
2024
+ @deprecated Use AI SDK RSC instead: https://sdk.vercel.ai/docs/ai-sdk-rsc
2016
2025
  */
2017
2026
  declare class experimental_StreamingReactResponse {
2018
2027
  constructor(res: ReadableStream, options?: {
package/dist/index.js CHANGED
@@ -145,7 +145,15 @@ function convertDataContentToUint8Array(content) {
145
145
  return content;
146
146
  }
147
147
  if (typeof content === "string") {
148
- return (0, import_provider_utils.convertBase64ToUint8Array)(content);
148
+ try {
149
+ return (0, import_provider_utils.convertBase64ToUint8Array)(content);
150
+ } catch (error) {
151
+ throw new import_provider.InvalidDataContentError({
152
+ message: "Invalid data content. Content string is not a base64-encoded image.",
153
+ content,
154
+ cause: error
155
+ });
156
+ }
149
157
  }
150
158
  if (content instanceof ArrayBuffer) {
151
159
  return new Uint8Array(content);