@ai-sdk/provider-utils 4.0.0-beta.53 → 4.0.0-beta.55

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
@@ -63,12 +63,12 @@ function createToolNameMapping({
63
63
  }
64
64
  return {
65
65
  toProviderToolName: (customToolName) => {
66
- var _a;
67
- return (_a = customToolNameToProviderToolName[customToolName]) != null ? _a : customToolName;
66
+ var _a2;
67
+ return (_a2 = customToolNameToProviderToolName[customToolName]) != null ? _a2 : customToolName;
68
68
  },
69
69
  toCustomToolName: (providerToolName) => {
70
- var _a;
71
- return (_a = providerToolNameToCustomToolName[providerToolName]) != null ? _a : providerToolName;
70
+ var _a2;
71
+ return (_a2 = providerToolNameToCustomToolName[providerToolName]) != null ? _a2 : providerToolName;
72
72
  }
73
73
  };
74
74
  }
@@ -126,17 +126,17 @@ var DelayedPromise = class {
126
126
  return this._promise;
127
127
  }
128
128
  resolve(value) {
129
- var _a;
129
+ var _a2;
130
130
  this.status = { type: "resolved", value };
131
131
  if (this._promise) {
132
- (_a = this._resolve) == null ? void 0 : _a.call(this, value);
132
+ (_a2 = this._resolve) == null ? void 0 : _a2.call(this, value);
133
133
  }
134
134
  }
135
135
  reject(error) {
136
- var _a;
136
+ var _a2;
137
137
  this.status = { type: "rejected", error };
138
138
  if (this._promise) {
139
- (_a = this._reject) == null ? void 0 : _a.call(this, error);
139
+ (_a2 = this._reject) == null ? void 0 : _a2.call(this, error);
140
140
  }
141
141
  }
