llm
llm copied to clipboard
enable $ without template variables in system prompts
while working with a system prompt for latex generation, i found that $
characters in a template system prompt that don't refer to a template variable will cause an error since Template.extract_vars
will return a list containing None
values. by ignoring None
when checking for missing template vars, this error is avoided. using safe_substitute
over substitute
should be fine here because there is already a check for missing variables, and allows the use of $
characters that don't refer to template vars in a system prompt without raising an error for an invalid placeholder.