class_docstr: Takes a template string and a list of variables in input and returns the formatted string in output.
class_docstr_tok: ["Takes","a","template","string","and","a","list","of","variables","in","input","and","returns","the","formatted","string","in","output","."]
docstr: Takes a template string and a list of variables in input and returns the formatted string in output.
  
  If the template is not given, the component will use the one given at initialization.
docstr_tok: ["Takes","a","template","string","and","a","list","of","variables","in","input","and","returns","the","formatted","string","in","output",".","If","the","template","is","not","given",",","the","component","will","use","the","one","given","at","initialization","."]
code: def run(self, template: Optional[str] = None, **kwargs):
      """
      Takes a template string and a list of variables in input and returns the formatted string in output.
  
      If the template is not given, the component will use the one given at initialization.
      """
      if not template:
          template = self.template
      return {"string": template.format(**kwargs)}
  
imports: from typing import List, Any, Optional
  from haystack.core.component import component
label_desc: Use image node_id 2 for calling the FString obj's underlying member method code with example usage: obj.run(template) and returns: dict