LLM Flows
This section explains how to create LLM-driven flows in Colang 2.0.
Using Colang, you can describe complex patterns of interaction. However, as a developer, you will never be able to describe all the potential paths an interaction can take. This is where an LLM can help: by generating LLM-driven continuations at runtime.
The Dialog Rails and the Input Rails examples show how to use the LLM to generate continuations dynamically. The example below is similar to the dialog rails example, but it instructs the LLM to generate the bot response directly. Note, the quality of the response depends on the configured LLM model and can vary.
examples/v2_x/tutorial/llm_flows/rails.co
The main flow above waits for the user said something to match a user utterance, stores the result in the $question local variable, and then invokes the LLM through the ... (generation operator) to generate the continuation of the flow.
Context variables can be included in the NLD (Natural Language Description) of a flow (a.k.a., docstrings in Python) using double curly braces (the Jinja2 syntax).
Testing
This section concludes the Colang 2.0 getting started guide. Check out the Recommended Next Steps for the recommended way to continue learning about Colang 2.0.