[Feat] Add support for f-string syntax in PromptTemplate (#38)

* Add support for f-string syntax in PromptTemplate
This commit is contained in:
ian_Cin
2023-10-04 16:40:09 +07:00
committed by GitHub
parent 56bc41b673
commit 2638152054
5 changed files with 183 additions and 66 deletions

View File

@@ -24,7 +24,7 @@ def test_set_attributes():
def test_check_redundant_kwargs():
template = PromptTemplate("Hello, {name}!")
prompt = BasePromptComponent(template, name="Alice")
with pytest.warns(UserWarning, match="Keys provided but not in template: {'age'}"):
with pytest.warns(UserWarning, match="Keys provided but not in template: age"):
prompt._BasePromptComponent__check_redundant_kwargs(name="Alice", age=30)