🐛 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:
parent
53c5a3ccde
commit
2ab3fcb28a
2 changed files with 2 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ class ValidatePromptRequest(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
template: str
|
template: str
|
||||||
# optional for tweak call
|
# optional for tweak call
|
||||||
frontend_node: Optional[FrontendNodeRequest]
|
frontend_node: Optional[FrontendNodeRequest] = None
|
||||||
|
|
||||||
|
|
||||||
# Build ValidationResponse class for {"imports": {"errors": []}, "function": {"errors": []}}
|
# Build ValidationResponse class for {"imports": {"errors": []}, "function": {"errors": []}}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ def post_validate_prompt(prompt_request: ValidatePromptRequest):
|
||||||
if prompt_request.frontend_node is None:
|
if prompt_request.frontend_node is None:
|
||||||
return PromptValidationResponse(
|
return PromptValidationResponse(
|
||||||
input_variables=input_variables,
|
input_variables=input_variables,
|
||||||
frontend_node={},
|
frontend_node=None,
|
||||||
)
|
)
|
||||||
old_custom_fields = get_old_custom_fields(prompt_request)
|
old_custom_fields = get_old_custom_fields(prompt_request)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue