🐛 fix(memories.py): add condition to only add output_key field if template type is not VectorStoreRetrieverMemory

The output_key field is now only added to the template if the template type is not VectorStoreRetrieverMemory. This ensures that the output_key field is not added unnecessarily for templates of this type.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-01 09:43:17 -03:00
commit e04eb0fd7e

View file

@ -37,16 +37,17 @@ class MemoryFrontendNode(FrontendNode):
value="",
)
)
self.template.add_field(
TemplateField(
field_type="str",
required=False,
show=True,
name="output_key",
advanced=True,
value="",
if self.template.type_name not in {"VectorStoreRetrieverMemory"}:
self.template.add_field(
TemplateField(
field_type="str",
required=False,
show=True,
name="output_key",
advanced=True,
value="",
)
)
)
@staticmethod
def format_field(field: TemplateField, name: Optional[str] = None) -> None: