Looks like this was because I upgraded to zod@4 and one of the underlying libraries silently fails (possibly zod-to-json-schema which fails silently with zod@4).
Also, you have to wrap your schema in an object like this:
z.object({
memory: z.array(
z.string().describe('Memories extracted from the user message'),
),
});
vs. this:
z.array(
z.string().describe('Memories extracted from the user message'),
);
or you will get BadRequestError: 400 Invalid schema for response_format ‘memories’: schema must be a JSON Schema of ‘type: “object”’, got ‘type: “array”’.
downgraded to 3.25.76 and now get this funny error. does anyone have structured outputs working at all? seems unlikely that it would be completely broken
Yes, that was an issue for about two months. But with openai@^6.7.0 (released 6 hours ago), it works quite well now. Try it out the code you shared with this dependencies;