Fix bug in PromptComponent

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-03-02 18:11:07 -03:00
commit bc3402586d

View file

@ -23,7 +23,7 @@ class PromptComponent(CustomComponent):
prompt_template = PromptTemplate.from_template(Text(template))
attributes_to_check = ["text", "page_content"]
for key, value in kwargs.items():
for key, value in kwargs.copy().items():
for attribute in attributes_to_check:
if hasattr(value, attribute):
kwargs[key] = getattr(value, attribute)