Patch: improve type hint (#15451)

This commit is contained in:
chyroc
2024-01-03 14:39:27 +08:00
committed by GitHub
parent 8ebf55ebbf
commit b65e57971e
3 changed files with 7 additions and 7 deletions

View File

@@ -98,7 +98,7 @@ class FewShotPromptTemplate(_FewShotPromptTemplateMixin, StringPromptTemplate):
prefix: str = ""
"""A prompt template string to put before the examples."""
template_format: Union[Literal["f-string"], Literal["jinja2"]] = "f-string"
template_format: Literal["f-string", "jinja2"] = "f-string"
"""The format of the prompt template. Options are: 'f-string', 'jinja2'."""
@root_validator()

View File

@@ -65,7 +65,7 @@ class PromptTemplate(StringPromptTemplate):
template: str
"""The prompt template."""
template_format: Union[Literal["f-string"], Literal["jinja2"]] = "f-string"
template_format: Literal["f-string", "jinja2"] = "f-string"
"""The format of the prompt template. Options are: 'f-string', 'jinja2'."""
validate_template: bool = False