3 ms·
You generally have to tell the LLM what you want it to generate and then enforce it, i.e, the LLM has to be somewhat aligned with the constraints. Otherwise, fo
by mmoskal 3y ago
You generally have to tell the LLM what you want it to generate and then enforce it, i.e, the LLM has to be somewhat aligned with the constraints. Otherwise, for example if you ask for JSON it will keep generating (legal) white-space or when you ask for C code it will say:
int sureICanHelpYouHereIsAnExampleOfTheCodeYouWereAskingFor;
In this case however, you can just do:
await aici.gen_text(regex=r"[a-zA-Z\n]+" stop_at = "\n")
Also note that there still a lot of work to figure out how it's easiest for the programmer of an LLM-enabled app to express these things - AICI is meant to make it simple to implement different surface syntaxes.