@voltagent/server-core 1.0.36 → 2.0.1
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/edge.js +6 -6
- package/dist/edge.js.map +1 -1
- package/dist/edge.mjs +6 -6
- package/dist/edge.mjs.map +1 -1
- package/dist/index.d.mts +21 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.js +9 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -5
package/dist/edge.js
CHANGED
|
@@ -966,15 +966,15 @@ function processAgentOptions(body, signal) {
|
|
|
966
966
|
if (options.context && typeof options.context === "object" && !(options.context instanceof Map)) {
|
|
967
967
|
processedOptions.context = new Map(Object.entries(options.context));
|
|
968
968
|
}
|
|
969
|
-
if (options.
|
|
970
|
-
const { type, schema: jsonSchema } = options.
|
|
969
|
+
if (options.output) {
|
|
970
|
+
const { type, schema: jsonSchema } = options.output;
|
|
971
971
|
if (type === "object" && jsonSchema) {
|
|
972
972
|
const zodSchema = ("toJSONSchema" in import_zod.z ? import_zod_from_json_schema.convertJsonSchemaToZod : import_zod_from_json_schema_v3.convertJsonSchemaToZod)(
|
|
973
973
|
jsonSchema
|
|
974
974
|
);
|
|
975
|
-
processedOptions.
|
|
975
|
+
processedOptions.output = import_ai.Output.object({ schema: zodSchema });
|
|
976
976
|
} else if (type === "text") {
|
|
977
|
-
processedOptions.
|
|
977
|
+
processedOptions.output = import_ai.Output.text();
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
980
|
return processedOptions;
|
|
@@ -1056,10 +1056,10 @@ async function handleGenerateText(agentId, body, deps, logger, signal) {
|
|
|
1056
1056
|
finishReason: result.finishReason,
|
|
1057
1057
|
toolCalls: result.toolCalls,
|
|
1058
1058
|
toolResults: result.toolResults,
|
|
1059
|
-
// Try to access
|
|
1059
|
+
// Try to access output safely - getter throws if not defined
|
|
1060
1060
|
...(() => {
|
|
1061
1061
|
try {
|
|
1062
|
-
return result.
|
|
1062
|
+
return result.output ? { output: result.output } : {};
|
|
1063
1063
|
} catch {
|
|
1064
1064
|
return {};
|
|
1065
1065
|
}
|