Skip to content

Commit 68b361c

Browse files
committed
add render
1 parent ab33589 commit 68b361c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

aiscript-runtime/src/endpoint.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,3 +602,8 @@ pub(crate) fn convert_field(field: ast::Field) -> Field {
602602
validators: Arc::from(field.validators),
603603
}
604604
}
605+
606+
pub fn render(template: &str, context: serde_json::Value) -> Result<String, String> {
607+
let engine = template::get_template_engine();
608+
engine.render(template, &context)
609+
}

0 commit comments

Comments
 (0)