Bot Message Instructions
You can provide instructions to the LLM on how to generate bot messages. The approach differs between Colang 1.0 and Colang 2.0.
Overview
Colang 2.0
Colang 1.0
In Colang 2.0, you use flow docstrings (Natural Language Descriptions) to provide instructions to the LLM. These docstrings are included in the prompt when the generation operator (...) is invoked.
Formal Greeting Example
The following example instructs the LLM to respond formally when the user greets:
Colang 2.0
Colang 1.0
The docstring in the bot respond formally flow provides the instruction. The ... (generation operator) triggers the LLM to generate the response following that instruction.
The LLM generates a response like:
Informal Greeting Example
The following example instructs the LLM to respond informally with a joke:
Colang 2.0
Colang 1.0
The LLM generates a response like:
Dynamic Instructions with Variables
You can also include dynamic context in your instructions:
Colang 2.0
Colang 1.0
In Colang 2.0, you can use Jinja2 syntax to include variables in flow docstrings:
This flexible mechanism allows you to alter generated messages based on context and specific requirements.