nemoguardrails.colang.v1_0.runtime.eval

View as Markdown

Module Contents

Functions

NameDescription
eval_expressionEvaluates the provided expression in the given context.

API

nemoguardrails.colang.v1_0.runtime.eval.eval_expression(
expr,
context
)

Evaluates the provided expression in the given context.

Parameters:

expr
str

The expression to be evaluated.

context
dict

The context containing variable values.

Returns:

The result of evaluating the expression.

Raises:

  • Exception: If there is an error evaluating the expression.