We will use Instructor in TypeScript to generate synthetic data for a question-answering task.
chat.completions.create
method with the Zod schema as the response_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.