Added format_instructions to ZeroShotPrompt (#402)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-05-29 22:45:55 -03:00 • committed by GitHub
commit 09cb59d9d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 11 deletions

View file

@ -89,18 +89,18 @@ class ZeroShotPromptNode(BasePromptFrontendNode):
is_list=False,
show=True,
multiline=True,
value=prompt.SUFFIX,
name="suffix",
value=prompt.FORMAT_INSTRUCTIONS,
name="format_instructions",
),
TemplateField(
field_type="str",
required=False,
required=True,
placeholder="",
is_list=False,
show=True,
multiline=True,
value=prompt.FORMAT_INSTRUCTIONS,
name="format_instructions",
value=prompt.SUFFIX,
name="suffix",
),
],
)
@ -109,3 +109,7 @@ class ZeroShotPromptNode(BasePromptFrontendNode):
def to_dict(self):
return super().to_dict()
@staticmethod
def format_field(field: TemplateField, name: Optional[str] = None) -> None:
PromptFrontendNode.format_field(field, name)

View file

@ -273,6 +273,7 @@ def format_dict(d, name: Optional[str] = None):
"examples",
"code",
"headers",
"format_instructions",
]
# Replace dict type with str