utils
¤
Functions:
Name | Description |
---|---|
can_be_jinja |
Checks if a string can be compiled using the jinja2 template engine. |
format_prompt_msg |
Formats a string using the jinja2 template engine if possible, otherwise uses the python string format. |
can_be_jinja
¤
Checks if a string can be compiled using the jinja2 template engine.
Source code in src/declarai/operators/utils.py
4 5 6 7 8 9 10 11 12 13 14 15 |
|
format_prompt_msg
¤
Formats a string using the jinja2 template engine if possible, otherwise uses the python string format. Args: _string: The string to format **kwargs: The kwargs to pass to the template
Returns: The formatted string
Source code in src/declarai/operators/utils.py
18 19 20 21 22 23 24 25 26 27 28 29 30 |
|