nemoguardrails.actions.v2_x.generation
nemoguardrails.actions.v2_x.generation
A set of actions for generating various types of completions using an LLMs.
Module Contents
Classes
Functions
Data
API
Bases: LLMGenerationActions
Adapted version of LLMGenerationActions for Colang 2.x.
It overrides some methods.
Initialize an index with colang flows.
The flows are expected to have full definition.
Args flows: The list of flows, i.e. the flow definition from the source code.
Returns An initialized index.
Initializes the index of flows.
Return True if there is a flow waiting for the provided event name and parameters.
Return True if a flow with the provided flow_id is defined.
Return True if a flow with the provided flow_id exists.
Create a new flow during runtime.
Generate the body for a flow.
Generate a continuation for the flow representing the current conversation.
Generate a flow from the provided instructions.
Generate a flow from the provided NAME.
Generate the canonical form for what the user said i.e. user intent.
Generate the canonical form for what the user said i.e. user intent and a suitable bot action.
Generate a value in the context of the conversation.
:param instructions: The instructions to generate the value. :param events: The full stream of events so far. :param var_name: The name of the variable to generate. :param llm: Custom llm model to generate_value
Remove the leading empty lines if they exist.
A line is considered empty if it has only white spaces.