@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.mjs
CHANGED
|
@@ -410,7 +410,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
// src/version.ts
|
|
413
|
-
var VERSION = true ? "4.0.
|
|
413
|
+
var VERSION = true ? "4.0.11" : "0.0.0-test";
|
|
414
414
|
|
|
415
415
|
// src/get-from-api.ts
|
|
416
416
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -2023,17 +2023,19 @@ function zodSchema(zodSchema2, options) {
|
|
|
2023
2023
|
// src/validate-types.ts
|
|
2024
2024
|
async function validateTypes({
|
|
2025
2025
|
value,
|
|
2026
|
-
schema
|
|
2026
|
+
schema,
|
|
2027
|
+
context
|
|
2027
2028
|
}) {
|
|
2028
|
-
const result = await safeValidateTypes({ value, schema });
|
|
2029
|
+
const result = await safeValidateTypes({ value, schema, context });
|
|
2029
2030
|
if (!result.success) {
|
|
2030
|
-
throw TypeValidationError2.wrap({ value, cause: result.error });
|
|
2031
|
+
throw TypeValidationError2.wrap({ value, cause: result.error, context });
|
|
2031
2032
|
}
|
|
2032
2033
|
return result.value;
|
|
2033
2034
|
}
|
|
2034
2035
|
async function safeValidateTypes({
|
|
2035
2036
|
value,
|
|
2036
|
-
schema
|
|
2037
|
+
schema,
|
|
2038
|
+
context
|
|
2037
2039
|
}) {
|
|
2038
2040
|
const actualSchema = asSchema(schema);
|
|
2039
2041
|
try {
|
|
@@ -2046,13 +2048,13 @@ async function safeValidateTypes({
|
|
|
2046
2048
|
}
|
|
2047
2049
|
return {
|
|
2048
2050
|
success: false,
|
|
2049
|
-
error: TypeValidationError2.wrap({ value, cause: result.error }),
|
|
2051
|
+
error: TypeValidationError2.wrap({ value, cause: result.error, context }),
|
|
2050
2052
|
rawValue: value
|
|
2051
2053
|
};
|
|
2052
2054
|
} catch (error) {
|
|
2053
2055
|
return {
|
|
2054
2056
|
success: false,
|
|
2055
|
-
error: TypeValidationError2.wrap({ value, cause: error }),
|
|
2057
|
+
error: TypeValidationError2.wrap({ value, cause: error, context }),
|
|
2056
2058
|
rawValue: value
|
|
2057
2059
|
};
|
|
2058
2060
|
}
|