🐛 fix(base.py): set default value of frontend_node to None in ValidatePromptRequest class to avoid potential NoneType errors

🐛 fix(validate.py): set frontend_node to None instead of an empty dictionary in post_validate_prompt function to align with the default value in ValidatePromptRequest class
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-09-04 10:04:21 -03:00
commit 2ab3fcb28a
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ class ValidatePromptRequest(BaseModel):
name: str
template: str
# optional for tweak call
frontend_node: Optional[FrontendNodeRequest]
frontend_node: Optional[FrontendNodeRequest] = None
# Build ValidationResponse class for {"imports": {"errors": []}, "function": {"errors": []}}

View file

@ -35,7 +35,7 @@ def post_validate_prompt(prompt_request: ValidatePromptRequest):
if prompt_request.frontend_node is None:
return PromptValidationResponse(
input_variables=input_variables,
frontend_node={},
frontend_node=None,
)
old_custom_fields = get_old_custom_fields(prompt_request)