@ai-sdk/provider-utils 4.0.10 → 4.0.11
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 +8 -0
- package/dist/index.d.mts +170 -166
- package/dist/index.d.ts +170 -166
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/extract-response-headers.ts +5 -5
- package/src/generate-id.ts +11 -11
- package/src/types/assistant-model-message.ts +6 -6
- package/src/types/content-part.ts +70 -70
- package/src/types/data-content.ts +1 -1
- package/src/types/model-message.ts +2 -2
- package/src/types/provider-options.ts +4 -4
- package/src/types/system-model-message.ts +9 -9
- package/src/types/tool-call.ts +7 -7
- package/src/types/tool-model-message.ts +5 -5
- package/src/types/tool-result.ts +8 -8
- package/src/types/tool.ts +28 -28
- package/src/types/user-model-message.ts +7 -7
- package/src/validate-types.ts +11 -5
package/dist/index.js
CHANGED
|
@@ -503,7 +503,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
503
503
|
}
|
|
504
504
|
|
|
505
505
|
// src/version.ts
|
|
506
|
-
var VERSION = true ? "4.0.
|
|
506
|
+
var VERSION = true ? "4.0.11" : "0.0.0-test";
|
|
507
507
|
|
|
508
508
|
// src/get-from-api.ts
|
|
509
509
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -2111,17 +2111,19 @@ function zodSchema(zodSchema2, options) {
|
|
|
2111
2111
|
// src/validate-types.ts
|
|
2112
2112
|
async function validateTypes({
|
|
2113
2113
|
value,
|
|
2114
|
-
schema
|
|
2114
|
+
schema,
|
|
2115
|
+
context
|
|
2115
2116
|
}) {
|
|
2116
|
-
const result = await safeValidateTypes({ value, schema });
|
|
2117
|
+
const result = await safeValidateTypes({ value, schema, context });
|
|
2117
2118
|
if (!result.success) {
|
|
2118
|
-
throw import_provider8.TypeValidationError.wrap({ value, cause: result.error });
|
|
2119
|
+
throw import_provider8.TypeValidationError.wrap({ value, cause: result.error, context });
|
|
2119
2120
|
}
|
|
2120
2121
|
return result.value;
|
|
2121
2122
|
}
|
|
2122
2123
|
async function safeValidateTypes({
|
|
2123
2124
|
value,
|
|
2124
|
-
schema
|
|
2125
|
+
schema,
|
|
2126
|
+
context
|
|
2125
2127
|
}) {
|
|
2126
2128
|
const actualSchema = asSchema(schema);
|
|
2127
2129
|
try {
|
|
@@ -2134,13 +2136,13 @@ async function safeValidateTypes({
|
|
|
2134
2136
|
}
|
|
2135
2137
|
return {
|
|
2136
2138
|
success: false,
|
|
2137
|
-
error: import_provider8.TypeValidationError.wrap({ value, cause: result.error }),
|
|
2139
|
+
error: import_provider8.TypeValidationError.wrap({ value, cause: result.error, context }),
|
|
2138
2140
|
rawValue: value
|
|
2139
2141
|
};
|
|
2140
2142
|
} catch (error) {
|
|
2141
2143
|
return {
|
|
2142
2144
|
success: false,
|
|
2143
|
-
error: import_provider8.TypeValidationError.wrap({ value, cause: error }),
|
|
2145
|
+
error: import_provider8.TypeValidationError.wrap({ value, cause: error, context }),
|
|
2144
2146
|
rawValue: value
|
|
2145
2147
|
};
|
|
2146
2148
|
}
|