guidance.assistant

guidance.assistant() AbstractContextManager

Indicate the ‘assistant’ prompt

A convention has grown up around ‘chat’ APIs that prompts are split into three parts: system, user and assistant. This indicates the start of an ‘assistant’ block, which marks LLM response (or where the LLM will generate the next response).

>>> with assistant():
>>>     lm += gen(name="model_output", max_tokens=20)