@voltagent/server-core 1.0.6 → 1.0.7

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.js CHANGED
@@ -992,7 +992,9 @@ __name(getRoutesByTag, "getRoutesByTag");
992
992
  // src/handlers/agent.handlers.ts
993
993
  var import_core = require("@voltagent/core");
994
994
  var import_internal = require("@voltagent/internal");
995
+ var import_zod2 = require("zod");
995
996
  var import_zod_from_json_schema = require("zod-from-json-schema");
997
+ var import_zod_from_json_schema_v3 = require("zod-from-json-schema-v3");
996
998
 
997
999
  // src/utils/options.ts
998
1000
  function processAgentOptions(body, signal) {
@@ -1215,7 +1217,9 @@ async function handleGenerateObject(agentId, body, deps, logger, signal) {
1215
1217
  }
1216
1218
  const { input, schema: jsonSchema } = body;
1217
1219
  const options = processAgentOptions(body, signal);
1218
- const zodSchema = (0, import_zod_from_json_schema.convertJsonSchemaToZod)(jsonSchema);
1220
+ const zodSchema = ("toJSONSchema" in import_zod2.z ? import_zod_from_json_schema.convertJsonSchemaToZod : import_zod_from_json_schema_v3.convertJsonSchemaToZod)(
1221
+ jsonSchema
1222
+ );
1219
1223
  const result = await agent.generateObject(input, zodSchema, options);
1220
1224
  return {
1221
1225
  success: true,
@@ -1249,7 +1253,9 @@ async function handleStreamObject(agentId, body, deps, logger, signal) {
1249
1253
  }
1250
1254
  const { input, schema: jsonSchema } = body;
1251
1255
  const options = processAgentOptions(body, signal);
1252
- const zodSchema = (0, import_zod_from_json_schema.convertJsonSchemaToZod)(jsonSchema);
1256
+ const zodSchema = ("toJSONSchema" in import_zod2.z ? import_zod_from_json_schema.convertJsonSchemaToZod : import_zod_from_json_schema_v3.convertJsonSchemaToZod)(
1257
+ jsonSchema
1258
+ );
1253
1259
  const result = await agent.streamObject(input, zodSchema, options);
1254
1260
  return result.toTextStreamResponse();
1255
1261
  } catch (error) {