MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / StringTemplateLoader

Class StringTemplateLoader

codewiki/src/fe/template_utils.py:10–17  ·  view source on GitHub ↗

Custom Jinja2 loader for string templates.

Source from the content-addressed store, hash-verified

8
9
10class StringTemplateLoader(BaseLoader):
11 """Custom Jinja2 loader for string templates."""
12
13 def __init__(self, template_string: str):
14 self.template_string = template_string
15
16 def get_source(self, environment, template):
17 return self.template_string, None, lambda: True
18
19
20def render_template(template: str, context: Dict[str, Any]) -> str:

Callers 1

render_templateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected