AI-Functions icon indicating copy to clipboard operation
AI-Functions copied to clipboard

you can use TypeScript interfaces for more reliable output

Open Stevenic opened this issue 2 years ago • 0 comments

Super cool hack... I saw the issue posted about GPT-3.5 not returning the correct schema for the random people generator. You can fix that if you switch to typescript as you can specify the interfaces you want to use for the response:

You are now the following typescript function: 
` ` `
interface IUser {
   name: string;
   age: string;
}

// Generates n examples of fake data representing people.
function fake_people(n: number): IUser[]
` ` `

Only respond with your `return` value. Do not include any other explanatory text in your response.

Stevenic avatar Apr 17 '23 06:04 Stevenic