Skip to main content
generate(target, n, instructions) creates n values and returns them as a list, including when n=1.
Pass a structured type to generate objects:
Generated data is model output, not a statistically random sample or a source of verified facts. Use instructions for constraints that are not represented by the type. generate_async is the async counterpart. See the API reference for optional arguments and schema-generation helpers.