We help companies build & improve their AI products with our hands-own services. Request a consultation here
- Patch the OpenAI client with Instructor
- Define a Zod schema for the structured response
- Call the
chat.completions.createmethod with the Zod schema as theresponse_model
chat.completions.create method and specifying the Zod schema as the response_model.
We will get back a response of type QuestionAnswerPairs and can save that as our Q&A dataset.
count Q&A pairs on the topic topic and return them as a structured response.
To customize this to your use case, you will want to adapt this prompt to include information on your use case.

