@ai-sdk/provider-utils 4.0.47 → 4.0.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider-utils",
3
- "version": "4.0.47",
3
+ "version": "4.0.49",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Symbol for exposing the UTF-8 input byte budget of an embedding model.
3
+ *
4
+ * This capability is experimental and intentionally lives outside the versioned
5
+ * embedding model specification.
6
+ */
7
+ export const EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL = Symbol.for(
8
+ 'vercel.ai.embeddingModel.maxInputBytesPerCall',
9
+ );
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ export {
15
15
  readResponseWithSizeLimit,
16
16
  DEFAULT_MAX_DOWNLOAD_SIZE,
17
17
  } from './read-response-with-size-limit';
18
+ export { EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL as EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL } from './embedding-model-capabilities';
18
19
  export { fetchWithValidatedRedirects } from './fetch-with-validated-redirects';
19
20
  export * from './fetch-function';
20
21
  export { createIdGenerator, generateId, type IdGenerator } from './generate-id';
@@ -131,7 +131,11 @@ export async function getDefaultDownloadFetch(): Promise<FetchFunction> {
131
131
  return (safeNodeFetchPromise ??= createSafeNodeFetch());
132
132
  }
133
133
 
134
- function isNodeDefaultFetch(fetch: FetchFunction): boolean {
134
+ function isNodeDefaultFetch(fetch: unknown): boolean {
135
+ if (typeof fetch !== 'function') {
136
+ return false;
137
+ }
138
+
135
139
  const source = Function.prototype.toString.call(fetch);
136
140
  return (
137
141
  source.includes('internal/deps/undici') ||