std1.0.0-beta-7 SafeC docs

std :: ml::llm

Function std::prompt_template_render

#include <std/ml/llm.h> source · definition

struct String prompt_template_render(const &char tmpl, const &Value vars)

Replaces every '{name}' occurrence in 'tmpl' with 'vars' object field 'name' (stringified: strings pass through as-is, numbers/bools render via their natural text form). A '{name}' whose key isn't present in 'vars' is left as literal text, unexpanded.