Jinja2Config
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| ConfigModel llmling.config.base Base class for all LLMling configuration models. |
⋔ Inheritance diagram¶
graph TD
3992295014["models.Jinja2Config"]
2455074328["base.ConfigModel"]
330168112["schema.Schema"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
2455074328 --> 3992295014
330168112 --> 2455074328
3879467795 --> 330168112
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: ConfigModel
Configuration for Jinja2 environment.
See: https://jinja.palletsprojects.com/en/3.1.x/api/#jinja2.Environment
Source code in src/llmling/config/models.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |
block_end_string
class-attribute
instance-attribute
¶
String denoting the end of a block (default: '%}').
block_start_string
class-attribute
instance-attribute
¶
String denoting the beginning of a block (default: '{%').
comment_end_string
class-attribute
instance-attribute
¶
String denoting the end of a comment (default: '#}').
comment_start_string
class-attribute
instance-attribute
¶
String denoting the beginning of a comment (default: '{#').
extensions
class-attribute
instance-attribute
¶
List of Jinja2 extensions to load (e.g., 'jinja2.ext.do').
filters
class-attribute
instance-attribute
¶
Custom filters as mapping of names to import paths.
globals
class-attribute
instance-attribute
¶
Global variables available to all templates.
keep_trailing_newline
class-attribute
instance-attribute
¶
Preserve the trailing newline when rendering templates.
line_comment_prefix
class-attribute
instance-attribute
¶
Prefix that begins a line-based comment.
line_statement_prefix
class-attribute
instance-attribute
¶
Prefix that begins a line-based statement (e.g., '#' for line statements).
lstrip_blocks
class-attribute
instance-attribute
¶
Remove leading spaces and tabs from the start of a line to a block.
newline_sequence
class-attribute
instance-attribute
¶
Sequence that starts a newline (default: ' ').
tests
class-attribute
instance-attribute
¶
Custom tests as mapping of names to import paths.
trim_blocks
class-attribute
instance-attribute
¶
Remove first newline after a block (affects whitespace control).
undefined
class-attribute
instance-attribute
¶
Behavior when accessing undefined variables (default, strict, debug, chainable).
variable_end_string
class-attribute
instance-attribute
¶
String denoting the end of a variable (default: '}}').
variable_start_string
class-attribute
instance-attribute
¶
String denoting the beginning of a variable (default: '{{').
create_environment_kwargs
¶
Convert config to Jinja2 environment kwargs.
Creates a dictionary of kwargs for jinja2.Environment with proper conversion of special values.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict of kwargs for jinja2.Environment constructor |
Raises:
| Type | Description |
|---|---|
ValueError
|
If filter or test imports fail |