@ai-sdk/provider-utils 4.0.35 → 4.0.37

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.35",
3
+ "version": "4.0.37",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -59,6 +59,7 @@ export {
59
59
  type Schema,
60
60
  type ValidationResult,
61
61
  } from './schema';
62
+ export { secureJsonParse } from './secure-json-parse';
62
63
  export { stripFileExtension } from './strip-file-extension';
63
64
  export * from './uint8-utils';
64
65
  export { validateDownloadUrl } from './validate-download-url';
package/src/schema.ts CHANGED
@@ -136,7 +136,11 @@ export function asSchema<OBJECT>(
136
136
  schema: FlexibleSchema<OBJECT> | undefined,
137
137
  ): Schema<OBJECT> {
138
138
  return schema == null
139
- ? jsonSchema({ properties: {}, additionalProperties: false })
139
+ ? jsonSchema({
140
+ type: 'object',
141
+ properties: {},
142
+ additionalProperties: false,
143
+ })
140
144
  : isSchema(schema)
141
145
  ? schema
142
146
  : '~standard' in schema
package/src/types/tool.ts CHANGED
@@ -198,6 +198,8 @@ export type Tool<
198
198
  * Optional conversion function that maps the tool result to an output that can be used by the language model.
199
199
  *
200
200
  * If not provided, the tool result will be sent as a JSON object.
201
+ *
202
+ * This function is invoked on the server by `convertToModelMessages`, so ensure that you pass the same "tools" (ToolSet) to both "convertToModelMessages" and "streamText" (or other generation APIs).
201
203
  */
202
204
  toModelOutput?: (options: {
203
205
  /**