Guidance
https://github.com/guidance-ai/guidance
gpt = models.OpenAI("gpt-3.5-turbo")
with user():
lm = gpt + "What is the capital of France?"
with assistant():
lm += gen("capital")
with user():
lm += "What is one short surprising fact about it?"
with assistant():
lm += gen("fact")
llama2 + 'Here is a math expression for two plus two: ' + grammar
gpt_instruct = models.OpenAI("gpt-3.5-turbo-instruct") with instruction(): lm = gpt_instruct + "What are the smallest cats?" lm += gen(stop=".")