🐛 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="", value="",
) )
) )
self.template.add_field( if self.template.type_name not in {"VectorStoreRetrieverMemory"}:
TemplateField( self.template.add_field(
field_type="str", TemplateField(
required=False, field_type="str",
show=True, required=False,
name="output_key", show=True,
advanced=True, name="output_key",
value="", advanced=True,
value="",
)
) )
)
@staticmethod @staticmethod
def format_field(field: TemplateField, name: Optional[str] = None) -> None: def format_field(field: TemplateField, name: Optional[str] = None) -> None: