🚀 feat(memories.py): add input_key and output_key fields to MemoryFrontendNode template
The MemoryFrontendNode template now includes two new fields, input_key and output_key, which are string fields that are not required and are shown in the advanced section of the template. These fields can be used to specify the input and output keys for the memory node.
This commit is contained in:
parent
176738987b
commit
2c44cde2e0
1 changed files with 26 additions and 0 deletions
|
|
@ -18,6 +18,27 @@ class MemoryFrontendNode(FrontendNode):
|
|||
value=False,
|
||||
)
|
||||
)
|
||||
# add input_key and output_key str fields
|
||||
self.template.add_field(
|
||||
TemplateField(
|
||||
field_type="str",
|
||||
required=False,
|
||||
show=True,
|
||||
name="input_key",
|
||||
advanced=True,
|
||||
value="",
|
||||
)
|
||||
)
|
||||
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:
|
||||
|
|
@ -36,3 +57,8 @@ class MemoryFrontendNode(FrontendNode):
|
|||
field.required = False
|
||||
field.show = True
|
||||
field.advanced = False
|
||||
if field.name in ["input_key", "output_key"]:
|
||||
field.required = False
|
||||
field.show = True
|
||||
field.advanced = True
|
||||
field.value = ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue