-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Description
Description
I have the following schema in the experimental output zod schema
z.record(z.string(), z.string())
This generated propertyNames
which is incompatible with openapi3.0
responseBody: "{\n \"error\": {\n \"message\": \"Invalid schema for response_format 'response': In context=('properties', 'variables'), 'propertyNames' is not permitted.\",\n \"type\": \"invalid_request_error\",\n \"param\": \"response_format\",\n \"code\": null\n }\n}",
zod has a fix for this by passing the target when converting to jsonSchema colinhacks/zod#4841
For now, a fallback is to use jsonSchema
schema: jsonSchema(
z.toJSONSchema(MessageResponseSchema as any, {
target: "openapi-3.0",
}),
),
AI SDK Version
- ai: 5.0.60
- ai-sdk/azure: 2.0.30
Code of Conduct
- I agree to follow this project's Code of Conduct