Skip to content

Commit

Permalink
Update haystack/templates/source.py
Browse files Browse the repository at this point in the history
Co-authored-by: Madeesh Kannan <[email protected]>
  • Loading branch information
vblagoje and shadeMe authored Feb 16, 2024
1 parent babd00c commit 10a439c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions haystack/templates/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ def from_file(cls, file_path: Union[Path, str]) -> "TemplateSource":
return cls.from_str(file.read())

@classmethod
def from_predefined(cls, predefined_template_name: PredefinedTemplate) -> "TemplateSource":
def from_predefined(cls, predefined_template: PredefinedTemplate) -> "TemplateSource":
"""
Create a TemplateSource from a predefined template. See `PredefinedTemplate` for available options.
:param predefined_template_name: The name of the predefined template to use.
:param predefined_template: The name of the predefined template to use.
:return: An instance of `TemplateSource`.
"""
template_path = f"{Path(__file__).resolve().parent}/{predefined_template_name.value}{template_file_extension}"
template_path = f"{Path(__file__).resolve().parent}/{predefined_template.value}{template_file_extension}"
return cls.from_file(template_path)

@classmethod
Expand Down

0 comments on commit 10a439c

Please sign in to comment.