fix: add prompt as field_type for validation

This commit is contained in:
Gabriel Almeida 2023-04-05 21:53:32 -03:00
commit a344ef2986

View file

@ -254,11 +254,12 @@ class PromptFrontendNode(FrontendNode):
# if field.field_type == "StringPromptTemplate"
# change it to str
if field.field_type == "StringPromptTemplate" and "Message" in str(name):
field.field_type = "str"
field.field_type = "prompt"
field.multiline = True
field.value = HUMAN_PROMPT if "Human" in field.name else SYSTEM_PROMPT
if field.name == "template" and field.value == "":
field.value = DEFAULT_PROMPT
field.field_type = "prompt"
if (
"Union" in field.field_type