mirror of
https://github.com/hoshikawa2/first_contas.git
synced 2026-07-09 10:14:20 +00:00
15 lines
523 B
Python
15 lines
523 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from agente_contas_tim.workflows.conditions import resolve_value
|
|
|
|
|
|
def render_template(template: Any, context: dict[str, Any]) -> Any:
|
|
"""Resolve templates recursivos com paths $.x.y."""
|
|
if isinstance(template, dict):
|
|
return {key: render_template(value, context) for key, value in template.items()}
|
|
if isinstance(template, list):
|
|
return [render_template(item, context) for item in template]
|
|
return resolve_value(template, context)
|