142
142
  isResolved() {
@@ -155,6 +155,99 @@ function extractResponseHeaders(response) {
155
155
  return Object.fromEntries([...response.headers]);
156
156
  }
157
157
 
158
+ // src/uint8-utils.ts
159
+ var { btoa, atob } = globalThis;
160
+ function convertBase64ToUint8Array(base64String) {
161
+ const base64Url = base64String.replace(/-/g, "+").replace(/_/g, "/");
162
+ const latin1string = atob(base64Url);
163
+ return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
164
+ }
165
+ function convertUint8ArrayToBase64(array) {
166
+ let latin1string = "";
167
+ for (let i = 0; i < array.length; i++) {
168
+ latin1string += String.fromCodePoint(array[i]);
169
+ }
170
+ return btoa(latin1string);
171
+ }
172
+ function convertToBase64(value) {
173
+ return value instanceof Uint8Array ? convertUint8ArrayToBase64(value) : value;
174
+ }
175
+
176
+ // src/convert-image-model-file-to-data-uri.ts
177
+ function convertImageModelFileToDataUri(file) {
178
+ if (file.type === "url") return file.url;
179
+ return `data:${file.mediaType};base64,${typeof file.data === "string" ? file.data : convertUint8ArrayToBase64(file.data)}`;
180
+ }
181
+
182
+ // src/convert-to-form-data.ts
183
+ function convertToFormData(input, options = {}) {
184
+ const { useArrayBrackets = true } = options;
185
+ const formData = new FormData();
186
+ for (const [key, value] of Object.entries(input)) {
187
+ if (value == null) {
188
+ continue;
189
+ }
190
+ if (Array.isArray(value)) {
191
+ if (value.length === 1) {
192
+ formData.append(key, value[0]);
193
+ continue;
194
+ }
195
+ const arrayKey = useArrayBrackets ? `${key}[]` : key;
196
+ for (const item of value) {
197
+ formData.append(arrayKey, item);
198
+ }
199
+ continue;
200
+ }
201
+ formData.append(key, value);
202
+ }
203
+ return formData;
204
+ }
205
+
206
+ // src/download-error.ts
207
+ import { AISDKError } from "@ai-sdk/provider";
208
+ var name = "AI_DownloadError";
209
+ var marker = `vercel.ai.error.${name}`;
210
+ var symbol = Symbol.for(marker);
211
+ var _a, _b;
212
+ var DownloadError = class extends (_b = AISDKError, _a = symbol, _b) {
213
+ constructor({
214
+ url,
215
+ statusCode,
216
+ statusText,
217
+ cause,
218
+ message = cause == null ? `Failed to download ${url}: ${statusCode} ${statusText}` : `Failed to download ${url}: ${cause}`
219
+ }) {
220
+ super({ name, message, cause });
221
+ this[_a] = true;
222
+ this.url = url;
223
+ this.statusCode = statusCode;
224
+ this.statusText = statusText;
225
+ }
226
+ static isInstance(error) {
227
+ return AISDKError.hasMarker(error, marker);
228
+ }
229
+ };
230
+
231
+ // src/download-blob.ts
232
+ async function downloadBlob(url) {
233
+ try {
234
+ const response = await fetch(url);
235
+ if (!response.ok) {
236
+ throw new DownloadError({
237
+ url,
238
+ statusCode: response.status,
239
+ statusText: response.statusText
240
+ });
241
+ }
242
+ return await response.blob();
243
+ } catch (error) {
244
+ if (DownloadError.isInstance(error)) {
245
+ throw error;
246
+ }
247
+ throw new DownloadError({ url, cause: error });
248
+ }
249
+ }
250
+
158
251
  // src/generate-id.ts
159
252
  import { InvalidArgumentError } from "@ai-sdk/provider";
160
253
  var createIdGenerator = ({
@@ -238,14 +331,14 @@ function handleFetchError({
238
331
 
239
332
  // src/get-runtime-environment-user-agent.ts
240
333
  function getRuntimeEnvironmentUserAgent(globalThisAny = globalThis) {
241
- var _a, _b, _c;
334
+ var _a2, _b2, _c;
242
335
  if (globalThisAny.window) {
243
336
  return `runtime/browser`;
244
337
  }
245
- if ((_a = globalThisAny.navigator) == null ? void 0 : _a.userAgent) {
338
+ if ((_a2 = globalThisAny.navigator) == null ? void 0 : _a2.userAgent) {
246
339
  return `runtime/${globalThisAny.navigator.userAgent.toLowerCase()}`;
247
340
  }
248
- if ((_c = (_b = globalThisAny.process) == null ? void 0 : _b.versions) == null ? void 0 : _c.node) {
341
+ if ((_c = (_b2 = globalThisAny.process) == null ? void 0 : _b2.versions) == null ? void 0 : _c.node) {
249
342
  return `runtime/node.js/${globalThisAny.process.version.substring(0)}`;
250
343
  }
251
344
  if (globalThisAny.EdgeRuntime) {
@@ -289,7 +382,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
289
382
  }
290
383
 
291
384
  // src/version.ts
292
- var VERSION = true ? "4.0.0-beta.53" : "0.0.0-test";
385
+ var VERSION = true ? "4.0.0-beta.55" : "0.0.0-test";
293
386
 
294
387
  // src/get-from-api.ts
295
388
  var getOriginalFetch = () => globalThis.fetch;
@@ -299,10 +392,10 @@ var getFromApi = async ({
299
392
  successfulResponseHandler,
300
393
  failedResponseHandler,
301
394
  abortSignal,
302
- fetch = getOriginalFetch()
395
+ fetch: fetch2 = getOriginalFetch()
303
396
  }) => {
304
397
  try {
305
- const response = await fetch(url, {
398
+ const response = await fetch2(url, {
306
399
  method: "GET",
307
400
  headers: withUserAgentSuffix(
308
401
  headers,
@@ -386,8 +479,8 @@ function injectJsonInstructionIntoMessages({
386
479
  schemaPrefix,
387
480
  schemaSuffix
388
481
  }) {
389
- var _a, _b;
390
- const systemMessage = ((_a = messages[0]) == null ? void 0 : _a.role) === "system" ? { ...messages[0] } : { role: "system", content: "" };
482
+ var _a2, _b2;
483
+ const systemMessage = ((_a2 = messages[0]) == null ? void 0 : _a2.role) === "system" ? { ...messages[0] } : { role: "system", content: "" };
391
484
  systemMessage.content = injectJsonInstruction({
392
485
  prompt: systemMessage.content,
393
486
  schema,
@@ -396,7 +489,7 @@ function injectJsonInstructionIntoMessages({
396
489
  });
397
490
  return [
398
491
  systemMessage,
399
- ...((_b = messages[0]) == null ? void 0 : _b.role) === "system" ? messages.slice(1) : messages
492
+ ...((_b2 = messages[0]) == null ? void 0 : _b2.role) === "system" ? messages.slice(1) : messages
400
493
  ];
401
494
  }
402
495
 
@@ -509,15 +602,15 @@ function loadSetting({
509
602
 
510
603
  // src/media-type-to-extension.ts
511
604
  function mediaTypeToExtension(mediaType) {
512
- var _a;
605
+ var _a2;
513
606
  const [_type, subtype = ""] = mediaType.toLowerCase().split("/");
514
- return (_a = {
607
+ return (_a2 = {
515
608
  mpeg: "mp3",
516
609
  "x-wav": "wav",
517
610
  opus: "ogg",
518
611
  mp4: "m4a",
519
612
  "x-m4a": "m4a"
520
- }[subtype]) != null ? _a : subtype;
613
+ }[subtype]) != null ? _a2 : subtype;
521
614
  }
522
615
 
523
616
  // src/parse-json.ts
@@ -653,11 +746,11 @@ function parseAnyDef() {
653
746
  // src/to-json-schema/zod3-to-json-schema/parsers/array.ts
654
747
  import { ZodFirstPartyTypeKind } from "zod/v3";
655
748
  function parseArrayDef(def, refs) {
656
- var _a, _b, _c;
749
+ var _a2, _b2, _c;
657
750
  const res = {
658
751
  type: "array"
659
752
  };
660
- if (((_a = def.type) == null ? void 0 : _a._def) && ((_c = (_b = def.type) == null ? void 0 : _b._def) == null ? void 0 : _c.typeName) !== ZodFirstPartyTypeKind.ZodAny) {
753
+ if (((_a2 = def.type) == null ? void 0 : _a2._def) && ((_c = (_b2 = def.type) == null ? void 0 : _b2._def) == null ? void 0 : _c.typeName) !== ZodFirstPartyTypeKind.ZodAny) {
661
754
  res.items = parseDef(def.type._def, {
662
755
  ...refs,
663
756
  currentPath: [...refs.currentPath, "items"]
@@ -1050,8 +1143,8 @@ function escapeNonAlphaNumeric(source) {
1050
1143
  return result;
1051
1144
  }
1052
1145
  function addFormat(schema, value, message, refs) {
1053
- var _a;
1054
- if (schema.format || ((_a = schema.anyOf) == null ? void 0 : _a.some((x) => x.format))) {
1146
+ var _a2;
1147
+ if (schema.format || ((_a2 = schema.anyOf) == null ? void 0 : _a2.some((x) => x.format))) {
1055
1148
  if (!schema.anyOf) {
1056
1149
  schema.anyOf = [];
1057
1150
  }
@@ -1070,8 +1163,8 @@ function addFormat(schema, value, message, refs) {
1070
1163
  }
1071
1164
  }
1072
1165
  function addPattern(schema, regex, message, refs) {
1073
- var _a;
1074
- if (schema.pattern || ((_a = schema.allOf) == null ? void 0 : _a.some((x) => x.pattern))) {
1166
+ var _a2;
1167
+ if (schema.pattern || ((_a2 = schema.allOf) == null ? void 0 : _a2.some((x) => x.pattern))) {
1075
1168
  if (!schema.allOf) {
1076
1169
  schema.allOf = [];
1077
1170
  }
@@ -1090,7 +1183,7 @@ function addPattern(schema, regex, message, refs) {
1090
1183
  }
1091
1184
  }
1092
1185
  function stringifyRegExpWithFlags(regex, refs) {
1093
- var _a;
1186
+ var _a2;
1094
1187
  if (!refs.applyRegexFlags || !regex.flags) {
1095
1188
  return regex.source;
1096
1189
  }
@@ -1120,7 +1213,7 @@ function stringifyRegExpWithFlags(regex, refs) {
1120
1213
  pattern += source[i];
1121
1214
  pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
1122
1215
  inCharRange = false;
1123
- } else if (source[i + 1] === "-" && ((_a = source[i + 2]) == null ? void 0 : _a.match(/[a-z]/))) {
1216
+ } else if (source[i + 1] === "-" && ((_a2 = source[i + 2]) == null ? void 0 : _a2.match(/[a-z]/))) {
1124
1217
  pattern += source[i];
1125
1218
  inCharRange = true;
1126
1219
  } else {
@@ -1174,15 +1267,15 @@ function stringifyRegExpWithFlags(regex, refs) {
1174
1267
 
1175
1268
  // src/to-json-schema/zod3-to-json-schema/parsers/record.ts
1176
1269
  function parseRecordDef(def, refs) {
1177
- var _a, _b, _c, _d, _e, _f;
1270
+ var _a2, _b2, _c, _d, _e, _f;
1178
1271
  const schema = {
1179
1272
  type: "object",
1180
- additionalProperties: (_a = parseDef(def.valueType._def, {
1273
+ additionalProperties: (_a2 = parseDef(def.valueType._def, {
1181
1274
  ...refs,
1182
1275
  currentPath: [...refs.currentPath, "additionalProperties"]
1183
- })) != null ? _a : refs.allowedAdditionalProperties
1276
+ })) != null ? _a2 : refs.allowedAdditionalProperties
1184
1277
  };
1185
- if (((_b = def.keyType) == null ? void 0 : _b._def.typeName) === ZodFirstPartyTypeKind2.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {
1278
+ if (((_b2 = def.keyType) == null ? void 0 : _b2._def.typeName) === ZodFirstPartyTypeKind2.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {
1186
1279
  const { type, ...keyType } = parseStringDef(def.keyType._def, refs);
1187
1280
  return {
1188
1281
  ...schema,
@@ -1455,8 +1548,8 @@ function safeIsOptional(schema) {
1455
1548
 
1456
1549
  // src/to-json-schema/zod3-to-json-schema/parsers/optional.ts
1457
1550
  var parseOptionalDef = (def, refs) => {
1458
- var _a;
1459
- if (refs.currentPath.toString() === ((_a = refs.propertyPath) == null ? void 0 : _a.toString())) {
1551
+ var _a2;
1552
+ if (refs.currentPath.toString() === ((_a2 = refs.propertyPath) == null ? void 0 : _a2.toString())) {
1460
1553
  return parseDef(def.innerType._def, refs);
1461
1554
  }
1462
1555
  const innerSchema = parseDef(def.innerType._def, {
@@ -1653,10 +1746,10 @@ var getRelativePath = (pathA, pathB) => {
1653
1746
 
1654
1747
  // src/to-json-schema/zod3-to-json-schema/parse-def.ts
1655
1748
  function parseDef(def, refs, forceResolution = false) {
1656
- var _a;
1749
+ var _a2;
1657
1750
  const seenItem = refs.seen.get(def);
1658
1751
  if (refs.override) {
1659
- const overrideResult = (_a = refs.override) == null ? void 0 : _a.call(
1752
+ const overrideResult = (_a2 = refs.override) == null ? void 0 : _a2.call(
1660
1753
  refs,
1661
1754
  def,
1662
1755
  refs,
@@ -1724,11 +1817,11 @@ var getRefs = (options) => {
1724
1817
  currentPath,
1725
1818
  propertyPath: void 0,
1726
1819
  seen: new Map(
1727
- Object.entries(_options.definitions).map(([name, def]) => [
1820
+ Object.entries(_options.definitions).map(([name2, def]) => [
1728
1821
  def._def,
1729
1822
  {
1730
1823
  def: def._def,
1731
- path: [..._options.basePath, _options.definitionPath, name],
1824
+ path: [..._options.basePath, _options.definitionPath, name2],
1732
1825
  // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
1733
1826
  jsonSchema: void 0
1734
1827
  }
@@ -1739,50 +1832,50 @@ var getRefs = (options) => {
1739
1832
 
1740
1833
  // src/to-json-schema/zod3-to-json-schema/zod3-to-json-schema.ts
1741
1834
  var zod3ToJsonSchema = (schema, options) => {
1742
- var _a;
1835
+ var _a2;
1743
1836
  const refs = getRefs(options);
1744
1837
  let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce(
1745
- (acc, [name2, schema2]) => {
1746
- var _a2;
1838
+ (acc, [name3, schema2]) => {
1839
+ var _a3;
1747
1840
  return {
1748
1841
  ...acc,
1749
- [name2]: (_a2 = parseDef(
1842
+ [name3]: (_a3 = parseDef(
1750
1843
  schema2._def,
1751
1844
  {
1752
1845
  ...refs,
1753
- currentPath: [...refs.basePath, refs.definitionPath, name2]
1846
+ currentPath: [...refs.basePath, refs.definitionPath, name3]
1754
1847
  },
1755
1848
  true
1756
- )) != null ? _a2 : parseAnyDef()
1849
+ )) != null ? _a3 : parseAnyDef()
1757
1850
  };
1758
1851
  },
1759
1852
  {}
1760
1853
  ) : void 0;
1761
- const name = typeof options === "string" ? options : (options == null ? void 0 : options.nameStrategy) === "title" ? void 0 : options == null ? void 0 : options.name;
1762
- const main = (_a = parseDef(
1854
+ const name2 = typeof options === "string" ? options : (options == null ? void 0 : options.nameStrategy) === "title" ? void 0 : options == null ? void 0 : options.name;
1855
+ const main = (_a2 = parseDef(
1763
1856
  schema._def,
1764
- name === void 0 ? refs : {
1857
+ name2 === void 0 ? refs : {
1765
1858
  ...refs,
1766
- currentPath: [...refs.basePath, refs.definitionPath, name]
1859
+ currentPath: [...refs.basePath, refs.definitionPath, name2]
1767
1860
  },
1768
1861
  false
1769
- )) != null ? _a : parseAnyDef();
1862
+ )) != null ? _a2 : parseAnyDef();
1770
1863
  const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
1771
1864
  if (title !== void 0) {
1772
1865
  main.title = title;
1773
1866
  }
1774
- const combined = name === void 0 ? definitions ? {
1867
+ const combined = name2 === void 0 ? definitions ? {
1775
1868
  ...main,
1776
1869
  [refs.definitionPath]: definitions
1777
1870
  } : main : {
1778
1871
  $ref: [
1779
1872
  ...refs.$refStrategy === "relative" ? [] : refs.basePath,
1780
1873
  refs.definitionPath,
1781
- name
1874
+ name2
1782
1875
  ].join("/"),
1783
1876
  [refs.definitionPath]: {
1784
1877
  ...definitions,
1785
- [name]: main
1878
+ [name2]: main
1786
1879
  }
1787
1880
  };
1788
1881
  combined.$schema = "http://json-schema.org/draft-07/schema#";
@@ -1842,8 +1935,8 @@ function standardSchema(standardSchema2) {
1842
1935
  );
1843
1936
  }
1844
1937
  function zod3Schema(zodSchema2, options) {
1845
- var _a;
1846
- const useReferences = (_a = options == null ? void 0 : options.useReferences) != null ? _a : false;
1938
+ var _a2;
1939
+ const useReferences = (_a2 = options == null ? void 0 : options.useReferences) != null ? _a2 : false;
1847
1940
  return jsonSchema(
1848
1941
  // defer json schema creation to avoid unnecessary computation when only validation is needed
1849
1942
  () => zod3ToJsonSchema(zodSchema2, {
@@ -1858,8 +1951,8 @@ function zod3Schema(zodSchema2, options) {
1858
1951
  );
1859
1952
  }
1860
1953
  function zod4Schema(zodSchema2, options) {
1861
- var _a;
1862
- const useReferences = (_a = options == null ? void 0 : options.useReferences) != null ? _a : false;
1954
+ var _a2;
1955
+ const useReferences = (_a2 = options == null ? void 0 : options.useReferences) != null ? _a2 : false;
1863
1956
  return jsonSchema(
1864
1957
  // defer json schema creation to avoid unnecessary computation when only validation is needed
1865
1958
  () => addAdditionalPropertiesToJsonSchema(
@@ -2025,7 +2118,7 @@ var postJsonToApi = async ({
2025
2118
  failedResponseHandler,
2026
2119
  successfulResponseHandler,
2027
2120
  abortSignal,
2028
- fetch
2121
+ fetch: fetch2
2029
2122
  }) => postToApi({
2030
2123
  url,
2031
2124
  headers: {
@@ -2039,7 +2132,7 @@ var postJsonToApi = async ({
2039
2132
  failedResponseHandler,
2040
2133
  successfulResponseHandler,
2041
2134
  abortSignal,
2042
- fetch
2135
+ fetch: fetch2
2043
2136
  });
2044
2137
  var postFormDataToApi = async ({
2045
2138
  url,
@@ -2048,7 +2141,7 @@ var postFormDataToApi = async ({
2048
2141
  failedResponseHandler,
2049
2142
  successfulResponseHandler,
2050
2143
  abortSignal,
2051
- fetch
2144
+ fetch: fetch2
2052
2145
  }) => postToApi({
2053
2146
  url,
2054
2147
  headers,
@@ -2059,7 +2152,7 @@ var postFormDataToApi = async ({
2059
2152
  failedResponseHandler,
2060
2153
  successfulResponseHandler,
2061
2154
  abortSignal,
2062
- fetch
2155
+ fetch: fetch2
2063
2156
  });
2064
2157
  var postToApi = async ({
2065
2158
  url,
@@ -2068,10 +2161,10 @@ var postToApi = async ({
2068
2161
  successfulResponseHandler,
2069
2162
  failedResponseHandler,
2070
2163
  abortSignal,
2071
- fetch = getOriginalFetch2()
2164
+ fetch: fetch2 = getOriginalFetch2()
2072
2165
  }) => {
2073
2166
  try {
2074
- const response = await fetch(url, {
2167
+ const response = await fetch2(url, {
2075
2168
  method: "POST",
2076
2169
  headers: withUserAgentSuffix(
2077
2170
  headers,
@@ -2170,7 +2263,8 @@ function createProviderToolFactory({
2170
2263
  function createProviderToolFactoryWithOutputSchema({
2171
2264
  id,
2172
2265
  inputSchema,
2173
- outputSchema
2266
+ outputSchema,
2267
+ supportsDeferredResults
2174
2268
  }) {
2175
2269
  return ({
2176
2270
  execute,
@@ -2191,7 +2285,8 @@ function createProviderToolFactoryWithOutputSchema({
2191
2285
  toModelOutput,
2192
2286
  onInputStart,
2193
2287
  onInputDelta,
2194
- onInputAvailable
2288
+ onInputAvailable,
2289
+ supportsDeferredResults
2195
2290
  });
2196
2291
  }
2197
2292
 
@@ -2349,24 +2444,6 @@ var createStatusCodeErrorResponseHandler = () => async ({ response, url, request
2349
2444
  };
2350
2445
  };
2351
2446
 
2352
- // src/uint8-utils.ts
2353
- var { btoa, atob } = globalThis;
2354
- function convertBase64ToUint8Array(base64String) {
2355
- const base64Url = base64String.replace(/-/g, "+").replace(/_/g, "/");
2356
- const latin1string = atob(base64Url);
2357
- return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
2358
- }
2359
- function convertUint8ArrayToBase64(array) {
2360
- let latin1string = "";
2361
- for (let i = 0; i < array.length; i++) {
2362
- latin1string += String.fromCodePoint(array[i]);
2363
- }
2364
- return btoa(latin1string);
2365
- }
2366
- function convertToBase64(value) {
2367
- return value instanceof Uint8Array ? convertUint8ArrayToBase64(value) : value;
2368
- }
2369
-
2370
2447
  // src/without-trailing-slash.ts
2371
2448
  function withoutTrailingSlash(url) {
2372
2449
  return url == null ? void 0 : url.replace(/\/$/, "");
@@ -2403,13 +2480,16 @@ import {
2403
2480
  } from "eventsource-parser/stream";
2404
2481
  export {
2405
2482
  DelayedPromise,
2483
+ DownloadError,
2406
2484
  EventSourceParserStream2 as EventSourceParserStream,
2407
2485
  VERSION,
2408
2486
  asSchema,
2409
2487
  combineHeaders,
2410
2488
  convertAsyncIteratorToReadableStream,
2411
2489
  convertBase64ToUint8Array,
2490
+ convertImageModelFileToDataUri,
2412
2491
  convertToBase64,
2492
+ convertToFormData,
2413
2493
  convertUint8ArrayToBase64,
2414
2494
  createBinaryResponseHandler,
2415
2495
  createEventSourceResponseHandler,
@@ -2421,6 +2501,7 @@ export {
2421
2501
  createStatusCodeErrorResponseHandler,
2422
2502
  createToolNameMapping,
2423
2503
  delay,
2504
+ downloadBlob,
2424
2505
  dynamicTool,
2425
2506
  executeTool,
2426
2507
  extractResponseHeaders,