Skip to content

Commit

Permalink
fix(generate-object): parse json
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Jan 8, 2025
1 parent f7b0903 commit 8658a12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/generate-object/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const generateObject = async <T extends Schema>(options: GenerateObjectOp
schemaName: undefined,
})
.then(async ({ finishReason, steps, text, usage }) => {
const result = await validate(options.schema, text)
const result = await validate(options.schema, JSON.parse(text!))

if (result.success) {
return {
Expand Down

0 comments on commit 8658a12

Please sign in to comment.