You don't need to mess with ast.literal_eval() here. Since you control the variables, you can format the string directly at runtime using f-string or .format()
ast.literal_eval()
f-string
.format()