nemoguardrails.colang.v1_0.lang.parser

View as Markdown

Module Contents

Functions

NameDescription
_extract_flow_codeHelper to extract the source code for a flow.
parse_colang_fileParse the content of a .co file into the CoYML format.

Data

log

API

nemoguardrails.colang.v1_0.lang.parser._extract_flow_code(
file_content: str,
flow_elements: typing.List[dict]
) -> typing.Optional[str]

Helper to extract the source code for a flow.

Currently, it uses a simple heuristic that copies all the lines between the minimum and the maximum lines

nemoguardrails.colang.v1_0.lang.parser.parse_colang_file(
filename: str,
content: str,
include_source_mapping: bool = True
)

Parse the content of a .co file into the CoYML format.

nemoguardrails.colang.v1_0.lang.parser.log = logging.getLogger(__name__)