Hacker News new | ask | show | jobs
by A-Train 1080 days ago
I'm pretty surprised more people dont use logit biases to call openai with. Checking if something is either a or b means that the tokens for those letters must be 100 weight which means they will be chosen no matter what and no other character is allowed.
1 comments

If you're using OAI function calling, you can define a json schema with boolean values. If you have a handful of values, you can use an enum with a list of possible values.

Unless your prompt seriously conflicts with the schema, it's pretty consistent.